Reputation: 1787
I genymotion emulator and my phone connected, I want to run and debug my application over wifi, I found the instruction to do so but I get this error when I enter this code:
adb tcpip 5555
I get this error:
error: more than one device/emulator
How can I make my device as default or something like that to solve this problem?
Upvotes: 24
Views: 56392
Reputation: 1350
just an heads-up for distracted people like me:
adb install -s host:port -d my.apk
will result in
more than one device/emulator
meanwhile:
adb -s host:port install -d my.apk
will work just fine
Upvotes: 1
Reputation: 2943
You can send commands to a specific device, according to docs:
$ adb devices
List of devices attached
emulator-5554 device
emulator-5555 device
$ adb -s emulator-5555 do_your_command
Also, if only one is emulator or a real device you can just attach -e
or -d
and send the command to it:
If you have multiple devices available, but only one is an emulator, use the -e option to send commands to the emulator. Likewise, if there are multiple devices but only one hardware device attached, use the -d option to send commands to the hardware device.
Upvotes: 52
Reputation: 4705
Do following thing which will help you,
You getting the message just because you are connected more than one device.
Run commands
adb devices
after the fire above command, you get the list of the device, From the list select your device id which not emulator and fire following command
adb -s f725aa8b7ce4(deviceId) tcpip 5555
and after this fire
adb connect yourIp 5555
Upvotes: 12
Reputation: 61
I was struggling with same issue since months, later while testing in postman I got know that "Appium inspector" is the main reason for this issue. As it creates new session Id and interrupt the running framework server.
Hence, adb kill-server
adb start-server
resolves the issue as it actually kill the session ID created by Appium inspector and starts new server.
Upvotes: 1