iOS修改deubgserver调试所有APP
debugserver
1. 导出手机中任意一款APP签名
1 |
|
2. bash.entitlements文件内容
1 |
|
3. 导出debugserver中证书
debugserver可执行文件在/Developer/usr/bin/debugserver
1 |
|
4. 修改后的debug.entitlements文件
1 |
|
5. 使用debug.entitlements文件对debugserver进行重新签名
1 |
|
6. 上传到手机中
其他
文件瘦身
可以对debugserver进行瘦身减少文件大小(可选)
1 |
|
苹果codesign签名方式
1 |
|
常见问题
Failed to get connection from a remote gdb process
1
2
3
4
5
6
7iPhone-7:~ root# debugserver 127.0.0.1:1111 -a UCWEB
debugserver-@(#)PROGRAM:LLDB PROJECT:lldb-900.3.85
for arm64.
Attaching to process UCWEB...
Listening to port 1111 for a connection from localhost...
Failed to get connection from a remote gdb process.
Exiting.解决方案:
USB连接可能不稳定,重新插拔一下。
设备上可能已经有一个进程占用了端口1111,导致无法连接,ps -e看下是否有debugserver已经在运行,是的话就使用killall -9 debugserver,或者直接尝试换一个调试端口。
可能是你签名debugserver的权限文件中包含以下权限导致
1
2
3
4
5
6
7
8<key>com.apple.security.network.server</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
<key>seatbelt-profiles</key>
<array>
<string>debugserver</string>
</array>
failed to attach to process named
1 |
|
解决方案:找不到名字叫UCWEB的进程。尝试启动UCWEB后再执行命令即可。
rejecting incoming connection from ::ffff:127.0.0.1
1
2
3
4
5
6iPhone-7:~ root# debugserver *:1111 -a WeChat
debugserver-@(#)PROGRAM:LLDB PROJECT:lldb-900.3.57..2
for arm64.
Attaching to process WeChat...
Listening to port 1111 for a connection from *...
error: rejecting incoming connection from ::ffff:127.0.0.1 (expecting ::1)解决方案:
解决办法是指定使用ipv4地址
手机端:1
iPhone-7:~ root# debugserver 127.0.0.1:1111 -a WeChat
电脑端使用iproxy 2222 1111
1
(lldb) process connect connect://127.0.0.1:2222
参考文章
1 |
|