What does dynamic debugging do? Where static analysis is not easy to understand, dynamic debugging comes in handy!
Dynamic debugging can track the running process of the program, so as to understand the business logic of competing products.
steps
- Note that Android P cannot be used
- Install the apK modified with Android Killer on your phone
android:debuggable="true"
) - Start in debug mode
adb shell am start -D -n com.example.myapplication/com.example.myapplication.MainActivity
, the app will be in the state of waiting for debugging. adb shell ps | findstr com.example.myapplication
Check the pidu0_a78 3813 1399 1375708 30176 futex_wait 00000000 S com.example.myapplication Copy the code
adb forward tcp:8700 jdwp:3813
Establishing port Forwarding- Decompilated smali folder with Android Studio 3.x: File-> open
AndroidKiller_v1. 3.1 \ projects \ app - debug \ Project
.
X: File-> Profile or debug APK
- Using the Project view, right-click the Project Directory –> Mark Directory as… –> Sources root
- Android Studio 3.x: Run -> Edit Configuration -> Remote -> 8700
- debug app
The lazy script (more) please click https://github.com/andych008/cmd
Adbbind. Bat com. Example. Myapplication, complete process, find and port forwarding.
Use BusyBox. Make sure you have it on your phone.
@echo off
adb forward --remove tcp:8700
for /F %%i in ('adb shell busybox pidof %1') do ( set pid=%%i)
echo pid=%pid%
adb forward tcp:8700 jdwp:%pid%
netstat -nao | findstr "8700"
Copy the code
Further reading
-
Why can’t YOU use Android P
-
Smalidea watchers “Internal error”
-
Watch register showing “Collecting data”
-
Error: Cannot bind listener: cannot bind to 127.0.0.1:8700: This error indicates that port 8700 is occupied. Normally each socket address (protocol/network address/port) can only be used once.
Solution netstat nao | findstr searches “8700” find the process based on PID, the end of the process Open the task manager – > view – > options column (S) – > check the PID, determine the process – > button bar