Xcode6:运行模拟器的两个实例 [英] Xcode6: Run two instances of the simulator

查看:103
本文介绍了Xcode6:运行模拟器的两个实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的iOS应用程序有两个不同的目标。是否可以在两个不同的模拟器实例上同时运行这两个应用程序?
如果它不需要Xcode的调试器,那就没关系。
到目前为止,我找到的唯一解决方案是安装两个版本的XCode,但这是一个非常繁重/耗费空间的解决方案。

I have two different targets for my iOS app. Is it possible to run simultaneously the two apps on two different instances of the simulator? It's ok if it would require not to benefit of the Xcode's debugger. So far the only solution I found was to install two versions of XCode, but that's a very heavy/space-consuming solution.

推荐答案

您可以从命令行运行iOS模拟器的两个实例。它们不会附加到Xcode调试 - 事实上,如果你没有运行Xcode,它似乎只能工作。

You can run two instances of the iOS simulator from the command line. They won’t be attached to Xcode debugging—indeed, it seems only to work if you do it without Xcode running at all.

首先,你需要运行应用程序在Xcode的模拟器中,为了将它安装在模拟器中。确保你运行的是最终使用的相同模拟器

First, you need to run the app in the simulator from Xcode, in order to get it installed in the simulator. Make sure you’re running the same simulators you’ll ultimately be using

现在打开一个终端窗口,然后执行此操作。

Now open a Terminal window, and do this.

cd /Applications/Xcode.app/Contents/Developer/Applications
open -n iOS\ Simulator.app
open -n iOS\ Simulator.app

Xcode 7更新:使用Xcode 7应用程序名称模拟器已经改变了,所以就是这样:

Update for Xcode 7: With Xcode 7 the application name of the simulator has changed, so it's this instead:

cd /Applications/Xcode.app/Contents/Developer/Applications
open -n Simulator.app
open -n Simulator.app

第二次一个启动你会得到一个错误警报。只需将其从硬件»设备中解除并选择其他设备即可。现在你有两个模拟器在运行,你从Xcode安装的任何应用都将在那里。

When the second one launches you’ll get an error alert. Just dismiss it and select a different device from "Hardware" » "Device". Now you have two simulators running, and whatever apps you already installed in them from Xcode will be there.

这篇关于Xcode6:运行模拟器的两个实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆