UI Automation命令行配置通用应用程序的模拟器
我对从命令行运行的通用应用程序进行了一些 UI 自动化测试。它们工作得很好,但命令行总是启动 iPad 模拟器,我希望能够在 iPhone 模拟器和 iPad 模拟器上运行它们。
在仪器中,我可以使用“选项|模拟器配置”菜单来控制它,但我似乎无法通过命令行来控制它。有没有办法从命令行针对 iPad 和 iPhone 模拟器运行通用应用程序的 UI 自动化测试?
I've got some UI Automation tests for a universal app that I'm running from the command line. They are working great, but the command line always launches the iPad simulator, and I'd like to be able to run them on both the iPhone simulator and the iPad simulator.
In Instruments I can control this with with the Options|Simulator Configuration menu, but I can't seem to control it via the command line. Is there a way to run UI Automation tests from the command line for a universal app against both the iPad and iPhone simulators?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
创建一个仅适用于 iPhone 的单独目标(即应用程序的另一个版本),这将强制仪器使用 iPhone 模拟器,而不是 iPad。
换句话说,在新目标的配置中,设置
TARGETED_DEVICE_FAMILY = 1。
Make a separate target (i.e. another version of your app) which is iPhone-only, this will force instruments to use the iPhone simulator, rather than iPad.
In other words, in your new target's config, set
TARGETED_DEVICE_FAMILY = 1.
早晨。
看看这个问题:xcodebuild:模拟器或设备?
是否可以指定版本使用 -sdk 参数运行测试时的 sdk - 如果是这样,您能否指定一个不适用于 iPad 的 iOS 版本?
或者,如果这不起作用,您可以运行一个在自动化测试期间更改设备的脚本 - 即类似于此答案:如何从命令行重置 iOS 模拟器?
Morning.
Take a look at this question : xcodebuild: simulator or device?
Is it possible to specify a version of the sdk when running your tests using the -sdk parameter - if so, could you specify an iOS version that isn't for the iPad?
Or, if that doesn't work could you run a script that changes the device during your automated tests - i.e. similar to this answer : How can I reset the iOS Simulator from the command line?