title: iOS11 JB debugserver Failed to get connection from a remote gdb process
body: <p>So there is a jailbreak for iOS11 without substrate/cydia.
  Now I want to run debugserver after jb the device.</p>
  
  <p>I already signed with enough entitlements I think:</p>
  
  <pre><code>-bash-3.2# jtool --ent debugserver 
  &lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
  &lt;plist version="1.0"&gt;
      &lt;dict&gt;
          &lt;key&gt;platform-application&lt;/key&gt;
          &lt;true/&gt;
          &lt;key&gt;com.apple.backboardd.debugapplications&lt;/key&gt;
          &lt;true/&gt;
          &lt;key&gt;com.apple.backboardd.launchapplications&lt;/key&gt;
          &lt;true/&gt;
          &lt;key&gt;com.apple.diagnosticd.diagnostic&lt;/key&gt;
          &lt;true/&gt;
          &lt;key&gt;com.apple.frontboard.debugapplications&lt;/key&gt;
          &lt;true/&gt;
          &lt;key&gt;com.apple.frontboard.launchapplications&lt;/key&gt;
          &lt;true/&gt;
          &lt;key&gt;com.apple.springboard.debugapplications&lt;/key&gt;
          &lt;true/&gt;
          &lt;key&gt;com.apple.springboard.launchapplications&lt;/key&gt;
          &lt;true/&gt;
          &lt;key&gt;com.apple.security.network.client&lt;/key&gt;
          &lt;true/&gt;
          &lt;key&gt;com.apple.security.network.server&lt;/key&gt;
          &lt;true/&gt;
          &lt;key&gt;run-unsigned-code&lt;/key&gt;
          &lt;true/&gt;
          &lt;key&gt;get-task-allow&lt;/key&gt;
          &lt;true/&gt;
          &lt;key&gt;task_for_pid-allow&lt;/key&gt;
          &lt;true/&gt;
          &lt;key&gt;com.apple.system-task-ports&lt;/key&gt;
          &lt;true/&gt;
      &lt;/dict&gt;
  &lt;/plist&gt;
  </code></pre>
  
  <p>However when trying to <code>debugserver *:1234 -a UnityExample</code>, it always shows</p>
  
  <pre><code>Attaching to process UnityExample...
  Listening to port 1234 for a connection from *...
  Failed to get connection from a remote gdb process.
  </code></pre>
  
  <p>If I change the ip to iPhone IP, like <code>debugserver 192.168.1.157:1234 -a UnityExample</code>, it can actually wait:</p>
  
  <pre><code>Attaching to process UnityExample...
  Listening to port 1234 for a connection from 192.168.1.157...
  </code></pre>
  
  <p>But apparently, it will only allow connection from the device, so using mac's lldb won't work.</p>
  
  <p>I checked the kernel log, it prints:</p>
  
  <pre><code>Dec 27 10:21:54 iPhone1111 debugserver[564] &lt;Notice&gt;: 1 +0.000000 sec [0234/0303]: ::listen or ::bind failed err = 0x00000000
  </code></pre>
  
  <p>What did I miss? Thanks.</p>