How To: Install GNU Debugger (GDB) On The iOS 5 Firmware Generation [Developers Only]

Hacker Pod2G has recently tweeted that he has written instructions on how to get GNU Debugger (GDB) working on the iOS 5 firmware generation. In case you do not know what GNU Debugger is, it essentially  allows you to see what is going on ‘inside’ another program while it executes — or what another program was doing at the moment it crashed. This is obvious only useful to developers and is not for the public.

GNU Debugger (GDB) iOS 5

Although GNU Debugger is actually on Cydia, it has not been updated to support iOS devices running iOS 4.3 and above. Thus, if you are a developer and would like to get GNU Debugger on the iOS 5 firmware generation or any firmware past iOS 4.3, then you will be glad to know in this how to you will find the instructions necessary to do just this thanks to @Pod2G.

How To Get GNU Debugger On iOS 5

Step 1) – The first thing you will need to do is make sure you have a Jailbroken iOS device running a firmware that is >= to iOS 4.3. Next you will need to have OpenSSH installed on your iOS device and have access to a Mac computer with the iOS SDK installed.

Step 2) – Next you will need to remove the GDB Cydia package from Cydia.

Step 3) – With the GDB package removed from Cydia you can fire up the Mac OS X terminal and type in the following list of commands:

cd /tmp
cp /Developer/Platforms/iPhoneOS.platform/Developer/usr/libexec/gdb/gdb-arm-apple-darwin .
lipo -thin armv7 gdb-arm-apple-darwin -output gdb
nano entitlements.xml

Step 4) – Now you will now need to paste the following into the Mac OS X terminal:

<!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/>
</dict>
</plist>

Step 5) – Save the file by doing CTRL + X, then ‘Y’, then ‘ENTER’.

Step 6) – Finally you will need to enter the commands shown below into the Mac OS X terminal.

ldid -Sentitlements.xml gdb
scp gdb root@<iOS Device IP Address>:/usr/bin/

Congratulations! You have just installed GNU Debugger (GDB) on your iPhone, iPod Touch or iPad running the iOS 4.3 firmware and above. Let us know if you have any further questions in the comments section below…

Don't forget to follow iJailbreak.com on Facebook, Twitter and Google+. Be sure to check out our partnership page where you can get mentorship on starting your own business online.
  • Fdffd

    ldid command does not exist on mac, can only be downloaded to a device via Cydia.. Im stuck..

  • skyg

    lipo -thin armv7 gdb-arm-apple-darwin -output gdb

    util/ldid.cpp(249): _assert(78:Swap(mach_header_->magic) == MH_MAGIC)

    why?