Instantly share code, notes, and snippets.

Embed
What would you like to do?
Testing web pages with Xcode's iOS Simulator

Finding the Simulator

You can test with the iOS Simulator that comes with Xcode. Navigate to the Xcode app in the Finder, right click and select "Show Package Contents":

screen shot 2013-05-06 at 12 04 27 pm

Then navigate to Contents > Applications, and open the shortcut to "iPhone Simulator" (it may be called "iOS Simulator" depending on which version of Xcode you're running):

screen shot 2013-05-06 at 12 05 45 pm

Viewing & Testing

When you're in the simulator, click open Safari, click on the URL bar, and you can paste the testing URL using ^⌘V (Edit > Paste Text), then hit enter.

You can test different devices and orientations using the Hardware menu:

screen shot 2013-05-06 at 12 10 44 pm

Debugging

You can use Safari's inspector to debug web pages running in the simulator. Just open Safari (in OS X) alongside the simulator running Safari in iOS, and go to Develop > iPhone Simulator > [your device/tab]:

screen shot 2013-05-06 at 12 18 48 pm

@brandondrew

This comment has been minimized.

brandondrew commented Feb 6, 2016

The latest version of Xcode does not have the simulator there:
image

@tomByrer

This comment has been minimized.

tomByrer commented Mar 3, 2016

@brandondrew:

  1. Open Xcode
  2. in appbar, right-click over Xcode
  3. Open Dev Tool, Simulator
  4. Change device in Menu:Hardware/Device/iOS ./etc
@stretchkennedy

This comment has been minimized.

stretchkennedy commented May 25, 2016

You can open the simulator from the normal cmd-e search dialogue now.

@SaraChicaD

This comment has been minimized.

SaraChicaD commented Aug 24, 2016

This was very helpful, thank you!

@martingebhardt

This comment has been minimized.

martingebhardt commented Jun 2, 2017

@tomByrer Thank you!

@saiqulhaq

This comment has been minimized.

saiqulhaq commented Jul 14, 2017

The simulator app location has changed to /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app

@eso32

This comment has been minimized.

eso32 commented Dec 1, 2018

@tomByrer thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment