ida动态调试

内容纲要

1.把ida 目录下android_server 传到android 目录中
如:
adb push  android_server /data/local/tmp/
adb shell 进入模拟器
cd /data/local/tmp/
chmod 755 android_server
/data/local/tmp/android_server
看到监听端口 23946


新开cmd adb forward tcp:23946 tcp:23946


debug启动app

adb shell am start -D -n  com.tencent.tmgp.sgame/.SGameActivity

测试其他应用 am start -D -n com.cm.common/com.cm.healthmanage.activity.LoginActivity

不知道这个应用mainactivity adb shell dumpsys  package com.cm.common

The debugger could not attach to the selected process.
This can perhaps indicate the process was just terminated, or that you dot't have the necessary privileges.
如图:
idadebugerror.png

猜测SELinux的问题,关闭SELinux后,成功,发现网上没有提到这个问题,这里记录下

附关闭SELinux的方法:
1、检测SELinux是否打开:getenforce
返回值:Enforcing:强制模式 Permissive:宽容模式 Disabled:关闭

2、临时关闭SELinux:setenforce 0
0为关闭,1为打开,执行后立即生效,无需重启


查看此app PID

ps 

记录下PID并转发下
adb forward tcp:8700 jdwp:PID

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

ok

参考 http://blog.csdn.net/three_feng/article/details/49404121

发表回复