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.)

Advertisements

9 thoughts on “iPhone SDK: No Joy For Me (So Far)

  1. Not much to say except that I am experiencing *exactly* the same issue. Bummer.

  2. Hi Joey,
    I have a 2 month old Mac Book Pro with 4 GBytes of memory and the lastest Leopard updates. I have the same problem that you were having. I did not uninstall, but I did create a new admin user and restart the computer. Now Xcode does not run. The first screen says its setting up the enviornment with a next button. After a few seconds Xcode quites and I get a “The application Xcode quit unexpectedly”.
    The problem details have a “DyId Error Message:
    Symbol not found: _AMDeviceUSBDeviceID ….
    This has something to do with the Aspen simulator.
    I will uninstall and reinstall with the new user and let you know what happens. I sent an email to a friend that is a long time Mac developer, hoping he will have some suggestions.

  3. I had the same issue until I realized that I was opening Xcode in 64 bits. I enabled with Finder the option “Open in 32 Bit Mode” in the file info panel for the XCode application, restarted Xcode and now the Aspen simulator is now running as expected.
    Hope that helps.

  4. Hi Joey,
    I tried a new user and that did not work.
    I used the terminal to run the uninstall all command (see the about iphone sdk read me file). I then installed the iphone sdk again. This time I had the iPhone connected. I rebooted and then started Xcode. This time it recognized the iPhone and opened the “Organizer”. I was able to open a project and run with the simulator.
    The major thing that was different this time, was that I did not have the iPhone connected the first time I installed the SDK. This may not be the issue, but perhaps if the iPhone is not connected when Xcode starts for the first time, Xcode does not configure itself correctly.
    Good Luck.
    Brad

  5. try to set env variable in the executable
    ASPEN_SIMULATOR_ROOT to /Developer/Platforms/Aspen.platform
    hope it will help

  6. @Daniel: Thanks, setting Xcode to 32-bit mode definitely fixes the problem for me.

  7. umm.. well, this seemed like a good bet.. however this was not the problem for me.
    I am pretty new to the mac world.. so something very basic seemed to catch me.
    for some reason the placement of the iphone simulator was below the program docking bar.
    so, perhaps your fix worked.. but I was not able to duplicate the issue with 32 bit since it was checked.
    However, I you can simulate the error by changing the docking bar to the left or right of the screen. then simply move the iphone simulator near the bottom.. set the docking bar at the bottom.. and bam.. no more simulator..
    I have no idea how it came to be there…

Comments are closed.