运行iPhone / iPad的模拟器持续集成

问题描述 投票:21回答:5

我试图从运行命令行的iOS模拟器。我发现在iPhone模拟器可以运行的位置。我的问题是它是否能够接收参数来指定哪些设备应该被推出,它应该运行什么应用程序。

$ ./Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator.app/Contents/MacOS/iPhone\ Simulator

有谁知道,如果有技巧,以这一点。了解更多有关这真的与我们的持续集成过程中提供帮助。


我们现在使用WaxSim自动化我们的iOS应用程序时CI构建

iphone ios ipad continuous-integration ios-simulator
5个回答
20
投票

使用-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


5
投票

要启动,你可以做一个特定的设备:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone \ Simulator.app/Contents/MacOS/iPhone \模拟器-SimulateDevice “iPhone的Retina(3.5英寸)”


4
投票

在你的shell的Xcode中试试这个6

osascript -e 'activate application "iOS Simulator"'

对于Xcode中7

osascript -e 'activate application "Simulator"'

2
投票

如果你想打开安装了特定应用模拟器,那么你可以使用一些现成工具的推出模拟器。这种方式很容易安装应用程序,并在模拟器上运行。这是可以从终端窗口中运行命令行实用程序。

  1. iPhoneSim
  2. ios-sim
  3. 其他的都是相同的两个以上。

而最主要的是都采用同样的方法来打开模拟器。 (详见项目)

其他方式(不是我推荐)使用脚本文件,从命令来运行。


0
投票

您可以使用xcrun simctl列出可用的模拟器,启动应用程序等,这工具是存在在Xcode 7和8的Xcode双方如果你不给它一个命令,它会打印命令行帮助。

xcrun simctl launch <UUID> <bundle id of app>将启动应用程序。

© www.soinside.com 2019 - 2024. All rights reserved.