4

我最近在我的 Mac 上安装了一个新的 OS X,并在上面安装了 XCode。它只为我提供了 iOs 6.0 模拟器(也许只有 iPhone 5,我真的不知道如何更改模拟设备)。

在将 iPhone 4 项目移植到此 XCode 时,我遇到了几个问题,我想看看问题是由于 iOS 6/iPhone 5 的新更改引起的,还是仅仅是代码错误。

出于这个原因,我希望能够使用 iOs 4 / iPhone 4 运行模拟器,但我找不到这样做的方法。

有什么建议么?

4

4 回答 4

7

在 Xcode 中转到:

Xcode -> 首选项 -> 下载

然后下载你需要的模拟器。

于 2012-10-22T18:56:02.233 回答
5

First of all, you're able to have same iPhone simulators (iPhone 4, 5, 5s, etc) with different iOS version (8.1, 10.1, 11.2, etc).

For latest Xcode, there are couple ways to do that:

  1. XCode -> Preference (Command + ,) -> Components. Then install your desired simulators. All other ways will eventually open this window.

enter image description here

  1. Click on your active scheme (pic. 1) -> scroll down to the bottom of the selection pop up (pic. 2) -> click "Download Simulators..."

Click on your active scheme

scroll down to the bottom of the selection pop up

  1. Window -> Devices and Simulators -> Tab Simulators -> Click plus sign on bottom left corner to open "Create a new simulator" pop up window -> click "OS version" selection -> chose "Download more simulator runtimes ...".

I think by installing the runtimes, Xcode will eventually install all iPhone version that support it, down to iPhone 5.

Devices and Simulators

于 2017-12-29T02:36:18.400 回答
0

您可以通过从安装了它们的其他人那里复制 sdks 文件来快速安装所有模拟器 sdks。该文件位于/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/. 以我为例:

songxiaofeng@xserver:~$ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/
songxiaofeng@xserver:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs$ ls
iPhoneSimulator5.0.sdk iPhoneSimulator5.1.sdk iPhoneSimulator6.0.sdk iPhoneSimulator6.1.sdk

复制这些文件后,重新启动你的xcode,你会发现这些模拟器。祝你好运!

于 2013-08-28T03:08:03.653 回答
0

在 2020 年执行此操作的方法是转到 Xcode > Preferences > Components 并单击要安装的版本上的下载符号。

用户界面

于 2021-01-15T00:47:09.373 回答