假设你在<代码>/格式>上安装了X代码,则你可以从指挥线开始使用i Simulator:
$ open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator.app
(Xcode 6+):
$ open /Applications/Xcode.app/Contents/Developer/Applications/iOS Simulator.app
您可以与您的桌面建立象征性的联系,使这一联系更加容易:
$ ln -s /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator.app ~/Desktop
(Xcode 6+):
$ ln -s /Applications/Xcode.app/Contents/Developer/Applications/iOS Simulator.app ~/Desktop
如@JackHahoney所指出的,你还可以在<代码>~/bash_profile上添加一个<>alias:
$ alias simulator= open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator.app
(Xcode 6+):
$ alias simulator= open /Applications/Xcode.app/Contents/Developer/Applications/iOS Simulator.app
(Xcode 7+):
$ alias simulator= open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app
Which would mean you could start the iPhone Simulator from the command line with one easy-to-remember word:
$ simulator