Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android - adb more than one device/emulator

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 ?

like image 503
Navid Abutorab Avatar asked May 23 '18 11:05

Navid Abutorab


People also ask

Which adb option should be used if multiple devices are connected?

If there\'s only one emulator running or only one device connected, the adb command is sent to that device by default. If multiple emulators are running and/or multiple devices are attached, you need to use the -d, -e, or -s option to specify the target device to which the command should be directed.

How do I connect multiple devices to Scrcpy?

If multiple devices are connected you can select the device to connect to by specify it's serial number. This is documented on the scrcpy help page. Therefore you can start one scrcpy instance per device.


2 Answers

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.

like image 198
Suleyman Avatar answered Oct 11 '22 16:10

Suleyman


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
like image 22
Dhaval Solanki Avatar answered Oct 11 '22 16:10

Dhaval Solanki