The iOS Simulator 2016

1 minute read

An update to an older post about using the iOS Simulator from the command line.

The Simulator ships with Xcode to provide a way for developers to test their iOS apps without the pain of loading into on to a physical device each time. The Simulator can emulate all manner of Apple Hardware. It ships with whatever the current version of iOS is, but you install older versions as well.

The advantage of the Simulator if you are not developing iOS apps is that it ships with Safari installed. By launching the Simulator and opening Safari, you can test you web apps from the comfort of your own desktop. Normally, the Simulator is launch from Xcode, but while the it is buried deep in the Xcode app bundle, it is itself a standalone App in it’s on right. Previously, you could launch it as:

open /Applications/Xcode.app/Contents/Developer/Applications/iOS Simulator.app

it has been renamed Simulator and so you need to use:

open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app

You don’t want to actually type that, so aliases:

BASH:

alias ios='open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app'

TCSH:

alias ios 'open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app'

And as always, the bonus tips!

  • localhost in the Simulator is your Mac, making it a handy tool for testing your responsive designs localy.

  • When Mobile Safari running in the Simulator it’s accessible in desktop Safari Developer Tools. You’ll see your tabs listed under Develop > Simulator, choose one and you will be dropped into the developer console for that page.

Google Chrome’s DevTools’ Device Mode is also helpful for testing mobile on the desktop However, it’s an emulator whereas the Simulator is actually running Mobile Safari, giving you a truer experience.

Thus, with an alias or two, your phone need never leave your pocket.

Comments