Create a gist now

Instantly share code, notes, and snippets.

@shawnbot /index.md
Last active Jun 26, 2018

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.

Show comment
Hide comment
@brandondrew

brandondrew Feb 6, 2016

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

brandondrew commented Feb 6, 2016

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

@tomByrer

This comment has been minimized.

Show comment
Hide comment
@tomByrer

tomByrer 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

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.

Show comment
Hide comment
@stretchkennedy

stretchkennedy May 25, 2016

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

stretchkennedy commented May 25, 2016

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

@SaraChicaD

This comment has been minimized.

Show comment
Hide comment
@SaraChicaD

SaraChicaD Aug 24, 2016

This was very helpful, thank you!

SaraChicaD commented Aug 24, 2016

This was very helpful, thank you!

@martingebhardt

This comment has been minimized.

Show comment
Hide comment
@martingebhardt

martingebhardt commented Jun 2, 2017

@tomByrer Thank you!

@saiqulhaq

This comment has been minimized.

Show comment
Hide comment
@saiqulhaq

saiqulhaq Jul 14, 2017

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

saiqulhaq commented Jul 14, 2017

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

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