iPhone SDK Beta 2 PPC Fix
So Apple released the second beta of their iPhone SDK today...
I work on PowerPC Macs because I haven't felt the need to plunk down a couple thousand dollars for another computer when my Powerbook still works perfectly fine. I did, however, purchase an iPhone, and I'd really like to develop applications for it. Considering the fact that I paid almost $600 (after activation, etc) for the thing, and I previously dropped $2500 for the PowerBook, I feel that Apple owes me something for the money spent.
The previous version of the iPhone SDK didn't install the Aspen platform packages on PPC, but you could still manually install those packages and compile for the simulator with a simple warning about your unsupported (ppc) platform. Apple changed that with the second beta. First, the Aspen packages have now been prefixed with 'iPhone'... No big deal. Second, they've unfortunately made it a compilation error to attempt to compile for the iPhone simulator using a PPC computer. I find this unacceptable and I’d like to pay bills rather than buy new computers, so here’s what I did:
- Once you've moved the iPhone platform directories to their appropriate location under /Developer/Platforms, drill into: /Developer/Platforms/iPhoneSimulator.platform/Developer/
Library/Xcode/Specifications/ - In this directory, you will find a file called "iPhone Simulator Architectures.xcspec" Make a backup of it and open the original in your favorite editor
- You'll notice in this file that the 'RealArchitectures' variable only defines i386 as a valid architecture. I change that to "(i386, ppc)"
- What I did next was essentially steal some of the definitions from the Mac OS X Architectures.xcspec file and added them to the end of the file.
After changing the file and relaunching XCode, my iPhone Simulator builds run fine... Not even the original warning. Wonderful!
[April 9, 2008 Note: This also works with the iPhone SDK Beta 3]
Technorati Tags: Apple, iPhone, PowerPC, Programming

60 Comments:
Fantastic work! I was pretty upset they changed a compile warning to a compile error just for the hell of it, and I'm going to give your steps a shot in a little bit and see if I can get things back up and running again.
Bingo! Thanks for sharing.
Sorry about the double post–I'm a little too quick with the mouse.
I can't wait to see what else they may throw at us PPC users for the next update. I know the writing's been on the wall for a while now, but this still seems a bit ridiculous. Anyway, thanks for the workaround.
And the NDA that you promised to adhere to in order to get the SDK?
What we're talking about here are the architectural specification templates that are a capability of the Xcode IDE; an IDE which is also distributed separately from the actual iPhone SDK, including as part of the Leopard distribution and retroactively not bound by iPhone SDK NDA.
By your logic, you could also say that people telling the world it is possible to manually install the iPhone platform packages is also bound by NDA, which it surely is not. 'Installing packages' has been a common occurrence since the beginning of Mac OS X.
thanks.
Speaking of which...anyone had any luck digitally signing their apps on PPC?
When that build phase runs, codesign keeps spitting out:
"object file format invalid or unsuitable"
It's finding my certificate and all that, but it doesn't like the executable for some reason.
That's great!
I'm iMac G5 user, and I was very upset about that last night. But now, my project be runnable again.
Thank you.
(from Seoul, Korea)
Thanks for the code - works great!
Question for the masses: when you run the simulator, do people still get the "Aspen" sim, or the new "iPhone" sim?? I'm still getting the Aspen one by default!
When I installed beta 2, it removed the Aspen items. During the install, I manually changed the install folder to /Developer...maybe that's what did it for me.
I get this error too. Same thing:
2008-03-30 19:47:32 [0x0-0x177177].com.apple.iphonesimulator[28541] Expected in: /usr/local/lib/libsqlite3.0.dylib
Please post a fix if you find one, I'll do the same.
Jean-Pierre, I had the same problem on one of my Leopard updates. The problem occurs because the simulator was linked against the sqlite shared library in /usr/lib while the version in /usr/local/lib exports incompatible symbols. I believe the incompatible version was one that I installed when still running Tiger. I remedied my problem by removing the version of the sqlite application and libraries under /usr/local
Thanks a lot!
Happy owner of PowerBook 12" and Mac mini G4
Any luck in compiling for the iPhone without the certificate?
I just compiled for the simulator, then copied the bundle into the iPhone:the app appears in the screen but after launch it doesn't work.
I'm going to play with project settings...
Yes! It works!
Thanks alot!
is sdk 3 fixable in the same manner?
This fix appears to work for the iPhone SDK beta 3.
I concur.
It sure appears to work with Beta 3 as well.
Yep, I had the same results. Going to add a note to the original post.
Thanks for your help in solving the ppc problem.
I am able to develop and test my code on iphone simulator now.
But when i try to build it for device,it says "Device not connected" even though i can see the iphone in itunes.
Please suggest the way to transfer our developed app on iphone.
works on beta 4!
Did you have any issues w/the code signing? Up until know, when building for the device, if I set the project up to sign the code and the code signing build step runs, it would always throw an error stating "object file format invalid or unsuitable". Just wanted to make sure I can still deploy to the device w/beta 4.
does it work on 10.4.11 Tiger or is it Leopard specific ?
I just want to say thanks for posting this, and confirm that it works with Beta 5.
Whooo hooo!
Got beta 5 working with opengl and everything. Thank you kindly for the fix.
Thanks man, I'v now finally got beta 5 running on my G4!!!!
you've saved me a pretty penny :P
Works with beta 6 too!
I had problems with beta 6, even with this fix. I was able to get my application to build but when I went to simulate, it hangs at the step "GDB: Installing XXX in Simulator". It doesn't even start up the simulator. I tried it again with the Metronome example app and got the same results.
Has anyone else encountered this?
Just another verification this fix works with beta 6 and the demo apps.
Thanks so much for sharing! I can now build & run "Move Me" sample on my 15" PowerBook G4. Awesome!
This also works for Beta 7 of the iPhone SDK. I did put "ppc7400" in RealArchitectures though instead of "ppc" as I have a PPC G4.
"ppc" defines the G3 architecture, and "ppc7400" the G4 one.
you just saved me $600... was about to go out and buy a mac mini just for iphone development.
w00t!
Mach said:
it hangs at the step "GDB: Installing XXX in Simulator"
I was able to get apps running this way:
on a G5 dual 2.0 64 bit:
edit your .xcspec as follow:
line 12;
RealArchitectures = ( i386, ppc970 );
then add before the last line:
// PowerPC
{ Type = Architecture;
Identifier = ppc;
Name = "PowerPC";
Description = "32-bit PowerPC";
PerArchBuildSettingName = "PowerPC";
ByteOrder = big;
ListInEnum = NO;
SortNumber = 106;
},
// 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;
},
)
then Do this:
first build.
then Run:
"start with performance tool " "activity monitor"
and you will see your app running on the simulator!
hope this help!
Works smoothly on Beta 7!
Thanks for fantastic workaround...:)You helped me to save at least 1.5$K!
It works on beta 8 as well.
Thanks for all the help, its nice for people like you to help the less mac-savy people out there.
Excellent, I bought an iBook G4 off ebay (my first apple) specifically for developing for the iPhone after seeing your instuctions. I installed the iPhone SDK (build 9M2199a, beta 8) and after following your instructions I have the MoveMe application compiled and running inside the Simulator.
Many many thanks,
Lee
I can get this working by using the Activity monitor but I cannot figure out how to debug within the simulator. it just hangs when says Installing in Simulator. Has anyone gotten debugging to work?
Thanks,
Hi there, i have a mayor trouble trying to compile. I can run aplications on Simulator but i cant compile to Device. If i change to Device Xcode crashes leaving no clue.
Can any one help me? Thanks
Hello, any news on official iPhone SDK 2.0 running on PPC G4 ?
I've got it working on a PowerBook G4 with the 2.0 firmware and new SDK. I still can't compile signed code. (I have all the proper stuff and it sees my certificate)
Everything is up to date and it fully builds till the end except this.
I get this error (from codesign):
[long path to app]: object file format invalid or unsuitable
Anyone have a fix?
Paul,
I'm in the same boat as you, PB G4 and wanting to build some apps. I wasn't sure how the code signing and certificates would work on a PPC machine. There is an Intel Mac in my house, but it's not mine, and I can't be developing on it all the time. I might just have to buy a Mac Mini on the cheap to get things rolling for now.
I'm having the same problem with codesign (object file format invalid or unsuitable) on a Powerbook when trying to build for the device.
Anybody found a workaround?
I'm on G5 using SDK Beta-8 (5a345) and I can successfully build for the device. I had to install manually one more package called "DeveloperDiskImage". But when I try to run, I get the following:
>>>
Your mobile device has encountered an unexpected error (0xE8000001) during the install phase: Verifying application
<<<
However, I haven't applied for the iPhone Dev Program yet. Is this required ? (and pay at least $99...)
IMO, with Beta-8 (and the "final" SDK, which appear to be identical) it's better to install iPhone packages directly under "/Developer" so that installed files go straight to their respective folders.
Yes, unfortunately, you do need to pay the $99 dollars. The error you are running into is referring to when it tries to verify the code signing.
However, even with the $99 certificate, you can't use the codesign application on a PowerPC, I am currently looking for a way around it.
In the meanwhile, jailbreaking should fix your problem.
What version of OS-X is everyone using when they are getting the iPhone Simulator running on their PPC?
hi
i am also facing same problem for code sign for device with exit status 1 for ppc.anyonne knows please help me...
This post has been removed by the author.
Same problems here trying to code sign to run on the phone from a ppc G4.
*sigh* if anyone has any knowledge about how to hack it so the powerpc version of codesign will work, that'd be wonderful.
Thank you. This worked perfectly.
Here's a thread with a solution to using codesign on PPC:
http://discussions.apple.com/thread.jspa?threadID=1455699&tstart=0
About to try it myself...
Hey... thanks for sharing that. i dugg your article as well.
I just downloaded the new 2.1 SDK, did the manual iphone pkg installs and it blows up Xcode 3.1 when the Simmulator tries to load.
Running 10.5.4 PPC
The previous hack worked fine ... this appears broken
Hello am new to iphone programming and also Mac, I have a powerpc g4...I have a few questions:
1.) I have installed the sdk using pacifist without which the iphone listing does not get displayed. Is it possible to install directly on it n still avail all the features
2.)Iget the error ibtool cannot open files of this type...my application does not run properly on the simulator kindly tell me how to go about this...
g4 config:1.25Ghz powerpc g4
1GB DDR SDRAM
Mac OS X version 10.5.4
oops sorry forgot to mention I have iphone OS version 2.0..n ipod touch...iphone sdk build 9M2199a
When i try to compile app i get this error:
Uncaught Exception:
*** -[XCiPhoneSimulatorDevice setCurrentExecutable:]: unrecognized selector sent to instance 0x2e6da10
Stack Backtrace:
The stack backtrace has been logged to the console.
iphone sdk 2.1 ppc g4
Does anyone know if this will still work with 2.1 ? Also is it really true that you can't sign code &or provision on a G5 ? Sounds ridiculous - I bought my Mac from Apple, why can't I develop on it ?
Yeah, it still works for 2.1.
I'm just getting a stupid "Unable to locate a suitable developer disk image." now when I try to run it on my device... I thought I ran into this problem before, but I can't remember the solution.
Oh yeah...
If anyone else runs into the "Unable to locate a suitable developer disk image." problem, there's a package called "DeveloperDiskImage" in the iPhone SDK that needs to be installed.
As of 2.1, these are the extra packages that you need to install manually:
iPhoneSDKHeadersAndLibs
iPhoneSimulatorPlatform
iPhoneHostSideTools
iPhoneDocumentation
DeveloperDiskImage
Brilliant. Many thanks
Hey everybody...
i tried to run a helloworld.app on iphone 2.0.2. After hours and hours i can send the app to my iphone... but when the iphone want to start the app i get this message;
[Session started at 2008-09-17 15:52:57 +0200.]
Loading program into debugger…
GNU gdb 6.3.50-20050815 (Apple version gdb-962) (Mon Aug 11 05:38:47 UTC 2008)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "--host=powerpc-apple-darwin --target=arm-apple-darwin".tty /dev/ttys012
Program loaded.
target remote-mobile /tmp/.XcodeGDBRemote-418-68
Switching to remote protocol
mem 0x1000 0x3fffffff cache
mem 0x40000000 0xffffffff none
mem 0x00000000 0x0fff none
sharedlibrary apply-load-rules all
run
Running…
Error launching remote program: security policy error.
Error launching remote program: security policy error.
I run it from a PPC.... any idea?
Post a Comment
Links to this post:
Create a Link
<< Home