Skip to content

Instantly share code, notes, and snippets.

@acoomans
Last active March 29, 2026 01:53
Show Gist options
  • Select an option

  • Save acoomans/51d359fc96f5dd3393dc to your computer and use it in GitHub Desktop.

Select an option

Save acoomans/51d359fc96f5dd3393dc to your computer and use it in GitHub Desktop.
Remote iOS lldb debugging

Remote iOS lldb debugging

http://versprite.com/og/ios-reverse-engineering-part-one-configuring-lldb/

Installing

Find the debug server from the device support disk:

ls -d /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/* | sort | tail -n1
  hdiutil attach /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/8.0\ \(12A365\)/DeveloperDiskImage.dmg

Copy and install the debug server:

cp /Volumes/DeveloperDiskImage/usr/bin/debugserver .

cat > entitlements.plist <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!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>run-unsigned-code</key>
    <true/>
    <key>get-task-allow</key>
    <true/>
    <key>task_for_pid-allow</key>
    <true/>
</dict>
</plist>
EOF

codesign -s - --entitlements entitlements.plist -f debugserver

scp -o port=2222 debugserver root@localhost:~/

Usage

On iPhone:

~/debugserver *:6666 --attach PATH_TO_APP_BIN

On Mac:

lldb
  platform select remote-ios
  process connect connect://192.168.0.8:6666
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment