Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What causes the "more than one divice/emulator" and how do I fix it? #485

Closed
MrMondayHonday opened this issue Apr 1, 2019 · 15 comments
Closed

Comments

@MrMondayHonday
Copy link

Hi, the newbie here again.

For some reason I can no longer launch scrcpy.
after typing the usual adb tcpip and followed by the adb connect plus scrcpy I get:

adb: error: connect failed: more than one device/emulator
ERROR: adb push" returned with value 1

So, what causes this and how can I fix it?

@npes87184
Copy link
Contributor

The problem is you have more than one devices connected to your PC.

Using adb devices first.

And start scrcpy by scrcpy -s [TARGET DEVICE'S SERIAL].

@MrMondayHonday
Copy link
Author

MrMondayHonday commented Apr 1, 2019

Thank you, I will investigate and try this.
But I have only one device connected to my ubuntu laptop. and that is my samsung phone.
However, I have noticed that it shows up as two distinct drives in my file manager, one called samsung android and the other mtp I believe. But this is not something new if related, and it worked before.

@zhurai
Copy link

zhurai commented Apr 2, 2019

Just as a general FYI, if you have emulators running on your computer, those are also considered "other devices" by adb

@MrMondayHonday
Copy link
Author

A restart of computer and phone fixed it.
I did not have any emulators running as far as I know.

But thanks!

@rom1v
Copy link
Collaborator

rom1v commented Apr 2, 2019

If you were connected both via USB and via adb connect, you have 2 devices connected in adb devices.

@rom1v rom1v closed this as completed May 4, 2019
@jemckaleman
Copy link

The problem is you have more than one devices connected to your PC.

Using adb devices first.

And start scrcpy by scrcpy -s [TARGET DEVICE'S SERIAL].

An excellent contribution, good work bredrin

@kaiphu
Copy link

kaiphu commented Jul 14, 2020

I have the same issue cause I have multiple emulators running while I'm trying to use scrcpy just for my usb device. (scrcpy does work while the emulators are off, but I want to use it while they are on.) I have tried [scrcpy -s ****** and scrcpy usb] however it hits me with the "error: device unauthorized." When I [adb devices] while my phone is plugged in and have the emulators running only my phone shows up in devices. (unauthorized) Yes phone usb debugging is on. How can I get everything working at the same time?

EDIT: Easy solve lol
Run your emulators before you run scrcpy. Use [scrcpy -s DEVICE_CODE] to start.

@Medievaldragon
Copy link

Hi, the newbie here again.

For some reason I can no longer launch scrcpy. after typing the usual adb tcpip and followed by the adb connect plus scrcpy I get:

adb: error: connect failed: more than one device/emulator ERROR: adb push" returned with value 1

So, what causes this and how can I fix it?

The correct answer is:

  1. On your Windows 10 PC, press CTRL + ALT + DEL
  2. Select Task Manager.
  3. Under the Processes Tab, and under Background Processes -- locate adb.exe
  4. Click adb.exe
  5. press the END TASK button.
  6. You can try running the CMD data you tried earlier. There won't be emulators running because you ended the adb.exe task. That was the emulator.

@rdp
Copy link

rdp commented Dec 21, 2021

Interesting. If I connect a device via USB, then connect via scrcpy --tcpip, then hit the x, then attempt to connect via scrcpy or scrcpy --tcpip it says this message and cannot connect to either of them. I would have expected scrcpy to select the "non tcp" one if tcpip isn't specified, and the tcp one if tcpip is specified. Regardless, maybe the error message could be made more friendly? Maybe something like "more than one divice/emulator, please run adb devices and then select one via the -s parameter" or something like that?

@rom1v
Copy link
Collaborator

rom1v commented Dec 21, 2021

This message is printed by adb, not scrcpy: https://github.com/Genymobile/scrcpy/blob/master/FAQ.md#several-devices-connected.

Whenever there are several devices connected (i.e. several lines in adb devices), any adb command must specify explicitly which device to use.

I would have expected scrcpy to select the "non tcp" one if tcpip isn't specified, and the tcp one if tcpip is specified.

--tcpip is an option to reconfigure a specific device (specified by -s, optionally if there is only one) to listen on TCP/IP, then reconnect. It does not mean "prefer a TCP/IP-connected device".

See highlights of v1.21: https://github.com/Genymobile/scrcpy/releases/tag/v1.21

@rdp
Copy link

rdp commented Jan 28, 2022

Yeah I'm familiar with it, but the operation is a bit confusing to me sometimes..

What happens for me is, I plug it into USB:

 % scrcpy --tcpip

OK, it's ready to go via TCP/IP if I "want it"

But I want to connect again via USB before unconnecting it, so I run scrcpy again:

% scrcpy        
scrcpy 1.21 <https://github.com/Genymobile/scrcpy>
error: more than one device/emulator
2022-01-28 10:06:47.528 scrcpy[67413:1859380] ERROR: "adb get-serialno" returned with value 1
2022-01-28 10:06:47.528 scrcpy[67413:1859380] ERROR: Could not get device serial
2022-01-28 10:06:47.952 scrcpy[67413:1859323] ERROR: Server connection failed

Then it's like "oh shoot, let me try connecting via tcp"

 % scrcpy  --tcpip
scrcpy 1.21 <https://github.com/Genymobile/scrcpy>
error: more than one device/emulator

Which is a "mis use", but with it plugged in it feels like I can connect to neither now (since running that initially caused a connection).

Suggestion/feature requests: parse the output of adb so you can give a hint that they need to select a particular device, or run adb devices first (and parse output) to pre-check if there's more than one device already and they didn't specify a -s? Or maybe when they run --tcpip, only connect the port, don't actually display the screen, and tell the user "now run it like scrcpy --tcpip=X.X.X.X:5555 to connect" or something to force them to differentiate. Just some ideas. Thanks.

@rom1v
Copy link
Collaborator

rom1v commented Jan 28, 2022

Which is a "mis use", but with it plugged in it feels like I can connect to neither now (since running that initially caused a connection).

Yes, I'm aware of this source of confusion (I have already been confused by this). As soon as there are several devices (according to adb devices), -s must be explicitly passed (or --tcpip=...).

--tcpip in both variants have been added recently to simplify automatic switch to TCP/IP mode and connection, but --tcpip does not mean "select a device which is currently connected via TCP/IP", but "switch the current device to TCP/IP".

Suggestion/feature requests: parse the output of adb so you can give a hint that they need to select a particular device

I agree, scrcpy could list the connected devices by connecting to the adb daemon (like autoadb does) and select the correct device accordingly (but I'm not sure we can detect that two devices listed by adb are "the same", once via usb and once by TCP/IP, without actually connecting to them).

@rom1v
Copy link
Collaborator

rom1v commented Feb 6, 2022

@rdp Please take a look at #3005.

@shijinthottiyil
Copy link

The problem is you have more than one devices connected to your PC.

Using adb devices first.

And start scrcpy by scrcpy -s [TARGET DEVICE'S SERIAL].

those who are noob like me [TARGET DEVICE'S SERIAL] means the device IP address

@geryit
Copy link

geryit commented Jul 16, 2024

The problem is you have more than one devices connected to your PC.
Using adb devices first.
And start scrcpy by scrcpy -s [TARGET DEVICE'S SERIAL].

those who are noob like me [TARGET DEVICE'S SERIAL] means the device IP address

yes, scrcpy -s 192.168.0.232:5555 worked for me (192.168.0.23 is my phone's ip)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants