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

$ANDROID_SERIAL env variable is ignored #3111

Closed
2 tasks done
cledwynl opened this issue Mar 14, 2022 · 2 comments
Closed
2 tasks done

$ANDROID_SERIAL env variable is ignored #3111

cledwynl opened this issue Mar 14, 2022 · 2 comments

Comments

@cledwynl
Copy link

  • I have read the FAQ.
  • I have searched in existing issues.

Environment

  • OS: ArchLinux
  • scrcpy version: 1.23-1
  • installation method: pacman
  • device model: N/A
  • Android version: N/A

Describe the bug

The previous version(1.22-2) allows me to specify which device I want to cast by setting $ANDROID_SERIAL environment variable. In version 1.23-1, $ANDROID_SERIAL doesn't work anymore. If more than one device is connected, scrcpy will print this error and exit.

scrcpy 1.23 <https://github.com/Genymobile/scrcpy>
ERROR: Multiple (2) ADB devices:
ERROR:     -->   (usb)  xxxxxxx                        device  xxxxxx
ERROR:     --> (tcpip)  yy:5555                        device  yyyyyy
ERROR: Select a device via -s (--serial), -d (--select-usb) or -e (--select-tcpip)
ERROR: Server connection failed
rom1v added a commit that referenced this issue Mar 14, 2022
Like adb, read the ANDROID_SERIAL environment variable to select a
device by serial if no explicit selection (-s, -d, -e or --tcpip=<addr>)
is provided via the command line.

Fixes #3111 <#3111>
@rom1v
Copy link
Collaborator

rom1v commented Mar 14, 2022

The ANDROID_SERIAL environment variable was never read by scrcpy (only by adb), so it worked only as a side effect when scrcpy called adb without explicit serial.

Now (since #3005), scrcpy handles the device selection on its own, and always calls adb with an explicit -s parameter. That's why the side effect does not work anymore.

We could explicitly read this environment variable if no selector is specified: #3113

Please review/test.

rom1v added a commit that referenced this issue Mar 14, 2022
Like adb, read the ANDROID_SERIAL environment variable to select a
device by serial if no explicit selection (-s, -d, -e or --tcpip=<addr>)
is provided via the command line.

Fixes #3111 <#3111>
rom1v added a commit that referenced this issue Mar 14, 2022
Like adb, read the ANDROID_SERIAL environment variable to select a
device by serial if no explicit selection (-s, -d, -e or --tcpip=<addr>)
is provided via the command line.

Fixes #3111 <#3111>
rom1v added a commit that referenced this issue Mar 15, 2022
Like adb, read the ANDROID_SERIAL environment variable to select a
device by serial if no explicit selection (-s, -d, -e or --tcpip=<addr>)
is provided via the command line.

Fixes #3111 <#3111>
PR #3113 <#3113>
@rom1v
Copy link
Collaborator

rom1v commented Mar 15, 2022

Fixed by #3113.

@rom1v rom1v closed this as completed Mar 15, 2022
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

2 participants