ios remote debug

openssh

root/alpine

(setup source)  xcode.app/Developer/Platforms/iPhoneOS.platform/DeviceSupport/



PUTTY> ps -A
#copy process cmd
PHONE> stop process(Preferences.app)
PUTTY> cd /usr/bin/
PUTTY> ./debugserver port:2008 /Applications/softwind.app/_softwind // 有些是*:2008

MAC> lldb
MAC> platform select remote-ios
MAC> process connect connect://192.168.2.101:2008



other:
find . -name '*.DS_Store' -type f -delete
dpkg-deb -b  dir jf.deb
/var/lib/dpkg/info/del

=================
FAQ:
症状1:执行debugserver/目标程序,出现 Killed: 9 或闪退
解决:程序签名有异常,需要重新签名。
注意1:需要使用xml格式,而不是plist格式。2:使用LF(\r) unix换行格式。


症状2:出现Failed to get connection from a remote gdb process
解决:debugserver或者目标程序权限不足,需要重新签名entitlements(xml)
检查:
codesign -d --entitlements - debugserver/目标程序

ldid -e debugserver/目标程序
发现没有签名信息,或者缺少get-task-allow/task_for_pid-allow权限,则需要重新签名


症状3:IDA使用remote gdb方式连debugserver,无法下断点。

无法解决,debugserver默认是lldb协议的,debugserver不等于gdbserver,IDA的remote gdb仅支持gdbserver。可以尝试自己上传gdbserver


==签名文件(需要是unix换行格式)===

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>com.apple.springboard.debugapplications</key>
  <true/>
  <key>get-task-allow</key>
  <true/>
  <key>task_for_pid-allow</key>
  <true/>
  <key>run-unsigned-code</key>
  <true/>
</dict>
</plist>


签名代码

选择1:
PC> pscp -pw alpine root@192.168.2.101:/Developer/usr/bin/debugserver ./upfile/
MAC> codesign -s "iPhone Developer"  --entitlements entitlements.xml -f debugserver
PC> pscp -pw alpine ./upfile/debugserver root@192.168.2.101:/usr/bin/debugserver 
PUTTY> chmod a+x /usr/bin/bin/debugserver

## iPhone Developer 是mac上的签名证书文件,可以自行创建CA代码签名证书,或者使用-符号代替


 
选择2:
PUTTY> cp /Developer/usr/bin/debugserver /usr/bin/debugserver
PUTTY> chmod a+x debugserver
PUTTY> ldid -Sentitlements.xml debugserver


 



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值