iOS11 JB debugserver无法从远程gdb进程获取连接

时间:2017-12-27 02:24:02

标签: ios jailbreak

因此iOS11有一个没有底座/ cydia的越狱。 现在我想在jb设备之后运行debugserver。

我已经签署了足够的权利,我认为:

-bash-3.2# jtool --ent debugserver 
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <key>platform-application</key>
        <true/>
        <key>com.apple.backboardd.debugapplications</key>
        <true/>
        <key>com.apple.backboardd.launchapplications</key>
        <true/>
        <key>com.apple.diagnosticd.diagnostic</key>
        <true/>
        <key>com.apple.frontboard.debugapplications</key>
        <true/>
        <key>com.apple.frontboard.launchapplications</key>
        <true/>
        <key>com.apple.springboard.debugapplications</key>
        <true/>
        <key>com.apple.springboard.launchapplications</key>
        <true/>
        <key>com.apple.security.network.client</key>
        <true/>
        <key>com.apple.security.network.server</key>
        <true/>
        <key>run-unsigned-code</key>
        <true/>
        <key>get-task-allow</key>
        <true/>
        <key>task_for_pid-allow</key>
        <true/>
        <key>com.apple.system-task-ports</key>
        <true/>
    </dict>
</plist>

但是,在尝试debugserver *:1234 -a UnityExample时,它始终会显示

Attaching to process UnityExample...
Listening to port 1234 for a connection from *...
Failed to get connection from a remote gdb process.

如果我将ip更改为iPhone IP,例如debugserver 192.168.1.157:1234 -a UnityExample,它实际上可以等待:

Attaching to process UnityExample...
Listening to port 1234 for a connection from 192.168.1.157...

但显然,它只允许来自设备的连接,所以使用mac的lldb不会起作用。

我检查了内核日志,打印出来:

Dec 27 10:21:54 iPhone1111 debugserver[564] <Notice>: 1 +0.000000 sec [0234/0303]: ::listen or ::bind failed err = 0x00000000

我错过了什么?感谢。

3 个答案:

答案 0 :(得分:2)

与我相同。

我绕过这个:

  • 使用USB
  • 将设备连接到mac
  • 使用usbmuxd将mac上的本地端口1234转发到远程 设备上的1234
  • 然后运行debugserver localhost:1234 -a pid
  • 并在lldb:process connect connect:// localhost:1234

这应该有效。不幸的是我只能调试我自己的应用程序。例如,调试Chrome.app可以很好地启动并且只要我处于初始暂停状态就可以工作,但是我恢复它的那一刻就失败了EXC_BAD_ACCESS

答案 1 :(得分:0)

在越狱设备上,ssh到设备中:

/Developer/usr/bin/debugserver 127.0.0.1:6666 -a 1393

我在使用*:6666

时报告的错误相同

你有没有试过这篇文章:

https://kov4l3nko.github.io/blog/2016-04-27-debugging-ios-binaries-with-lldb/

它解释了通过USB连接到越狱的iOS设备,将文件发送到设备,ssh到设备以及设置调试器(lldb)。

答案 2 :(得分:0)

删除调试服务器文件 com.apple.security.network.server com.apple.security.network.client 安全带型材 这三个设置,然后重新登录DebugServer。