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
parent 9f39a5f2d6
commit 9977ca063c
2 changed files with 31 additions and 10 deletions

View File

@@ -461,17 +461,29 @@ 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
```
Then redirect that port:
```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`