简体   繁体   English

iOS模拟器仅列出最新的iOS版本。 如何设置早期版本

[英]iOS simulator only list the latest iOS version. How can I set earlier versions

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. 我不想支持3.x(虽然它会很好),但至少我想在4.2,4.1和4.0上模拟我的应用程序。 What's going on? 这是怎么回事? Why aren't they listed? 他们为什么不上市?

UPDATE: I'm on Lion so I cannot install an earlier version of Xcode. 更新:我在Lion上,所以我无法安装早期版本的Xcode。 Before my Upgrade I could test different versions easily. 在升级之前,我可以轻松地测试不同的版本。

the problem is that you have no other Simulator SDK installed which can be used. 问题是您没有安装可以使用的其他Simulator SDK。 As @dorada has mentioned you have to install an older Xcode which in fact doesn't work because you're using Lion. 正如@dorada所提到的,你必须安装一个旧的Xcode,因为你正在使用Lion,所以它实际上不起作用。 I haven't tried it with Lion but principally it should work like before with Snow Leopard. 我没有和Lion一起尝试过,但主要是它应该像以前一样使用Snow Leopard。
I'm referencing to my other answer how to get an older Xcode (don't know if it's still working) 我正在引用我的另一个答案如何获得一个旧的Xcode(不知道它是否仍在工作)

After you have an older Xcode version, mount the image an navigate with terminal to that volume. 拥有较旧的Xcode版本后,安装映像并使用终端导航到该卷。 There should be a hidden folder Packages . 应该有一个隐藏的文件Packages open that folder with open . 打开该文件夹open . and locate the two .pkg files you need (eg iPhoneSDK4_0.pkg and iPhoneSimulatorSDK4_0.pkg ) and install both. 并找到您需要的两个.pkg文件(例如iPhoneSDK4_0.pkgiPhoneSimulatorSDK4_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) 完成(并且在那时我已经验证了它:它适用于我的狮子。我使用了自3.2.1开始备份的DVD映像)

Although iPortable has the correct answer I decided to post a step-by-step guide which is easer to follow: 虽然iPortable有正确的答案,但我决定发布一个易于遵循的分步指南:

  1. Download Xcode 3.1 下载Xcode 3.1
  2. Mount the dmg file 挂载dmg文件
  3. In Finder menu select "Go\\Go to folder" and enter "/Volumes/Xcode and iOS SDK/Packages" 在Finder菜单中选择“Go \\ Go to folder”并输入“/ Volumes / Xcode和iOS SDK / Packages”
  4. Install the simulators you need (Double click) 安装所需的模拟器(双击)
  5. Copy the simulation folders from /Platforms/iPhoneSimulator.platform/Developer/SDKs/ to /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/ 将模拟文件夹从/Platforms/iPhoneSimulator.platform/Developer/SDKs/复制到/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/
  6. 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) 如果您缺少某些SDK从“/ Volumes / Xcode和iOS SDK / Packages”安装缺少的SDK,并将子文件夹从/Platforms/iPhoneOS.platform/DeviceSupport/复制到/Developer/Platforms/iPhoneOS.platform/DeviceSupport/(对我来说)它们都在3.1到4.3之间

you may download the older ios sdk / xcode from . 你可以从下载旧的ios sdk / xcode。 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!) (我实际上在另一个堆栈溢出主题中找到了这个答案,但现在我似乎无法找到那个问题!)

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中的运行菜单中选择它即可。

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. - 我们让他们在办公室的共享驱动器上。

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." 在为Snow Leopard安装Xcode 4.2之后,我注意到iPad 3.2 Simulator有一个选择,但使用它只会显示一些警告,说“iOS模拟器无法找到SDK。可能需要重新安装SDK。” and another alert that says "Simulated application quit. Click Relaunch to try again." 另一个警告说“模拟应用程序退出。点击重新启动再试一次”。 with Quit, Switch SDK, and Relaunch buttons. 使用Quit,Switch 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模拟器,iPhone 4.1模拟器,iPad 4.2模拟器等,直到iPad / iPhone 5.0模拟器,但真的很想有iPad 3.2模拟器和iPhone 3.1.3模拟器,如果可能的话,早期降至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版本?

转到项目设置 - >摘要更改部署目标。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM