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
I've found a tricky way to do this and also guarantee that all the syscalls are going to be catch. It can be done even if the app is not debuggable:
am) to put the app in debug mode with a -w option that will halt its execution until it is attached to a debuggeram startHere are the steps:
adb shell # shell into the device
am set-debug-app -w com.package.name # put app to debug mode
am start com.package.name/com.path.to.MainActivity # start the app
ps -A | grep com.package.name # this will show you the PID
strace -p > appoutput.txt 2> appstrace.txt
# strace the program and record its output and strace in txt files
Now just attach the debugger and enjoy, you can do it for example in Android Studio or Eclipse. From this point on the execution will begin and you will be able to trace it since the very first line of code.