scrcpy icon indicating copy to clipboard operation
scrcpy copied to clipboard

How to debug apk ?

Open dilbert168 opened this issue 7 years ago • 1 comments

I try to understand how the scrcpy-server on Android side works and try modifying the code.

  1. Is there a way to debug using AndroidStudio ? As it does not have "activity", it would not allow to debug.

  2. I have changed the line in "setScreenPowerMode( )" Ln.i("Device screen turned " + (mode == Device.POWER_MODE_OFF ? "OFF" : "ON"));

I copy the updated apk over but it still showing the original server code which print "[server] INFO: Device screen turned off" on console instead of "OFF"

How should I remove the old scrspy-server and install a updated one ? Thanks a lot for help.

dilbert168 avatar Nov 03 '19 17:11 dilbert168

Is there a way to debug using AndroidStudio ? As it does not have "activity", it would not allow to debug.

I just documented it on dev branch: https://github.com/Genymobile/scrcpy/commit/683f7ca848ad4785557d116dcea466f1b5654ef9

How should I remove the old scrspy-server and install a updated one ?

The server is pushed on every startup. The easiest way is to compile everything with:

ninja -Cx

Then run with:

./run x

rom1v avatar Nov 03 '19 18:11 rom1v