Guides‎ > ‎iOS Programming‎ > ‎

Building and Running iOS Applications Without A Paid Developer License

The following guide explains how to build an unsigned iOS application in Xcode, add the necessary SHA1 hashes to the compiled binary, and transfer the application to an iOS device. Typically, Xcode will only allow applications to be built and run in the iOS Simulator unless you have paid the $99 for an Apple developer's license. I strongly recommend that you eventually purchase said license so Apple continues to provide Xcode itself and their on-line development resources for free. However, bypassing these restrictions is very useful for those that aren't quite ready to begin submitting apps to the iTunes Application store or those that want to create jailbreak-only applications or extensions.

This guide was put together after my first attempt of running my application on my device. I found many different tutorials explaining this process, but they all seemed to follow different procedures and none of them completely worked. The following process worked for me and seemed to be the simplest method. As I continue learning more about iOS application and jailbreak extension development, I will revise this guide.


Requirements:
Note: The versions listed above are those that were used when this guide was written. The same procedure can likely be used with older or newer versions of each item. Several of the guides I found were specific to a particular SDK or Xcode version, so these are listed for convenience only.


Preparing Xcode To Allow Building Unsigned iOS Applications & Installing ldid Utility:
  1. Open Finder and navigate to the "/Applications/" directory.
  2. Right-click the application "Xcode" and select "Show Package Contents".


  3. Navigate to the directory:
    "Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/".
  4. Copy "SDKSettings.plist" to the desktop and open it with Xcode.
  5. Expand the section "DefaultProperties".
  6. Change the property value of "CODE_SIGNING_REQUIRED" from "YES" to "NO".

    Disable Code Signing Requirement

  7. Save the file and copy it back to the directory: "/Applications/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/"
  8. Restart Xcode.
  9. Open Xcode preferences and select the "Downloads" tab.
  10. Click the "Install" button next to "Command Line Tools".
  11. Open Terminal on the OSX system where the application will be built.
  12. Install Saurik's ldid utility:

    # mkdir -p ~/Documents/Git/
    # cd ~/Documents/Git/
    # git clone git://git.saurik.com/ldid.git
    # cd ldid
    # git submodule update --init
    # ./make.sh
    # sudo cp ldid /usr/bin/
Note: The above steps only need to be performed once. After Xcode is properly prepared and ldid is installed, only the following steps will need to be repeated for building unsigned applications and installing them to a device.


Building An Unsigned Application In Xcode:
  1. Open the project in Xcode which is to be run on a non-provisioned iOS device.
  2. At the top of the Project Navigator, select the project.

    Select Project

  3. In the "Code Signing" section, select "Don't Code Sign" for "Code Signing Identity".

    Disable CodeSigning

  4. Ensure the Build Destination is set to "iOS Device".

    Build Destination


  5. Build the application (⌘-B).

Add Required SHA1 Hashes To Application Binary:
  1. In the Xcode Project Navigator, expand the section "Products".
  2. Right-click the application binary (HelloWorld.app) and select "Show In Finder".

    Show In Finder

  3. Copy the application binary to the desktop.
  4. Open Terminal on the OSX system where the application was built.
  5. Add the SHA1 hashes to the application binary:

    # cd ~/Desktop/
    # ldid -S HelloWorld.app/HelloWorld

Copy Application To Device and Reload UI Cache:
  1. Open Terminal on the OSX system where the application was built.
  2. Change to the desktop directory where the application was copied and use the scp utility to copy the application to the device:

    # cd ~/Desktop/
    scp -r HelloWorld.app/ root@192.168.1.161:/Applications/


  3. Connect to the device via SSH, login as the user 'mobile', rebuild the UI cache, and re-spring the device:

    # ssh -l mobile 192.168.1.161
    # uicache
    # killall backboardd

Note: The backboardd process can be replaced with SpringBoard for iOS versions prior to 6.0. Using SpringBoard for iOS6+ will still work, but the screen will be dimmed. Pressing the power button once then waking the device back up will bring brightness back to the previous setting.

Note: The IP address shown in the above commands (192.168.1.161) should be replaced with the IP address of the iOS device being used. This can be obtained within the iOS Settings app by tapping the arrow icon next to the WiFi Access Point the device is connected to. Before running the above commands, OpenSSH must be installed and enabled on the device.

After performing the above steps, your application should now be visible on the device's SpringBoard. I have read that the ldid command and scp procedure can be added to a script so it's automatically performed every time a build is completed in Xcode. Once I figure out how to do this, the above guide will be revised.