skip down to the 3 comments

iPhone simulator seems to send the wrong user agent

The new iphone simulator (part of the iphone SDK) doesn’t seem to send the same User-Agent as a normal iphone, so any sites that use content-negotiation don’t appear on it. I would have thought it should send ‘(iPhone; U; CPU like Mac OS X; en)’ but instead it sends ‘Aspen Simulator; U; Apsen 1_2 like Mac OSX:en_us’. This seems like an oversight? What do you reckon?

iphone simulator

There have been 3 responses to this post.

  1. Bain Kennedy

    I don’t think it’s an oversite. If you do anything special with the iPhone headers just add the Aspen Simulator UA to the list, you should have a list anyway because the Touch has a different UA as well. It might be good to know that you are coming from an emulator (turn on debug features).

  2. Jc

    I agree. I have been testing a wordpress template that autodetects the iphone and renders a different template based on the user agent.

    As a work around, the iPhoney app does allow user agent switching if this is needed. The interface isn’t as nice as the Aspen Simulator, but if you need the user agent reported correctly, it is the only solution I’ve found.

    Source code:

    Just do a build in XCode and run the resulting

  3. Duncan

    @Bain, fair enough, although I do think they should at least add some common text in the UA that applies to all (iphone, touch, simulator) this would mean you could just single out a specific device and also catch all of them.

back to the top