Skip to content

Instantly share code, notes, and snippets.

@smirn0v
Last active February 12, 2018 15:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smirn0v/0b4fefcb5d2452f716b1 to your computer and use it in GitHub Desktop.
Save smirn0v/0b4fefcb5d2452f716b1 to your computer and use it in GitHub Desktop.
Debugserver
$ cd /Applications/Xcode6-Beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/
# choose your platform
$ cd 7.1
# mount developer disk image
$ hdiutil attach DeveloperDiskImage.dmg
# copy debugserver
$ cp /Volumes/DeveloperDiskImage/usr/bin/debugserver ~/
$ cd ~/
# prepare entitlements
$ cat > entitlements.plist << 'EOF'
<!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>
EOF
# sign debugserver
$ codesign -s - --entitlements entitlements.plist -f debugserver
# copy debug server on the device with entitlements
$ scp -P 31337 debugserver root@127.0.0.1:~/
$ scp -P 31337 entitlements.plist root@127.0.0.1:~/
# run debugserver and attach to process
# on idevice
$ ~/debugserver *:31338 --attach=<PID>
# or
$ ./debugserver -x backboard *:31338 /var/mobile/Containers/Bundle/Application/F7C4437F-01B4-44BC-8BD7-031C572BCB5B/ICQ.app/ICQ
# on mac
$ lldb
(lldb) platform select --sysroot "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/9.1" remote-ios
(lldb) process connect connect://127.0.0.1:3138
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment