我想从命令行启动 iPhone 模拟器。
到目前为止我一直在使用下面的命令
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator.app/Contents/MacOS/iPhone Simulator -SimulateDevice
-SimulateDevice用于启动特定的设备类型
现在使用 Xcode 6,路径和应用程序已更改为
/Applications/Xcode.app/Contents/Developer/Applications/iOS Simulator.app/Contents/MacOS/iOS Simulator
但遗憾的是 -SimulateDevice 选项现在不起作用。我可以启动模拟器,但没有指定启动哪个模拟器的选项
有人用 Xcode 6 找到了替代方案吗?
最佳答案
找到了实现我想要的方法。
Apple 在 Xcode 6 中引入了一个有趣的工具!
simctl
simclt 允许您控制正在运行的模拟器。
运行 xcrun simctl
获取可用子命令的列表。有很多新的选择。
现在做我想做的,这里是启动模拟器的命令:
xcrun instruments -w "iPhone 5 (8.0 Simulator)"
-w 是提供一个设备类型,并获取可用设备的列表。
只要执行这个:
xcrun instruments -s
启动模拟器后,您可以使用 simctl
控制它
要安装您的应用:
xcrun simctl install booted <app path>
启动应用程序:
xcrun simctl launch booted <app identifier>
希望这对您有所帮助。
关于ios - Xcode 6 - 从命令行启动模拟器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26031601/