Genymobile / Genymobile/scrcpy

When ADB disconnects, scrcpy immediately stops

Open
#6,607 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
150k
Forks
13.7k
Avg merge
4d 13h
Merged PRs (30d)
2

Description

### Problem
On some newer Android devices, locking or unlocking the screen causes the ADB connection to disconnect. When ADB is disconnected, scrcpy immediately stops, forcing the user to restart it every time.

### Solution
Instead of stopping when ADB gets disconnected, scrcpy could wait for a short period of time and attempt to reconnect automatically. A new option (for example `--reconnect-timeout=10s` or similar) could allow scrcpy to keep running while waiting for ADB to reconnect, and only exit if reconnection fails.

### Additional Notes
This would greatly improve usability on newer Android versions and devices with aggressive power or security behavior.

```
Microsoft Windows [Version 10.0.26200.7462]
(c) Microsoft Corporation. All rights reserved.

C:\Users\DELL>adb track-devices
001b 192.168.29.168:5555 device # device connected (stable)
001c 192.168.29.168:5555 offline # device screen unlocked → ADB disconnects
001c 192.168.29.168:5555 offline
0020 192.168.29.168:5555 authorizing # device asking for ADB authorization
001c 192.168.29.168:5555 offline
001b 192.168.29.168:5555 device # device reconnected after unlock
001c 192.168.29.168:5555 offline # device locked → ADB disconnected
001c 192.168.29.168:5555 offline
0020 192.168.29.168:5555 authorizing
001c 192.168.29.168:5555 offline
001b 192.168.29.168:5555 device # device reconnected after lock/unlock
```

### What I tested

- Android version: Android 16
- Device: OnePlus 11 5G
- Connection mode: Wireless ADB (TCP/IP over Wi-Fi)
- Host OS: Windows 11

@rom1v @yume-chan

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue names no source files or tests. Reproduce the wireless ADB disconnect with adb track-devices on Android 16, then trace the existing disconnect behavior; done means scrcpy waits for the configured period, reconnects when ADB returns, and exits when the timeout expires.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, c
Domain
mobile, networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.