Skip to content

Instantly share code, notes, and snippets.

@shawnbot
Last active August 23, 2023 10:18
Show Gist options
  • Save shawnbot/5527355 to your computer and use it in GitHub Desktop.
Save shawnbot/5527355 to your computer and use it in GitHub Desktop.
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

@eso32
Copy link

eso32 commented Dec 1, 2018

@tomByrer thanks!

@wortwart
Copy link

Copying the simulator app to the apps folder did not work but you can create an alias and move it there.

@nnimis
Copy link

nnimis commented Jul 13, 2020

In XCode 11.5 the simulator is on /Contents/Developer/Applications/Simulator.app

@contis2908
Copy link

On macOs Big Sur I cant find the option Safari>Develop>Iphone Simulator
Is there another way to debug a website on an simulated xcode device

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