iphone simulator seems to send the wrong user agent

March 7th, 2008 @ 13:40 skip to comments

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

Your Responses

  1. Bain Kennedy said on 21:52 March 7th, 2008

    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 said on 04:02 March 8th, 2008

    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:
    http://sourceforge.net/projects/iphonesimulator/

    Just do a build in XCode and run the resulting iPhoney.app

  3. Duncan said on 21:56 March 9th, 2008

    @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 app and also catch all of them.

Leave a comment :

Please keep it polite and on topic. Show who you are with a Gravatar. Your email address is required, but won't be displayed or passed on ( that's a promise! )

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>