android 动态调试 遇到的问题

来源:互联网 发布:网站域名分类 编辑:程序博客网 时间:2024/06/03 15:47

windows 查看端口占用并关闭

cmd下输入如下命令:

netstat -ano  //查看系统端口netstat -ano | findstr "8700" //查询占用进程tasklist|findstr 进程号       //查看进程名taskkill /f /t /im pid taskkill /f /t /im /javaw.exe

android 查看端口占用并关闭

adb shell下输入如下命令:

netstat -anop | grep 80 | grep tcpps | grep android_serverkill -s 9 pid

ida 动态调试过程

1.上传android_server 到调试设备中并添加权限

1.adb shell push idaPath/android_server /data/local/tmp2.cd /data/local/tmp3.su4.chmod 777 android_server5../android_server

2.端口转发

adb forward tcp:23946 tcp:23946

3.用调试模式打开应用

adb shell am start -D -n com.xx.xx/.ui.LauncherUI

4.打开ida attach 附加并设置断点

5.通过DDMS获取端口号,然后将app恢复运行

jdb -connect com.sun.jdi.SocketAttach:hostname=127.0.0.1,port=xxxx

6.点击ida运行 等待断点 断下来 调试 黑喂狗!

原创粉丝点击