xcode iOS模拟器只列出最新的iOS版本。我如何设置早期版本
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7459399/
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
iOS simulator only list the latest iOS version. How can I set earlier versions
提问by Tibidabo
According to the documentation should be able to choose which iOS version the simulator should run, however only the latest 4.3.2 is listed under "Hardware/Version".
根据文档应该能够选择模拟器应该运行的 iOS 版本,但是只有最新的 4.3.2 列在“硬件/版本”下。
The helps says: "To set the iOS release used in the simulation environment, choose Hardware > Version, and choose the version you want to test on."
帮助说:“要设置在模拟环境中使用的 iOS 版本,请选择硬件 > 版本,然后选择要测试的版本。”
I don't want to support 3.x (although it would be nice) but at least I want to simulate my app on 4.2, 4.1 and 4.0. What's going on? Why aren't they listed?
我不想支持 3.x(虽然它会很好)但至少我想在 4.2、4.1 和 4.0 上模拟我的应用程序。这是怎么回事?为什么没有列出来?
UPDATE: I'm on Lion so I cannot install an earlier version of Xcode. Before my Upgrade I could test different versions easily.
更新:我在使用 Lion,所以我无法安装早期版本的 Xcode。在升级之前,我可以轻松测试不同的版本。
采纳答案by Tibidabo
the problem is that you have no other Simulator SDK installed which can be used. As @dorada has mentioned you have to install an older Xcode which in fact doesn't work because you're using Lion. I haven't tried it with Lion but principally it should work like before with Snow Leopard.
I'm referencing to my other answerhow to get an older Xcode (don't know if it's still working)
问题是您没有安装可以使用的其他模拟器 SDK。正如@dorada 所提到的,您必须安装一个较旧的 Xcode,实际上它不起作用,因为您使用的是 Lion。我还没有在 Lion 上尝试过,但主要是它应该像以前一样在 Snow Leopard 上工作。
我正在参考我的其他答案如何获得较旧的 Xcode(不知道它是否仍在工作)
After you have an older Xcode version, mount the image an navigate with terminal to that volume. There should be a hidden folder Packages
. open that folder with open .
and locate the two .pkg
files you need (e.g. iPhoneSDK4_0.pkg
and iPhoneSimulatorSDK4_0.pkg
) and install both.
在您拥有较旧的 Xcode 版本后,安装图像并使用终端导航到该卷。应该有一个隐藏文件夹Packages
。打开该文件夹open .
并找到.pkg
您需要的两个文件(例如iPhoneSDK4_0.pkg
和iPhoneSimulatorSDK4_0.pkg
)并安装它们。
They will appear in your root directory and you have to move them to your Developer
dir (don't simply overwrite, it will delete all other SDKs. go to the last different folder it should be iPhoneSimulator4.0.sdk\
and copy that one)
它们将出现在您的根目录中,您必须将它们移动到您的Developer
目录中(不要简单地覆盖,它会删除所有其他 SDK。转到应该是的最后一个不同文件夹iPhoneSimulator4.0.sdk\
并复制该文件夹)
DONE (and at that point I have verified it: it works on my Lion. I used the dvd image which I have started backup'ing since 3.2.1)
完成(那时我已经验证了它:它适用于我的 Lion。我使用了从 3.2.1 开始备份的 DVD 映像)
回答by Tibidabo
Although iPortable has the correct answer I decided to post a step-by-step guide which is easer to follow:
虽然 iPortable 有正确的答案,但我决定发布一个更容易遵循的分步指南:
- Download Xcode 3.1
- Mount the dmg file
- In Finder menu select "Go\Go to folder" and enter "/Volumes/Xcode and iOS SDK/Packages"
- Install the simulators you need (Double click)
- Copy the simulation folders from /Platforms/iPhoneSimulator.platform/Developer/SDKs/ to /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/
- If your have some SDK missing Install the missing SDK from "/Volumes/Xcode and iOS SDK/Packages" and copy subfolders from /Platforms/iPhoneOS.platform/DeviceSupport/ to /Developer/Platforms/iPhoneOS.platform/DeviceSupport/ (for me they were all there from 3.1 to 4.3)
- 下载 Xcode 3.1
- 挂载dmg文件
- 在 Finder 菜单中选择“Go\Go to folder”并输入“/Volumes/Xcode and iOS SDK/Packages”
- 安装你需要的模拟器(双击)
- 将模拟文件夹从 /Platforms/iPhoneSimulator.platform/Developer/SDKs/ 复制到 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/
- 如果您缺少某些 SDK,请从“/Volumes/Xcode and iOS SDK/Packages”安装缺少的 SDK,并将子文件夹从 /Platforms/iPhoneOS.platform/DeviceSupport/ 复制到 /Developer/Platforms/iPhoneOS.platform/DeviceSupport/(对我而言)他们都在那里从 3.1 到 4.3)
回答by Shrouk Khan
you may download the older ios sdk / xcode from . https://developer.apple.com/downloads/index.action
您可以从 . https://developer.apple.com/downloads/index.action
(i found this answer in another stack overflow topic actually, but now i can not seem to find that question!)
(我实际上在另一个堆栈溢出主题中找到了这个答案,但现在我似乎找不到那个问题!)
回答by Paul Herron
Open Xcode and in the menu at the top left, where you select what device to run on, click "More Simulators..."
打开 Xcode 并在左上角的菜单中选择要运行的设备,单击“更多模拟器...”
The download section of Xcode preferences will open,
Xcode首选项的下载部分将打开,
Click the "Components" tab.
单击“组件”选项卡。
You will see a list of simulators that can be installed, click install on version you need.
您将看到可以安装的模拟器列表,单击安装您需要的版本。
The simulator will need to restart to install.
模拟器需要重新启动才能安装。
To run the newly installed version of the simulator just select it from the run menu in Xcode.
要运行新安装的模拟器版本,只需从 Xcode 的运行菜单中选择它。
回答by Daniel Broad
You actually have to install previous simulator versions, they aren't there on a new install.
您实际上必须安装以前的模拟器版本,它们在新安装中不存在。
Maybe you can search and download them somewhere? - we keep them on a shared drive at the office.
也许您可以在某处搜索并下载它们?- 我们将它们保存在办公室的共享驱动器上。
回答by Rei
After installing the Xcode 4.2 for Snow Leopard, I noticed there was a choice for iPad 3.2 Simulator, but using it just brings up some alerts that say "iOS Simulator could not find the SDK. The SDK may need to be reinstalled." and another alert that says "Simulated application quit. Click Relaunch to try again." with Quit, Switch SDK, and Relaunch buttons.
在为 Snow Leopard 安装 Xcode 4.2 后,我注意到 iPad 3.2 Simulator 有一个选择,但使用它只会出现一些警报,提示“iOS Simulator 找不到 SDK。可能需要重新安装 SDK。” 以及另一个提示“模拟应用程序退出。单击重新启动以重试。” 带有退出、切换 SDK 和重新启动按钮。
I can successfully use iPhone 4.0 Simulator, iPhone 4.1 Simulator, iPad 4.2 Simulator, etc up to iPad/iPhone 5.0 Simulator, but really would like to have iPad 3.2 Simulator and iPhone 3.1.3 Simulator and earlier down to 3.0 if possible.
我可以成功地使用 iPhone 4.0 Simulator、iPhone 4.1 Simulator、iPad 4.2 Simulator 等直到 iPad/iPhone 5.0 Simulator,但如果可能的话,我真的希望 iPad 3.2 Simulator 和 iPhone 3.1.3 Simulator 及更早版本降低到 3.0。
Our apps generally run all the way back to 3.0 and we occasionally receive bug reports from earlier iOS users, and would love to be able to debug these issues more effectively.
我们的应用程序通常一直运行到 3.0,我们偶尔会收到早期 iOS 用户的错误报告,并且希望能够更有效地调试这些问题。
I tried the technique summarized by Tibidabo and although I am able to copy the simulator folders as mentioned, and though they show up as choices in Xcode, I cannot get them to actually run as simulators and I get the same problem alerts mentioned above.
我尝试了 Tibidabo 总结的技术,虽然我能够复制提到的模拟器文件夹,虽然它们在 Xcode 中显示为选项,但我无法让它们作为模拟器实际运行,并且我收到了上述相同的问题警报。
What are other developers doing to support debugging of older iOS versions?
其他开发人员在做什么来支持旧 iOS 版本的调试?
回答by d.lebedev
Go to Project Settings -> Summaryan change Deployment Target.
转到项目设置 -> 汇总更改部署目标。