使用Instruments命令行实用工具启动特定的硬件版本的iOS模拟器 [英] Launch a specific Hardware version of iOS simulator using instruments command line utility
问题描述
我正在使用Apple-> Xcode->工具提供的UIAutomation. 我已经使用仪器命令行基础结构运行了Javascript和整个自动化系统.
I am using UIAutomation provided by Apple -> Xcode -> instruments. I have my Javascripts and the whole automation using instruments command line infrastructure running up.
我还有一项任务是在模拟器的早期版本(iOS 6.0、5.1、5.0、4.3.2)上运行自动化,以提供更好的覆盖范围.
I got an additional task of running automation on previous versions of simulator (iOS 6.0 , 5.1, 5.0, 4.3.2) to provide better coverage.
但是我不知道指定要从哪个版本的iOS模拟器中进行选择的方法.默认情况下,它始终选择最新的iOS模拟器.
But i do not know a way to specify which version of iOS simulator to choose from. by default it always chooses the lates iOS simulator.
我尝试了以下操作:
- 指定保存模拟器的路径,其中包括模拟器的版本路径.
- 进行自定义的自动化模板跟踪并尝试使用它.
- 使用默认设置com.apple.simulator实用程序更改了iOS模拟器的默认版本.
推荐答案
由于Xcode 5.1 Instruments支持从命令行指定模拟器硬件类型和iOS版本.
Since Xcode 5.1 Instruments supports specifying the simulator hardware type and iOS version from the command line.
instruments -w help
上面的命令将为您提供有关可用的hardvare-iOS组合的列表.在我的机器上,那是:
The command above will give you a list about the available hardvare-iOS combinations. On my machine thats are:
iPhone - Simulator - iOS 6.1
iPhone - Simulator - iOS 7.1
iPhone Retina (3.5-inch) - Simulator - iOS 6.1
iPhone Retina (3.5-inch) - Simulator - iOS 7.1
iPhone Retina (4-inch) - Simulator - iOS 6.1
iPhone Retina (4-inch) - Simulator - iOS 7.1
iPhone Retina (4-inch 64-bit) - Simulator - iOS 6.1
iPhone Retina (4-inch 64-bit) - Simulator - iOS 7.1
iPad - Simulator - iOS 6.1
iPad - Simulator - iOS 7.1
iPad Retina - Simulator - iOS 6.1
iPad Retina - Simulator - iOS 7.1
iPad Retina (64-bit) - Simulator - iOS 6.1
iPad Retina (64-bit) - Simulator - iOS 7.1
您还可以使用-w标志指定硬件和iOS版本.示例:
You can specify the hardware and iOS version also with -w flag. Example:
instruments -w "iPad Retina - Simulator - iOS 7.1" -t ...
请注意,-w标志必须在命令行开头,在任何其他标志之前,否则会出现奇怪的错误.
Note that -w flag must come at the start of the command line, before any other flags, otherwise you get strange errors.
我在以下位置找到了此信息: http://cocoamanifest.net/articles/2014/03/ui-screen-shooter-now-simpler-and-more-robust-since-xcode-5-1.html
I have found this information at: http://cocoamanifest.net/articles/2014/03/ui-screen-shooter-now-simpler-and-more-robust-since-xcode-5-1.html
这篇关于使用Instruments命令行实用工具启动特定的硬件版本的iOS模拟器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!