Tuesday 19 August 2014

Start or run iPhone Simulator using terminal

Assuming you have Xcode installed in `/Applications`, then you can do this from the command line to start the iPhone Simulator:

    $ open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app

You could create a symbolic-link from your Desktop to make this easier:

    $ ln -s /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app ~/Desktop

As pointed out by @JackHahoney, you could also add an `alias` to your `~/.bash_profile`:

    alias iphone-sim='open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/De‌​veloper/Applications/iPhone\ Simulator.app'

Which would mean you could start the iPhone Simulator from the command line with one easy-to-remember word:

    $ iphone-sim

No comments:

Post a Comment