Picture of iMac G4 Running iPhone App

Table of Contents

Overview

Apple always officially required an Intel Mac to do iPhone app development, but I figured out how to get the iPhone OS 3.1.3 SDK installed for developing Original iPhone and iPhone 3G apps on your PowerPC Mac. This builds upon the work of whoever in the community created the custom installers and scripts found on Macintosh Repository. This hack relied on the fact that even though Apple required Intel Macs for iPhone development, they actually shipped universal binaries for the iPhone SDK up until iPhone OS 2.2.1 SDK.

But the 2.2.1 SDK is quite limited and the iPhone really started to come into its own with the 3.0 and higher SDK’s. These included critical improvements like Core Data, AVFoundation, MediaPlayer, and others. So I started to look into if it was possible to get the new SDK on a PowerPC Mac as well. And to my surprise, it is possible! And will even deploy to a real iPhone running 3.1.3.

In this document you I will walk you through how I did it.

Caveats

While this does work, there are some fundamental limitations

  • iPhone Simulator only runs iPhone OS 2.2.1
    • This cannot be overcome because Apple only shipped simulator binaries with Intel architecture after 2.2.1
  • You must have a developer account if you want to deploy to device
    • There are probably workarounds, but I just did everything the official way
  • Your iPhone must be Jailbroken if you want to deploy to device
    • I think this is due to expired certificates on the iPhone but am not 100% sure
  • The SDK is old and does not have key features like Automatic Reference Counting

Approach

  1. Install Xcode 3.1.4
  2. Force install the iPhone OS 3.1.3 SDK
  3. Patch ld
  4. Force install Simulator.app from the iPhone OS 2.2.1 SDK
  5. Install Signing Certificate

System Requirements

  • PowerPC Mac
  • Mac OS X Leopard 10.5.8 with all updates installed

Downloads

  1. iphone_sdk_3.1.3_with_xcode_3.1.4__leopard__9m2809a.dmg (Internet Archive)
  2. iPhone_SDK_for_iPhone_OS_2.2.1_PPC.iso (Macintosh Repository)
  3. iPhone313PPCEnabler.zip (This website)

Tutorial

1. Install Xcode 3.1.4

Mount the iphone_sdk_3.1.3_with_xcode_3.1.4__leopard__9m2809a.dmg and open the installer file to do a normal install of Xcode. I selected all possible options, but you should only need the basic developer tools package. The installer WILL NOT let you select the iPhone SDK packages. Thats OK, we will do that in the next step. This took about 30 minutes on my 1.25GHz iMac G4 with 1TB SSD, so please be patient if your system is slower and/or does not have an SSD.

Note that you must install in the default location /Developer

2. Force install the iPhone OS 3.1.3 SDK

  1. Verify that the iPhone SDK disk image is mounted with the correct name
    1. Open terminal and type ls -al /Volumes
    2. You should see iPhone SDK, not iPhone SDK 2 or some other name. If its not called exactly iPhone SDK then the installer will fail.
  2. Unzip iPhone313PPCEnabler.zip and then open the installer package called iPhone313PPCInstaller.dpkg.
    1. Run the installer: This installs the entire iPhone OS 3.1.3 SDK except for simulators higher than 2.2.1. Those simulators are Intel only and therefore will never work on a PowerPC Mac.

At this point you will have a fully working Xcode install and if you will even be able to create new iPhone projects. However, there are 3 problems that need to be fixed:

  1. iPhone Simulator.app will not open because it is Intel only
  2. The copy of ld for the iPhone SDK is Intel only
  3. Interface Builder cannot open XIBs for the iPhone because its plugin is Intel only

If you want to confirm that iPhone Simulator is Intel only you can use the following terminal command:

ichigodaifuku:~ me$ lipo -archs /Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app/Contents/MacOS/iPhone\ Simulator 
i386

You can use lipo -archs to check any binary on your system to see if it is universal.

3. Patch ld

The normal version of ld that comes with Xcode is a universal binary but the the version that comes with the iPhone SDK is Intel only (for some reason). Its the only Intel-only part of the SDK, as far as I can tell. I provided a script to make it easy, but all this does is backup the original and then copy the version from Xcode into the place the iPhone SDK is.

  1. Open Terminal
  2. Type Control + C to clear any text
  3. Type sudo note the space at the end
  4. Drag iPhone313PPCldPatch.sh into the terminal window
  5. Press the return key to run the script
ichigodaifuku:~ me$ sudo /Users/me/Desktop/iPhoneSDKInstall/iPhone313PPCldPatch.sh 
--- iPhone OS 3.1.3 PPC Enabler LD Patch Post-Install Script Started ---
Verifying files: SUCCESS.
Target linker (/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ld) and source linker (/Developer/usr/bin/ld) found.
COMMAND: Backing up Intel 'ld' binary to /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ld.backup.intel
COMMAND: Copying functional PPC 'ld' over the Intel one...
COMMAND: Setting executable permissions for /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ld
SUCCESS: PPC 'ld' copied and permissions set.
--- iPhone OS 3.1.3 PPC Enabler LD Patch Post-Install Script Completed Successfully ---
ichigodaifuku:~ me$ 

If you want to manually verify it worked, you can use the lipo command again:

ichigodaifuku:~ me$ lipo -archs /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ld.backup.intel
i386
ichigodaifuku:~ me$ lipo -archs /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ld
i386 ppc7400
ichigodaifuku:~ me$ 

I wanted to make the script automatically at the end of Step 2 but I could not figure out how to insert the script into the installer. If you know how, please let me know and I will improve iPhone313PPCInstaller.dpkg

4. Force install iPhone Simulator.app from the iPhone OS 2.2.1 SDK

One of the included files is iPhone221PPCInstaller.dpkg. This file was originally provided on Macintosh Repository but I customized it to only install one small part of the iPhone OS 2.2.1 SDK instead of the whole thing. It only install the iPhoneSimulatorPlatform.pkg which installs the Universal binary version of the iPhone Simulator as well as the Interface Builder plugin for iPhone XIBs.

  1. Unmount iPhone SDK as this is the iPhone OS 3.1.3 SDK
  2. Mount iPhone_SDK_for_iPhone_OS_2.2.1_PPC.iso
  3. Verify in the terminal that the disk image is called exactly /Volumes/iPhone SDK
    1. ls -al /Volumes
  4. Open ``