Saturday, December 13, 2008

Babies and Fools

 My grandmother always said, "God looks after babies and fools."  Well, seeing that I'm no baby, that means I'm a...(nahhhhh).  Well, let me tell you what happened and you tell me.  Today (while sitting here in the lounge at Ski Liberty, PA, while my oldest son and his friend snowboard) I decided I would get something up and moving on the iPhone so that I can achieve the milestone I set for myself, and also get on with my learning.  

So, we got here at 10:30am, it is now 4:30pm (and they are still out on the slopes...how do they do it).  Well, I figured just fire up xCode, build and run the "Hello, World," app and go from there.  I fire up xCode so that I could get the IDE to drop down the iPhone project setting for me.  Wait a minute, it isn't there.  I know I installed the sdk properly, days ago.  So, I go back to the installation folder and click again, and all is installed.  So, I google, to find why its not working.  

That's when the sinking feeling sunk in.  I read that iPhone SDK/Simulator runs only on Intel based Macs.  You see, I never read and for some reason never heard that iPhone SDK/Simulator only runs on Intel Processor based Macs.  My Powerbook is only 3 years old, and it is a PowerPC G4.  Do you hear me screaming in my brain, WTF!!!  WTF!!!

So, I google to see if anyone has worked around this.  I know from experience hacking the Nintendo DS, that now a days, anything is possible.  So, the first thing I stumble across is that the sdk installer sees that the processor it is trying to load to, isn't Intel, so I doesn't add the files for the iPhone, and the simulator.  However, all 50 of the packages that are needed are still in the install folder and you have to manually install them yourself.  So, 2 hours of installing, you know the developer feeling (excitement mixed with trepidation).  I fire up xCode, and too my excitement and joy, the iPhone project option is now in the drop down menu. Woooohoooo!

Next, build and run.  Arrrgghhhh!!  I get the build error that I'm running on an "invalid architecture."  Sheesh.  So, google this error message, and I find another site that says exactly what to modify in the iPhone Simulator specification file.  

Viola!  

I'm now running the iPhone SDK and simulator on my G4.  Now, I haven't tried the code running on an actual iPhone, since I have not paid the $99 to get my certificate to run on the actual device.  I guess I will find out when I try.  Anyway, I didn't have to shelve out $3K for a decent development mac.  I can now develop and test...later when I get to the point of App Store submitting, I will spring for a cheap Intel Mac to recompile on, and certify the app (if needed).

Now, why would Apple lock out PowerPC G# owners.  Now, there could be some really good reason, but I believe the real reason, was to sell new machines.  I could be wrong, but if it only takes a few additions to a specification file (still new to Mac dev, but this file is basically a INI file in the PC world), then there is no real hardware limitation that I see.  However, I won't get to cocky, I could run into the reason down the road and be thoroughly upset.  In the meantime...I'm up and running baby!

Since there are a few steps to detail to get your G3, G4, or G5 working with the iPhone SDK/Simulator I will give the credit where credit is due, and you can go to the sites, "3by9" by Mike Rundle, and "Lehmamic's Web Blog, This and That" (author unknown) to see what's needed.  Or shoot me a comment if you don't wish to go fishing around.  I will post the steps on a blog entry.  Right now, I'm just psyched to get on with my coding and testing out the iPhone/Simulator.

Now to get a sprite up on the screen and moving.  I still have a few hours before the boys get tired of snowboarding and there still is...tomorrow, tomorrow, it's just a day away.

No comments: