问题
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.
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
回答1:
I usually run ddms from the Android SDK tools directory. It should attach to the emulator.
回答2:
adb -s 225bac78 -d forward tcp:5601 tcp:5601
replace 225bac78 with your handheld device name from adb devices
来源:https://stackoverflow.com/questions/30236254/android-wear-emulator-how-to-debug-on-emulator