Android: How to strace an app using ADB shell am start

后端 未结 7 1245
予麋鹿
予麋鹿 2020-12-13 11:37

I need help on stracing Android apps in the SDK emulator.

Here is my setup:

I have an Android SDK emulator running the Android API 4.03 ADB shell connected t

7条回答
  •  情书的邮戳
    2020-12-13 11:53

    This is an ugly one-liner hack I used today to solve this issue. Assuming the program has some known name, just try attaching to the process as soon as it appears. In this example, I'm interested in all calls to open.

    while true; do
      while ! ps  | grep -q -i MyProgram; do :; done;
      ps | grep -i MyProgram | while read a b c; do
       strace -e open -f -p $b;
      done;
    done
    

提交回复
热议问题