I am trying to run may sample application of wear in Samsung Galaxy Gear S. But I am getting device not connected. Also, I have enabled usb debugging. So anyone know how to run sample application in Samsung Galaxy Gear S through Android studio?
我试图运行三星Galaxy Gear S的样品应用程序。但我得到的设备没有连接。另外,我启用了usb调试。所以任何人都知道如何通过Android工作室在三星Galaxy Gear S中运行示例应用程序?
1 个解决方案
#1
0
-
If you're on Windows, make sure you've installed the ADB drivers through Device Manager.
如果您使用的是Windows,请确保已通过“设备管理器”安装了ADB驱动程序。
-
If you're on Linux, make sure you've configured your udev rules by following the setup guide on the Android Developer site
如果您使用的是Linux,请确保按照Android开发人员网站上的设置指南配置了udev规则
http://developer.android.com/tools/device.html#setting-up
Generally, this means creating a file at /etc/udev/rules.d/51-android.rules with a line like the following:
通常,这意味着在/etc/udev/rules.d/51-android.rules上创建一个文件,其行如下所示:
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666", GROUP="plugdev"
SUBSYSTEM ==“usb”,ATTR {idVendor} ==“0bb4”,MODE =“0666”,GROUP =“plugdev”
You can get the vendor id by running
lsusb
. Also, make sure you're in theplugdev
group.您可以通过运行lsusb来获取供应商ID。另外,请确保您在plugdev组中。
-
If neither of those apply (and since you said you've already enabled USB debugging on the device), check to make sure that your USB cable and the charging cradle are mechanically sound.
如果这些都不适用(并且因为您说您已经在设备上启用了USB调试),请检查以确保USB电缆和充电座是机械声音。
-
Failing all that, open up the Android Wear app on your phone and enable Bluetooth Debugging. Here are the steps to enable it:
如果做不到这一点,请打开手机上的Android Wear应用并启用蓝牙调试。以下是启用它的步骤:
Enable USB debugging on the handheld:
在手持设备上启用USB调试:
- Open the Settings app and scroll to the bottom.
- If it doesn't have a Developer Options setting, tap About Phone (or About Tablet), scroll to the bottom, and tap the build number 7 times.
- Go back and tap Developer Options.
- Enable USB debugging.
打开“设置”应用并滚动到底部。
如果它没有“开发者选项”设置,请点击“关于手机”(或“关于平板电脑”),滚动到底部,然后点击内置版本号7次。
返回并点按开发者选项。
启用USB调试。
You'll then be able to use ADB-over-IP to connect to the Android Wear device, using your phone as a proxy. Make sure you have your phone connected via USB and that you have USB debugging enabled, of source. Instructions:
然后,您将能够使用ADB-over-IP连接到Android Wear设备,将您的手机用作代理。确保通过USB连接手机并启用了USB调试功能。说明:
Set Up a Debugging Session
设置调试会话
- On the handheld, open the Android Wear companion app.
- Tap the menu on the top right and select Settings.
-
Enable Debugging over Bluetooth. You should see a tiny status summary appear under the option:
通过蓝牙启用调试。您应该会在选项下看到一个很小的状态摘要:
Host: disconnected Target: connected
在掌上电脑上,打开Android Wear配套应用。
点按右上角的菜单,然后选择设置。
Connect the handheld to your machine over USB and run:
通过USB将手持设备连接到您的机器并运行:
adb forward tcp:4444 localabstract:/adb-hub adb connect localhost:4444
Note: You can use any available port that you have access to. In the Android Wear companion app, you should see the status change to:
注意:您可以使用您有权访问的任何可用端口。在Android Wear随播广告应用中,您应该会看到状态更改为:
Host: connected Target: connected
Debug Your App Your wearable should show up as localhost:4444 when running adb devices. To run any adb command, use this format: adb -s localhost:4444 If there are no other devices connected over TCP/IP (namely emulators), you can shorten the command to:
调试您的应用程序运行adb设备时,您的可穿戴设备应显示为localhost:4444。要运行任何adb命令,请使用以下格式:adb -s localhost:4444如果没有通过TCP / IP连接的其他设备(即模拟器),则可以将命令缩短为:
adb -e For example:
adb -e例如:
adb -e logcat adb -e shell adb -e bugreport
adb -e logcat adb -e shell adb -e bugreport
Source: Android Developers - Debugging over Bluetooth
来源:Android开发者 - 通过蓝牙进行调试
#1
0
-
If you're on Windows, make sure you've installed the ADB drivers through Device Manager.
如果您使用的是Windows,请确保已通过“设备管理器”安装了ADB驱动程序。
-
If you're on Linux, make sure you've configured your udev rules by following the setup guide on the Android Developer site
如果您使用的是Linux,请确保按照Android开发人员网站上的设置指南配置了udev规则
http://developer.android.com/tools/device.html#setting-up
Generally, this means creating a file at /etc/udev/rules.d/51-android.rules with a line like the following:
通常,这意味着在/etc/udev/rules.d/51-android.rules上创建一个文件,其行如下所示:
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666", GROUP="plugdev"
SUBSYSTEM ==“usb”,ATTR {idVendor} ==“0bb4”,MODE =“0666”,GROUP =“plugdev”
You can get the vendor id by running
lsusb
. Also, make sure you're in theplugdev
group.您可以通过运行lsusb来获取供应商ID。另外,请确保您在plugdev组中。
-
If neither of those apply (and since you said you've already enabled USB debugging on the device), check to make sure that your USB cable and the charging cradle are mechanically sound.
如果这些都不适用(并且因为您说您已经在设备上启用了USB调试),请检查以确保USB电缆和充电座是机械声音。
-
Failing all that, open up the Android Wear app on your phone and enable Bluetooth Debugging. Here are the steps to enable it:
如果做不到这一点,请打开手机上的Android Wear应用并启用蓝牙调试。以下是启用它的步骤:
Enable USB debugging on the handheld:
在手持设备上启用USB调试:
- Open the Settings app and scroll to the bottom.
- If it doesn't have a Developer Options setting, tap About Phone (or About Tablet), scroll to the bottom, and tap the build number 7 times.
- Go back and tap Developer Options.
- Enable USB debugging.
打开“设置”应用并滚动到底部。
如果它没有“开发者选项”设置,请点击“关于手机”(或“关于平板电脑”),滚动到底部,然后点击内置版本号7次。
返回并点按开发者选项。
启用USB调试。
You'll then be able to use ADB-over-IP to connect to the Android Wear device, using your phone as a proxy. Make sure you have your phone connected via USB and that you have USB debugging enabled, of source. Instructions:
然后,您将能够使用ADB-over-IP连接到Android Wear设备,将您的手机用作代理。确保通过USB连接手机并启用了USB调试功能。说明:
Set Up a Debugging Session
设置调试会话
- On the handheld, open the Android Wear companion app.
- Tap the menu on the top right and select Settings.
-
Enable Debugging over Bluetooth. You should see a tiny status summary appear under the option:
通过蓝牙启用调试。您应该会在选项下看到一个很小的状态摘要:
Host: disconnected Target: connected
在掌上电脑上,打开Android Wear配套应用。
点按右上角的菜单,然后选择设置。
Connect the handheld to your machine over USB and run:
通过USB将手持设备连接到您的机器并运行:
adb forward tcp:4444 localabstract:/adb-hub adb connect localhost:4444
Note: You can use any available port that you have access to. In the Android Wear companion app, you should see the status change to:
注意:您可以使用您有权访问的任何可用端口。在Android Wear随播广告应用中,您应该会看到状态更改为:
Host: connected Target: connected
Debug Your App Your wearable should show up as localhost:4444 when running adb devices. To run any adb command, use this format: adb -s localhost:4444 If there are no other devices connected over TCP/IP (namely emulators), you can shorten the command to:
调试您的应用程序运行adb设备时,您的可穿戴设备应显示为localhost:4444。要运行任何adb命令,请使用以下格式:adb -s localhost:4444如果没有通过TCP / IP连接的其他设备(即模拟器),则可以将命令缩短为:
adb -e For example:
adb -e例如:
adb -e logcat adb -e shell adb -e bugreport
adb -e logcat adb -e shell adb -e bugreport
Source: Android Developers - Debugging over Bluetooth
来源:Android开发者 - 通过蓝牙进行调试