iPhone SDK: No Joy For Me (So Far)

Like 10 bajillion other Mac fans yesterday, I downloaded the iPhone SDK. It took me four tries to get it, but I finally got it. I installed all 5.3 GB of it, and rebooted (reboot? what is this, Windows?) and then created a sample project, just like the ADC video shows. I excitedly clicked the ‘Build and Go’ button and… nothing. Well, not completely nothing, but not what was supposed to happen.

What was supposed to happen was that the app would build, the iPhone simulator would start up, the app would be loaded onto the simulator and then it would run. My app built, but the simulator didn’t run. All I saw was ‘Debugging of “Sample” ended normally’ in the Xcode status bar. I checked the Xcode console, and I get this every time I try to run the app:

[Session started at 2008-03-07 16:42:09 -0500.]
2008-03-07 16:42:10.772 Sample[1326:10b] Warning: CFFIXED_USER_HOME is not set!
2008-03-07 16:42:10.793 Sample[1326:10b] Warning: ASPEN_SIMULATOR_ROOT is not set!
Terminating since there is no system event server.
(Run the EventPump or pass the argument "-RegisterForSystemEvents" if you want to run without SpringBoard.

The Debugger has exited with status 0.

I’ve been exchanging emails with people inside Apple about this and the only suggestion so far was to run the uninstall script in /Developer/Library and reinstall. I have done both, but it still doesn’t work. Upon the suggestion of a friend, I created a new user account, logged in as that user and tried from there. Everything worked. Which means Xcode, the SDK and the simulator are all installed properly, but something in my account is dorking things up. I am loath to ditch my account and start over from scratch, but obviously something is wrong. Does anyone have any suggestions? I am awaiting another email from my guy at Apple, but if anyone else knows anything, please let me know. And when/if I get it working, I will document what worked here.

03/08/2008 21:47 Update: It’s working! w00t! It appears that if you are running Xcode in 64-bit mode, you get the errors that I got. If you run Xcode in 32-bit mode, it works. Now, I had switched to 64-bit mode when I installed Xcode 3.0, but when I installed 3.1, it got reset to 32-bit mode. Only it didn’t get reset, at least not for my user account. That’s why when I created another user account, it worked for him. I right-clicked on Xcode in my dock and selected ‘Show in Finder.’ Then I right-clicked on the Xcode icon and selected ‘Get Info.’ On the Get Info screen is a checkbox labeled ‘Open in 32 Bit Mode’ and it was checked. I unchecked it, launched Xcode and the same problem happened. Then I re-checked it, re-launched Xcode, and now the simulator works. If I uncheck it, the problem returns, proving the cause. Thus, you must run Xcode in 32-bit mode and even if you think you’re running in 32-bit mode, it wouldn’t hurt to toggle that checkbox a time or two just to make sure. (Thanks to Daniel Cliche who suggested the 64-bit problem.)