There are several ways to simulate the iPhone Safari Browser:
- Using the Apple Safari Browser (PC or Mac)
- Using the Safari browser found in the iOS Simulator
Using the Apple Safari Browser (PC or Mac)
The Apple Safari browser (PC or Mac) download-able from http://www.apple.com/support/safari/. To simulate requests coming from an iPod, iPhone or iPad, you’ll need to activate the Developer tab by going to Preferences->Advanced and select “Show Develop menu in menu bar”. Once done, you just select which User Agent you need by selecting which device UA you want to simulate and make the requests to your site. The screen capture shows the develop tab with the UA options to choose from.
Using the Safari browser found in the iOS Simulator
The previous approach gives a pretty good approximation for how the iPhone Safari browser will behave but it’s not the best simulation. To get that, you’ll need to use the Xcode development environment that is only available on the Mac. To do this:
- Download XCode from http://developer.apple.com/xcode/ and install it
- Locate the Xcode icon using Finder
- Start up Xcode
- Create a simple project: File->New Project->View Based Application->Choose->Save As (eg. Webtest)
- The project should show up on Xcode
- On the “Simulator X.X | Debug” select Simulator and iPhone Simulator
- Click on “Build and Run” – the iOS simulator will pop up
Once this is set up, activate the Safari browser on the simulator and test.