分享

Xcode 6 -从命令行启动模拟器Xcode 6 - Launch simulator from command line

 quasiceo 2015-06-21
ios > Xcode 6 -从命令行启动模拟器Xcode 6 - Launch simulator from ...(更新)

Xcode 6 -从命令行启动模拟器Xcode 6 - Launch simulator from command line

- 此内容更新于:2015-04-21
主题:

  我想从命令行启动iPhone模拟器。      直到现在我一直使用以下命令         /应用程序/ Xcode.app /内容/开发/平台/ iPhoneSimulator。平台/开发/应用程序/ iPhone模拟器。应用程序/内容/ MacOS / -SimulateDevice iPhone模拟器         -SimulateDevice用于启动一个特定的设备类型      现在Xcode 6路径和应用已经改变         /应用程序/ Xcode。应用程序/内容/开发/应用程序/ iOS模拟器。应用程序/内容/ MacOS / iOS模拟器         但遗憾的是-SimulateDevice选择现在不工作。我可以启动模拟器,但没有一个选项来指定哪一个启动      有人发现这与Xcode 6的替代品吗?   

原文:

I want to launch iPhone simulator from command line.

until now I have been using the below command

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator.app/Contents/MacOS/iPhone Simulator -SimulateDevice

-SimulateDevice is used to launch a specific device type

Now with Xcode 6 the path and the app has been changed to

/Applications/Xcode.app/Contents/Developer/Applications/iOS Simulator.app/Contents/MacOS/iOS Simulator

but sadly -SimulateDevice option is not working now. I can launch the simulator, but dont have an option to specify which one to launch

Anyone found any alternatives for this with Xcode 6?

解决方案:
  我想要找到一种方法来实现      苹果公司推出了一个有趣的工具与Xcode 6 !      simctl      simclt允许您控制模拟器运行      运行xcrun simctl可用子命令的列表。许多新选项来玩耍。      现在去做我想要的。这是命令来启动模拟器      xcrun仪器- w“iPhone 5(8.0模拟器)”      - w是提供设备类型和可用设备列表,执行这个      xcrun仪器- s      发射后使用simctl模拟器可以控制它      安装你的应用程序      xcrun simctl安装启动< >应用程序路径      启动应用程序      xcrun simctl发射启动<应用标识符>      希望这有助于
原文:

Found a way to achieve what I wanted

Apple has introduced an interesting tool with Xcode 6!

simctl

simclt allows you to control the simulators running

run xcrun simctl to get the list of available subcommands. Lots of new options to play around.

Now to do what I wanted. Here is the command to launch simulator

xcrun instruments -w "iPhone 5 (8.0 Simulator)"

-w is to provide device type and to get the list of available devices, just execute this

xcrun instruments -s

After launching the simulator you can control it using simctl

To install you app

xcrun simctl install booted <app path>

To launch the app

xcrun simctl launch booted <app identifier>

Hope this helps

dusty的回复:<应用标识符>是应用程序包id

(原文:<app identifier> is your app bundle id)

space_monkey的回复:官方文档simctl命令的存在吗?

(原文:Does official documentation exists for the simctl command?)

daniellmb的回复:我看到,除了一些已知问题,如前所述xcrun simctl将列出的命令。在我看来他们是漂亮的自我解释。

(原文:Not that I saw, other than some known issues, as mentioned running xcrun simctl will list the commands. In my opinion they are pretty self explanatory.)

iLoveUnicorns的回复:优秀,工作的100%。

(原文:Excellent, working 100%.)

CambridgeMike的回复:我不能够让它使用xcrun simctl启动<设备id >而不是xcrun仪器- w……

(原文:I wasn't able to get it to work using xcrun simctl boot <device id> instead of xcrun instruments -w...)

IT组织首度开放,在 创建属于你的IT怪组织, 即日起前100名发表过有质量帖子的注册用户,马上就变成组织头目了, 心情好激动啊。 马上去看看
解决方案:
  Xcode 6,如果你想iOS模拟器。应用程序启动时启动一个特定的设备,你可以从命令行运行这个:      开放——“iOS模拟器”——args -CurrentDeviceUDID <设备UDID >      在那里你可以找出你想要的设备的UDID引导:      xcrun simctl列表
原文:

With Xcode 6, if you want to have the iOS Simulator.app boot a specific device when it launches, you can run this from the command line:

open -a "iOS Simulator" --args -CurrentDeviceUDID <DEVICE UDID>

where you can figure out the UDID of the device you want to boot from:

xcrun simctl list

Michael Teper的回复:在6.2测试版,命令不再有效。例如,而不是推出iPhone 5 s模拟器(鉴于其ID),我让iPad空气模拟器。

(原文:In 6.2 beta, that command no longer works. For example, instead of launching the iPhone 5s simulator (given its ID), I get the iPad Air simulator.)

Jeremy Huddleston Sequoia的回复:它仍然很吸引我。

(原文:It still works for me.)

Michael Teper的回复:嗯,我们已经不可靠地工作在3个不同的机器上。其他的信息我可以提供帮助解决吗?

(原文:Hmm, we have it reliably not working across 3 different machines. Any other info I can supply to help troubleshoot?)

Michael Teper的回复:我知道正在发生什么。我们安装Xcode 6.2测试版,但是不让它默认Xcode。所以,/usr/bin/xcrun simctl列表列出了常规Xcode模拟器。然而,开放——“iOS模拟器”启动6.2 beta模拟器,它预计从beta模拟器设备id。我怎么能指定哪个我模拟器启动(定期比β)吗?

(原文:I've figured out what is happening. We installed Xcode 6.2 beta, but did not make it the default Xcode. So, /usr/bin/xcrun simctl list lists the simulators available to regular Xcode. However, open -a "iOS Simulator" launches the 6.2 beta simulator, which is expecting the device IDs from the beta simulator. How can I specify which simulator I launch (regular vs. beta)?)

Jeremy Huddleston Sequoia的回复:/ / Xcode打开/路径。应用程序/内容/开发/应用程序/ iOS \ Simulator.app

(原文:open /path/to/Xcode.app/Contents/Developer/Applications/iOS\ Simulator.app)

解决方案:
  您可以指定的硬件和iOS版本- w国旗。的格式是            如:      工具- w“iPhone视网膜(3.5英寸)-模拟器iOS 7.1”。      你会得到可用hardvare-iOS组合使用工具- w帮助命令。
原文:

You can specify the hardware and iOS version with -w flag. The format is

instruments -w "simulator-version"

For eg:

instruments -w "iPhone Retina (3.5-inch) - Simulator - iOS 7.1".

You will get the available hardvare-iOS combinations by using the instruments -w help command.

Michael Teper的回复:使用仪器- s设备的设备列表。然而,一旦你有设备名称,只需调用工具- w <设备>可能会产生一个错误,因为工具试图编写一个跟踪您的驱动器的根。您可能希望指定一个路径跟踪,它将成功地写入。

(原文:Use instruments -s devices to get a list of devices. However, once you have the device name, simply calling instruments -w <device> will likely yield an error as instruments attempts to write a trace to the root of your drive. You may want to specify a path for the trace that it will successfully write to.)

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多