Connie's Blabber

Tuesday, July 1, 2008

iPhone SDK

The iPhone will be released on July 11 in Canada. I'm getting one, of course. In the meantime, I thought I'd get the iPhone SDK first.

Downloading the latest iPhone SDK beta was straightforward. Installing the package appeared to be easy too, except that the installation program would not allow me to install the iPhone components, without which nothing works. This is because the SDK ostensibly only supports Intel-based Macs whereas mine runs on a PowerPC processor. There is no reason for the restriction from the technical angle. My only guess is that Apple wants to force people to buy new Macs.

Fortunately, clever people on the Net have discovered ways to get around this evil hurdle. Thanks to tips by Mike Rundle at http://3by9.com/85/, I was able to install the iPhone-related tools manually from the installation package. Now, all the useful things: header files, lib files, compiler, linker, the iPhone Emulator, etc., are all in place for Xcode.

Next, when I tried to compile a test program, I got this error: "No architectures to compile for (ARCHS=ppc, VALID_ARCHS=i386)." To fix this nasty bit -- another hurdle thrown at PowerPC-based Macs, I must do the following (thanks to Tom Bradford's instructions at http://www.tbradford.org/2008/03/iphone-sdk-beta-2-possible-ppc-fix.html):

- Go to /Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Xcode/Specifications/.

- Find a file called "iPhone Simulator Architectures.xcspec"; make a backup of it and open the original.

- Notice in this file that the 'RealArchitectures' variable only defines i386 as a valid architecture; change that to "(i386, ppc)".

- Add the following just before the Intel section:

// G3
{ Type = Architecture;
Identifier = ppc;
Name = "Minimal (32-bit PowerPC only)";
Description = "32-bit PowerPC";
PerArchBuildSettingName = "PowerPC";
ByteOrder= big;
ListInEnum = No;
SortNumber = 201;
},

// G4
{ Type = Architecture;
Identifier = ppc7400;
Name = "PowerPC G4";
Description = "32-bit PowerPC for G4 processor";
ByteOrder= big;
ListInEnum = NO;
SortNumber = 202;
},

// G5 32-bit
{ Type = Architecture;
Identifier = ppc970;
Name = "PowerPC G5 32-bit";
Description = "32-bit PowerPC for G5 processor";
ByteOrder= big;
ListInEnum = NO;
SortNumber = 203;
},

- Restart Xcode.

Now I've got Xcode on my iMac to compile programs to run on the iPhone SDK. All I need next is an actual program that does something useful or fun!

Labels:

5 Comments:

At January 7, 2009 at 5:19 a.m. , Blogger susil said...

everybody is saying that, thats the right procedure.
I have also tried but still getting the same problem
"No architectures to compile for (ARCHS=ppc, VALID_ARCHS=i386)."
As i am completely new to this platform, please be kind to give me a solution.
my system specification:
model name : emac
model identifier: powerMac 4.4
Processor Name: 1Ghz PowerPC G4 (3.3)

i am having mac10.5.6 machine and iphone simulator 2.0

 
At March 3, 2009 at 9:45 p.m. , Blogger Josh said...

Thanks for this post; this, along with the the comments by gigeamircearaul and Michael_G._James_952 in this thread (ignore the article) let me get the iPhone SDK 2.2.1 working with OS X 10.5.6 on a PowerBook G4.

 
At March 31, 2009 at 1:51 p.m. , Blogger WICHO said...

Thanks for this post, vere usfull, now i have already build my first application in my PowerPC G4.

Great work!!

 
At April 2, 2009 at 5:17 a.m. , Blogger Kawika said...

I am also having a problem that this fix is not solving - I still get the "No architectures" error after patching the config file. Is there some other file I need to know about? I have a G4 machine running 10.5.6

 
At May 20, 2009 at 2:01 p.m. , Blogger Unknown said...

Hurrah! This solution cleared up my compile problem - thank you for posting!

 

Post a Comment

Subscribe to Post Comments [Atom]

<< Home