将 ios 5 模拟器安装到 xcode 5.1?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22479215/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 04:47:23  来源:igfitidea点击:

Install ios 5 simulator to xcode 5.1?

iosxcode

提问by Piyush

I am currently using xcode 5.1 with Mac 10.8.5. But i can not install ios simulator in this xcode? any one tell me how to install ios 5 simulator ?

我目前在 Mac 10.8.5 上使用 xcode 5.1。但是我不能在这个 xcode 中安装 ios 模拟器?有人告诉我如何安装ios 5模拟器吗?

回答by Todd Lehman

Man, this reallymade me angry today when I upgraded from Xcode 5.0 to Xcode 5.1 and discovered that I no longer had a functional iOS 5.1 simulator. There was nothingin the Software Update process that gave me any heads-up whatsoever that this would disable iOS 5.0/5.1 simulators. Bad Apple! Bad!

伙计,今天当我从 Xcode 5.0 升级到 Xcode 5.1 并发现我不再有一个功能齐全的 iOS 5.1 模拟器时,这真的让我很生气。有没有在软件更新过程中给了我任何抬头无论如何,这将禁用的iOS 5.0 / 5.1模拟器。坏苹果!坏的!

Anyway, here's the workaround I came up with. It seems pretty clean.

无论如何,这是我想出的解决方法。看起来很干净。

  1. I noticed that in ~/Library/Caches/com.apple.dt.Xcode/Downloadsthere was an old file sitting around called Xcode.SDK.iPhoneSimulator.5.1-5.1.dmg(thank god I never cleared out that cache directory).
  2. I double-clicked this disk image to mount it, and then double-clicked the .pkg file inside that. The package installer then placed the contents into a subdirectory of /Platforms.
  3. I then moved /Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdkinto /Applications/Xcode/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKsand restarted Xcode.
  1. 我注意到~/Library/Caches/com.apple.dt.Xcode/Downloads有一个旧文件叫做Xcode.SDK.iPhoneSimulator.5.1-5.1.dmg(谢天谢地,我从来没有清除过那个缓存目录)。
  2. 我双击这个磁盘映像来挂载它,然后双击里面的 .pkg 文件。包安装程序然后将内容放入/Platforms.
  3. 然后我/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk进入/Applications/Xcode/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs并重新启动Xcode。

Bam. Done. Back in business.

砰。完毕。回到工作。

Note: Another approach, if you happen to have a thorough Time Machine backup of your full system, as Pandey Laxman pointed out earlier, is simply to restore the contents of /Applications/Xcode/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdkfrom an older backup. In my case, I wasn't able to do this because my development system is a MacBook Air that I keep backed via Time Machine up onto a permanently-installed 32GB SanDisk Cruzer Fit USB flash drive (as well as two extra Time Machine backups on separate network drives). Anyway, because the backup drive is relatively small, when I first set up Time Machine on this system, I had excluded /Applicationsfrom my backup (something I don't recommend doing).

注意:另一种方法,如果您碰巧对整个系统进行了彻底的 Time Machine 备份,正如 Pandey Laxman 之前指出的那样,只是/Applications/Xcode/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk从旧备份中恢复内容。就我而言,我无法做到这一点,因为我的开发系统是 MacBook Air,我通过 Time Machine 将其备份到永久安装的 32GB SanDisk Cruzer Fit USB 闪存驱动器(以及两个额外的 Time Machine 备份)单独的网络驱动器)。无论如何,因为备份驱动器相对较小,当我第一次在这个系统上设置 Time Machine 时,我已经/Applications从我的备份中排除了(我不建议这样做)。

回答by BuvinJ

In order to develop for the latest version of iOS, you need the latest iOS SDK, which requires the latest version of XCode, which in turn requires the latest version of OSX (at least as of writing this iOS 8.3 requires XCode 6.3, which requires OSX 10.10 - all the latest and greatest).

为了针对最新版本的 iOS 进行开发,您需要最新的 iOS SDK,这需要最新版本的 XCode,而这又需要最新版本的 OSX(至少在编写此 iOS 8.3 时需要 XCode 6.3,这需要OSX 10.10 - 所有最新和最好的)。

I would guess that Apple doesn't want to support iPad 1s and old iPhones anymore running iOS 5. Thus, they've done what they could to discourage developers from supportting them.

我猜苹果不想再支持运行 iOS 5 的 iPad 1 和旧 iPhone。因此,他们已经尽其所能阻止开发人员支持它们。

I, personal, put a lot of effort into coding to support iOS 5 through 8. I am not in hurry to throw that backwards compatibility away, but obviously developing for the most current version of iOS takes priority.

我个人在编码上投入了大量精力以支持 iOS 5 到 8。我并不急于放弃向后兼容性,但显然为最新版本的 iOS 开发具有优先权。

To get to the point, you can't install or run an iOS 5 simulator on OSX 10.10 Yosemite. I couldn't get an iOS 6 simulator to run either for some reason (even though I was able to install it in XCode 5).

切入正题,您无法在 OSX 10.10 Yosemite 上安装或运行 iOS 5 模拟器。由于某种原因,我无法运行 iOS 6 模拟器(即使我能够在 XCode 5 中安装它)。

I did, however, find a solution so I could use simulators for iOS 5 through 8 on my machine.

但是,我确实找到了一个解决方案,这样我就可以在我的机器上使用适用于 iOS 5 到 8 的模拟器。

How? Setup a dual boot into an older os and install some software which can no longer be downloaded, but I tracked down.

如何?在较旧的操作系统中设置双启动并安装一些无法再下载的软件,但我找到了。

I've posted the steps and all the software here. Nothing is difficult about any of this, but it will take many hour of downloading and running installations, ect. Reserve a day to do this while working another machine most of the time.

我已经在这里发布了步骤和所有软件。这一切都没有什么困难,但是下载和运行安装等需要很多小时。大部分时间在另一台机器上工作时预留一天来执行此操作。

  1. Create a partition on your hard drive from which you can run OSX Lion. I found 32 GB was large enough. You may also want to create an additional partition at the same time rather than use a flash drive in step 2. I also made it 32 GB, but it could probably be a lot smaller (8? maybe even 4 gig?).
  1. 在您的硬盘驱动器上创建一个分区,您可以从中运行 OSX Lion。我发现 32 GB 已经足够大了。您可能还想同时创建一个额外的分区,而不是在第 2 步中使用闪存驱动器。我也将它设置为 32 GB,但它可能会小很多(8?甚至 4 gig?)。

Here's a link to help with that:

这是一个可以帮助解决此问题的链接:

http://arstechnica.com/apple/2014/06/how-to-create-a-test-partition-for-the-os-x-yosemite-beta/

http://arstechnica.com/apple/2014/06/how-to-create-a-test-partition-for-the-os-x-yosemite-beta/

  1. Create a bootable installer drive for Lion. You can use a flash drive, or the extra partition suggested in step 1 (that's what I did when the only flash I had on me was acting up).
  1. 为 Lion 创建可引导的安装程序驱动器。您可以使用闪存驱动器或步骤 1 中建议的额外分区(这是我在我身上唯一的闪存出现故障时所做的)。

Here's the os:

这是操作系统:

OSX 10.7.2 Lion https://drive.google.com/file/d/0BwmycZWygE8EUlhCYWlOWjlCcHM/view?usp=sharing

OSX 10.7.2 Lion https://drive.google.com/file/d/0BwmycZWygE8EUlhCYWlOWjlCcHM/view?usp=sharing

Here's directions for doing this:

以下是执行此操作的说明:

http://www.tech-recipes.com/rx/11807/os-x-lion-convert-os-x-lion-dmg-installer-to-a-bootable-usb-thumbdrive-install-without-an-optical-drive/

http://www.tech-recipes.com/rx/11807/os-x-lion-convert-os-x-lion-dmg-installer-to-a-bootable-usb-thumbdrive-install-without-an-光驱/

  1. Run the installer. Restart the machine whiling holding down the "option" key on the keyboard to select your boot device.

  2. Once you have Lion up and running, you need to upgrade it to 10.7.5 (sorry I didn't have that to post to begin with).
    Simply use the basic software update mechanism to do this.

  3. Install XCode 4.6. Here's the software:

  1. 运行安装程序。在按住键盘上的“选项”键的同时重新启动机器以选择您的启动设备。

  2. 一旦您启动并运行了 Lion,您需要将其升级到 10.7.5(抱歉,我一开始没有发布)。
    只需使用基本的软件更新机制即可完成此操作。

  3. 安装 XCode 4.6。这是软件:

XCode 4.6.3 https://drive.google.com/file/d/0BwmycZWygE8ETnlFQ1BSYVV1ZUE/view?usp=sharing

XCode 4.6.3 https://drive.google.com/file/d/0BwmycZWygE8ETnlFQ1BSYVV1ZUE/view?usp=sharing

  1. Normally, you ought to be able to install an iOS 5 simulator via XCode, but Apple has blocked this.
    You can however, install it manually as others have described in this thread for the various sdks (as long as you already have the software!)
  1. 通常,您应该能够通过 XCode 安装 iOS 5 模拟器,但 Apple 已阻止此操作。
    但是,您可以像其他人在此线程中针对各种 sdk 所描述的那样手动安装它(只要您已经拥有该软件!)

Here is the software (since we don't have just happen to be lucky enough to have it previously installed):
Sorry, I don't have 5.1, only 5.0

这是软件(因为我们没有碰巧以前安装过它):
对不起,我没有 5.1,只有 5.0

iOS 5.0 Simulator https://drive.google.com/file/d/0BwmycZWygE8ETndPOFJyUVg0b3M/view?usp=sharing

iOS 5.0 模拟器 https://drive.google.com/file/d/0BwmycZWygE8ETndPOFJyUVg0b3M/view?usp=sharing

  1. Install the command line tools if necessary. Again, XCode ought to allow you to do this, but it will fail when you try the normal way. Go ahead and give it a try. Here's a dmg instead which you can install yourself that is compatible with this setup:
  1. 如有必要,安装命令行工具。同样,XCode 应该允许您这样做,但是当您尝试正常方式时它会失败。去试试吧。这是一个 dmg,您可以自行安装与此设置兼容的 dmg:

Command Line Tools (XCode 4.6 / OSX 10.7) https://drive.google.com/file/d/0BwmycZWygE8EWm9QTW5HYV9PUnM/view?usp=sharing

命令行工具 (XCode 4.6 / OSX 10.7) https://drive.google.com/file/d/0BwmycZWygE8EWm9QTW5HYV9PUnM/view?usp=sharing

  1. Get your project to build in this new environment. There are permission issues and such when you try to cross over to your primary drive. I found the easiest way to get everything working was to copy whatever I needed to the Lion drive and make sure all the relative paths were identical. I also had to play a bit with the code because what compiled for the 7 and 8 sdks didn't work perfectly with this one. That's on you.

  2. I believe the iOS 6 simulator will already be installed for you, but otherwise you should be able to download that still via XCode if needed.

  1. 让您的项目在这个新环境中构建。当您尝试切换到主驱动器时,存在权限问题等问题。我发现让一切正常工作的最简单方法是将我需要的任何内容复制到 Lion 驱动器,并确保所有相对路径都相同。我还不得不玩一些代码,因为为 7 和 8 sdks 编译的内容与此不完美。这在你身上。

  2. 我相信 iOS 6 模拟器已经为您安装好了,但是如果需要,您应该仍然可以通过 XCode 下载它。

Enjoy having all these simulators now!

现在享受所有这些模拟器!

回答by Pandey_Laxman

you need to copy the simulator SDK to Xcode 5.1.

您需要将模拟器 SDK 复制到 Xcode 5.1。

First copy the simulator SDKs from your previous installed Xcode.

首先从之前安装的 Xcode 中复制模拟器 SDK。

then paste it in Xcode 5.1 "Show Package Contents->Contents->Developer->Platforms->iPhoneSimulator.Platforms ->Developer->SDKsfolder

然后将其粘贴到 Xcode 5.1 "Show Package Contents->Contents->Developer->Platforms->iPhoneSimulator.Platforms ->Developer->SDKs文件夹中

There restart the Xcode 5.1.

在那里重新启动 Xcode 5.1。

回答by codercat

xCode 5.02 up to available iOS 58 simulator but after updated the xcode through 5.1 the available simulator start from iOS 6

xCode 5.02 到可用的 iOS 58 模拟器,但在通过 5.1 更新 xcode 后,可用的模拟器从 iOS 6 开始

enter image description here

在此处输入图片说明

iOS Simulator

iOS模拟器

Performance issues can arise when running apps within the iOS Simulator on OS X Mavericks with a simulated OS version of iOS 6.1 or earlier. A workaround is to disable timer coalescing while using the iOS 6.1 or earlier simulator by executing the following command in a Terminal window:

在具有 iOS 6.1 或更早版本的模拟操作系统版本的 OS X Mavericks 上的 iOS 模拟器中运行应用程序时,可能会出现性能问题。解决方法是在使用 iOS 6.1 或更早版本的模拟器时通过在终端窗口中执行以下命令来禁用计时器合并:

sudo sysctl -w kern.timer.coalescing_enabled=0 (15501929)

https://developer.apple.com/library/ios/releasenotes/DeveloperTools/RN-Xcode/xc5_release_notes/xc5_release_notes.html

https://developer.apple.com/library/ios/releasenotes/DeveloperTools/RN-Xcode/xc5_release_notes/xc5_release_notes.html

回答by LML

Unfrotunately ,Xcode 5.1 in OS X 10.9 or 10.8.5 the iOS 5 simulator is no longer available.

不幸的是,OS X 10.9 或 10.8.5 中的 Xcode 5.1 iOS 5 模拟器不再可用。

Better to use some older versions like 4.6 for use iOS 5 simulator

最好使用一些旧版本,如 4.6 来使用 iOS 5 模拟器

回答by Kumar KL

using of Xcode 5 under OS X v10.8 then if you go to Preferences -> Downloadsyou should see the 5.0 and 5.1 simulators available under Components. You can download and install directly from there.

在 OS X v10.8 下使用 Xcode 5 那么如果你去Preferences -> Downloads你应该看到Components下可用的 5.0 和 5.1 模拟器。您可以直接从那里下载和安装。

If you're using Xcode 5 under OS X v10.9 then the iOS 5 simulator is no longer available.

如果您在 OS X v10.9 下使用 Xcode 5,则 iOS 5 模拟器不再可用。