Open the iOS Simulator without opening XCode
comments (0) Views: 13,283
If you do a lot of work in mobile, testing your web apps, or designs in a mobile device is critical. It's nice to be able to upload your code to the web and test on an actual iPhone, but sometimes that's just not possible. That's where the iOS Simulator comes in. It's a great app which is part of the Xcode suite of tools. The most common use case is for you to build an iOS app and launch the simulator to test. But since mobile Safari is included in the simulator you can also test your websites locally; mobile Safari uses your Mac's hosts file so it has full access to anything your desktop browsers do.
The problem is that you used to have to launch Xcode first in order to launch the Simulator. But there's a sneaky way around that. Add a shell alias and launch the device simulator directly from the command line, no XCode needed. Add this to your .bashrc, .bash_profile, .zshrc, .zlogin or any other shell dot file. The alias name can be whatever you like.
alias isim='open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator.app'
After you've added it to the file of your choice, run source <filename> to make sure the alias is available. Then type the alias you selected and presto!
If this article was interesting, or helpful, or even wrong, please consider leaving a comment, or buying something from my wishlist. It's appreciated!