我试图从运行命令行的iOS模拟器。我发现在iPhone模拟器可以运行的位置。我的问题是它是否能够接收参数来指定哪些设备应该被推出,它应该运行什么应用程序。
$ ./Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator.app/Contents/MacOS/iPhone\ Simulator
有谁知道,如果有技巧,以这一点。了解更多有关这真的与我们的持续集成过程中提供帮助。
我们现在使用WaxSim自动化我们的iOS应用程序时CI构建
使用-SimulateApplication
参数运行可执行文件在模拟器(在.app
包内可执行的)
(你也可以通过命令行像这样:) xcodebuild -project Test.xcodeproj -arch i386 -sdk iphonesimulator
编译项目
然后,例如:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app/Contents/MacOS/iPhone\ Simulator -SimulateApplication Test.app/Test
要么
./Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator.app/Contents/MacOS/iPhone\ Simulator -SimulateApplication Test.app/Test
要启动,你可以做一个特定的设备:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone \ Simulator.app/Contents/MacOS/iPhone \模拟器-SimulateDevice “iPhone的Retina(3.5英寸)”
在你的shell的Xcode中试试这个6
osascript -e 'activate application "iOS Simulator"'
对于Xcode中7
osascript -e 'activate application "Simulator"'
您可以使用xcrun simctl
列出可用的模拟器,启动应用程序等,这工具是存在在Xcode 7和8的Xcode双方如果你不给它一个命令,它会打印命令行帮助。
xcrun simctl launch <UUID> <bundle id of app>
将启动应用程序。