Add debugging method for Android >= 11

Fixes #5346 <https://github.com/Genymobile/scrcpy/issues/5346>
PR #5466 <https://github.com/Genymobile/scrcpy/pull/5466>

Signed-off-by: Romain Vimont <rom@rom1v.com>
This commit is contained in:
Enno Boland 2024-11-10 19:17:45 +01:00 committed by Romain Vimont
commit dc82425769
2 changed files with 32 additions and 10 deletions

View file

@ -461,17 +461,30 @@ meson setup x -Dserver_debugger=true
meson configure x -Dserver_debugger=true
```
Then recompile.
Then recompile, and run scrcpy.
When you start scrcpy, it will start a debugger on port 5005 on the device.
For Android < 11, it will start a debugger on port 5005 on the device and wait:
Redirect that port to the computer:
```bash
adb forward tcp:5005 tcp:5005
```
In Android Studio, _Run_ > _Debug_ > _Edit configurations..._ On the left, click on
`+`, _Remote_, and fill the form:
For Android >= 11, first find the listening port:
```bash
adb jdwp
# press Ctrl+C to interrupt
```
Then redirect the resulting PID:
```bash
adb forward tcp:5005 jdwp:XXXX # replace XXXX
```
In Android Studio, _Run_ > _Debug_ > _Edit configurations..._ On the left, click
on `+`, _Remote_, and fill the form:
- Host: `localhost`
- Port: `5005`