# 操作步骤

1. 下载 ida-pro 7.5
2. 打开命令行窗口，执行 ```shell
    adb shell
    
    su
    ```
3. 再把ida 目录下的dbgsrv的目录下的 android\_server(先看下手机是32位还是64位，32位选择32位的android\_server，64位选择64位的android\_server)复制到 /data/user/0/server下（没有目录先创建目录）
4. ```shell
    # 以x86为例
    chomod +x android_x86_server
    # 修改名称
    move android_x86_server asd
    # 执行
    ./asd
    ```
5. 打开ddms
6. 找到要调试的app[![47E22905-2E09-44ee-AA74-8DDFEAA61311.png](http://wiki.shopqorg.com/uploads/images/gallery/2022-06/scaled-1680-/47e22905-2e09-44ee-aa74-8ddfeaa61311.png)](http://wiki.shopqorg.com/uploads/images/gallery/2022-06/47e22905-2e09-44ee-aa74-8ddfeaa61311.png)
7. jdb -connect com.sun.jdi.SocketAttach:hostname=127.0.0.1,port=8614【jdk版本1.8，port 是上图中的8614】
8. 设置端口转发 ```shell
    adb forward tcp:23946 tcp:23946
    ```
9. 打开ida-pro[![0F3819A2-A621-4e9d-8C5B-1F621020E7F4.png](http://wiki.shopqorg.com/uploads/images/gallery/2022-06/scaled-1680-/0f3819a2-a621-4e9d-8c5b-1f621020e7f4.png)](http://wiki.shopqorg.com/uploads/images/gallery/2022-06/0f3819a2-a621-4e9d-8c5b-1f621020e7f4.png)
10. 选择remote Linux debugger
11. [![image-1654571719823.png](http://wiki.shopqorg.com/uploads/images/gallery/2022-06/scaled-1680-/image-1654571719823.png)](http://wiki.shopqorg.com/uploads/images/gallery/2022-06/image-1654571719823.png)
12. 选中3项
13. 在hostname 中填写127.0.0.1 port 填写23946 （与端口转发的要一致） [![image-1654572252137.png](http://wiki.shopqorg.com/uploads/images/gallery/2022-06/scaled-1680-/image-1654572252137.png)](http://wiki.shopqorg.com/uploads/images/gallery/2022-06/image-1654572252137.png)
14. [![image-1654572543864.png](http://wiki.shopqorg.com/uploads/images/gallery/2022-06/scaled-1680-/image-1654572543864.png)](http://wiki.shopqorg.com/uploads/images/gallery/2022-06/image-1654572543864.png)