I am trying to automate a test to check if a debugger is attached to my Android application. Currently, I can test it manually, but I would like to know how I can do this without using the Android Studio graphical interface.
The way my application checks if the debugger is attached is by reading the file proc//status, specifically the TraceId property.
I would like to know if there is a way to attach a debugger to an Android process programmatically or if there is a way to mock this debugger comportament. Any suggestions or code examples that could help me?
Thank you in advance for your assistance!
I tried using the jdb, but is missing something.
adb forward tcp:8000 jdwp:<pid>
jdb -attach localhost:8000
It’s open a jdb shell, but not change the TraceId property
You need to sign in to view this answers