Android Wear Emulator:如何在模拟器上调试?

时间:2022-05-17 07:00:55

I have a simple application where in I am sending some message to Wear and receiving some from wear. Now how do I test this when I just have a real handheld device with a emulator? Whatever I do, the emulator does not connect to the device. In the Android Wear app on my mobile, it always says Target: disconnected.

我有一个简单的应用程序,我正在向Wear发送一些消息并从磨损中接收一些消息。现在,当我有一个真正的带有模拟器的手持设备时,我该如何测试呢?无论我做什么,模拟器都不会连接到设备。在我的手机上的Android Wear应用中,它总是说Target:已断开连接。

I have tried all permutations and combinations of following commands: adb forward tcp:4444 localabstract:/adb-hub; adb connect localhost:4444 adb -d forward tcp:5601 tcp:5601

我已经尝试了以下命令的所有排列和组合:adb forward tcp:4444 localabstract:/ adb-hub; adb connect localhost:4444 adb -d forward tcp:5601 tcp:5601

2 个解决方案

#1


0  

I usually run ddms from the Android SDK tools directory. It should attach to the emulator.

我通常从Android SDK工具目录运行ddms。它应该附加到模拟器。

#2


0  

adb -s 225bac78 -d forward tcp:5601 tcp:5601

replace 225bac78 with your handheld device name from adb devices

用adb设备中的手持设备名称替换225bac78

#1


0  

I usually run ddms from the Android SDK tools directory. It should attach to the emulator.

我通常从Android SDK工具目录运行ddms。它应该附加到模拟器。

#2


0  

adb -s 225bac78 -d forward tcp:5601 tcp:5601

replace 225bac78 with your handheld device name from adb devices

用adb设备中的手持设备名称替换225bac78