Xcode/Simulator:如何运行较旧的 iOS 版本?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4262018/
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-08-30 18:08:15  来源:igfitidea点击:

Xcode/Simulator: How to run older iOS version?

iosobjective-ciphonexcodeipad

提问by foreyez

I'm thinking of upgrading to iOS SDK 4.2. But what I'm wondering is if I'll still be able to run the simulator as iOS 3.2. This is because I'm creating iAds for iPad but I still want to check if my program will run with iOS 3.2.

我正在考虑升级到 iOS SDK 4.2。但我想知道的是,我是否仍然能够将模拟器作为 iOS 3.2 运行。这是因为我正在为 iPad 创建 iAds,但我仍然想检查我的程序是否可以在 iOS 3.2 上运行。

Note: I have seen a similar post to this in the past, but they weren't really helpful in giving the exact steps in how this could be done.

注意:我过去曾看到过与此类似的帖子,但它们并没有真正帮助提供如何做到这一点的确切步骤。

采纳答案by ingh.am

If you have iAds in your binary you will not be able to run it on anything before iOS 4.0 and it will be rejected if you try and submit a binary like this.

如果你的二进制文件中有 iAds,你将无法在 iOS 4.0 之前的任何东西上运行它,如果你尝试提交这样的二进制文件,它将被拒绝。

You can still run the simulator from 3.2 onwards after upgrading.

升级后,您仍然可以从 3.2 开始运行模拟器。

In the iPhone Simulator try selecting Hardware -> Version -> 3.2

在 iPhone 模拟器中尝试选择硬件 -> 版本 -> 3.2

回答by t.mikael.d

To anyone else who finds this older question, you can now download allold versions.

对于发现这个较旧问题的任何其他人,您现在可以下载所有旧版本。

Xcode-> Preferences-> Components(Click on Simulators tab).

Xcode-> Preferences-> Components(单击模拟器选项卡)。

Install all the versions you want/need.

安装您想要/需要的所有版本。

To show all installed simulators:

显示所有已安装的模拟器:

Target -> In dropdown "deployment target" choose the installed version with lowest version nr.

目标 -> 在下拉“部署目标”中选择版本号最低的已安装版本。

You should now see all your available simulators in the dropdown.

您现在应该在下拉列表中看到所有可用的模拟器。

回答by Ashok R

XCODE 10.1

Xcode 10.1

1. Goto Xcode -> Preferences (Shortcut CMD,)

1. 转到 Xcode -> Preferences (Shortcut CMD,)

2. Select Components

2. 选择组件

3. Download Simulator version

3.下载模拟器版本

enter image description here

在此处输入图片说明

4. XCode -> Open Developer Tool -> Simulator This will launch Simulator as stand alone application

4. XCode -> Open Developer Tool -> Simulator 这将启动 Simulator 作为独立应用程序

5 Hardware -> Device -> Manage Devices...

5 硬件 -> 设备 -> 管理设备...

6. Click on + iCon to create new simulator version.

6. 点击 + iCon 创建新的模拟器版本。

7. Specify Simulator Name, Device Type and Choose OS version from drop down.

7. 指定模拟器名称、设备类型并从下拉列表中选择操作系统版本。

enter image description here

在此处输入图片说明

8. Click Create.

8. 单击创建。

9. Hardware -> Device -> iOS 11.0 -> iPhone 6

9. 硬件 -> 设备 -> iOS 11.0 -> iPhone 6

enter image description here

在此处输入图片说明

enter image description here

在此处输入图片说明

enter image description here

在此处输入图片说明

Thats it run enjoy coding!

这就是它运行享受编码!

回答by Ian Vink

Open xcode and in the top menu go to xcode> Preferences> Downloadsand you will be given the option to download old sdks to use with xcode. You can also download command line tools and Device Debugging Support.

打开 xcode 并在顶部菜单中转到xcode>首选项>下载,您将可以选择下载旧的 sdks 以与 xcode 一起使用。您还可以下载命令行工具和设备调试支持。

enter image description here

在此处输入图片说明

回答by hieund

To add previous iOS simulator to Xcode 4.2, you need old xcode_3.2.6_and_ios_sdk_4.3.dmg (or similar version) installer file and do as following:

要将以前的 iOS 模拟器添加到 Xcode 4.2,您需要旧的 xcode_3.2.6_and_ios_sdk_4.3.dmg(或类似版本)安装程序文件并执行以下操作:

  • Mount the xcode_3.2.6_and_ios_sdk_4.3.dmg file
  • Open mounting disk image and choose menu: Go->Go to Folder...
  • Type /Volumes/Xcode and iOS SDK/Packages/ then click Go. There are many packages and find to iPhoneSimulatorSDK(version).pkg
  • Double click to install package you want to add and wait for installer displays.
  • In Installer click Continue and choose destination, Choose folder...
  • Explorer shows and select Developer folder and click Choose
  • Install and repeat with other simulator as you need.
  • Restart Xcode.
  • 挂载 xcode_3.2.6_and_ios_sdk_4.3.dmg 文件
  • 打开挂载磁盘映像并选择菜单:Go->Go to Folder...
  • 输入 /Volumes/Xcode 和 iOS SDK/Packages/ 然后点击 Go。有很多包,找到 iPhoneSimulatorSDK(version).pkg
  • 双击安装您要添加的软件包并等待安装程序显示。
  • 在安装程序中单击继续并选择目的地,选择文件夹...
  • 资源管理器显示并选择开发者文件夹,然后单击选择
  • 根据需要安装并与其他模拟器重复。
  • 重新启动Xcode。

Now there are a list of your installed simulator.

现在有一个已安装模拟器的列表。

回答by Steve

In XCode under Targets, right-click on your project and Get Info. Under the Buildtab look for iOS Deployment Target. By changing this you should be able to test different iOS version.

在 XCode 下的Targets 中,右键单击您的项目和Get Info。在Build选项卡下查找 iOS Deployment Target。通过更改此设置,您应该能够测试不同的 iOS 版本。

alt text

替代文字

回答by SteveCaine

Choosing older simulator versions is not obvious in Xcode 3.2.5. Older Xcodes had separate lists of "iOS Device SDKs" and "iOS Simulator SDKs" in the "Base SDK" build setting popup menu, but in Xcode 3.2.5 these have been replaced with a single "iOS SDKs" list that only offers 4.2 and "latest".

在 Xcode 3.2.5 中选择旧的模拟器版本并不明显。较旧的 Xcode 在“Base SDK”构建设置弹出菜单中具有单独的“iOS Device SDKs”和“iOS Simulator SDKs”列表,但在 Xcode 3.2.5 中,这些已被替换为仅提供 4.2 的单个“iOS SDKs”列表和“最新”。

If you create a new default iOS project, it defaults to 4.2 for both Base SDK and Deployment Target, and in the "Overview" popup in the project's top-left corner, only the 4.2 Simulator is available.

如果新建一个默认的 iOS 项目,Base SDK 和 Deployment Target 都默认为 4.2,并且在项目左上角的“Overview”弹出窗口中,只有 4.2 Simulator 可用。

To run an older iOS simulator, you must choose an older iOS version in the "iOS Deployment Target" build setting popup. Only then will the "Overview" popup offer older Simulators: back to 4.0 for iPhone and to 3.2 for iPad.

要运行较旧的 iOS 模拟器,您必须在“iOS 部署目标”构建设置弹出窗口中选择较旧的 iOS 版本。只有到那时,“概览”弹出窗口才会提供较旧的模拟器:iPhone 回到 4.0,iPad 回到 3.2。

回答by Freeman

The simulator CANNOT be downloaded from:

模拟器不能从以下位置下载:

Xcode -> Preferences -> Downloads

Xcode -> 首选项 -> 下载

Only the iOS devices symbols. As this option says:

只有 iOS 设备符号。正如这个选项所说:

This package includes information and symbols that Xcode needs for debugging your app on iOS devices running versions of iOS prior to iOS 4.2. If you intend to debug your app on a device running one of these versions of iOS you should install this package.

此包包含 Xcode 在运行 iOS 4.2 之前的 iOS 版本的 iOS 设备上调试应用程序所需的信息和符号。如果你打算在运行这些 iOS 版本之一的设备上调试你的应用程序,你应该安装这个包。

That is, you need an iOS 4.2 device to test an iOS 4.2 application

也就是说,您需要一个 iOS 4.2 设备来测试一个 iOS 4.2 应用程序