在雪豹上将 iOS 6 SDK 导入 Xcode 4.2

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

Import iOS 6 SDK into Xcode 4.2 on Snow Leopard

iosxcodeosx-snow-leopardios6

提问by MaTTP

I installed Xcode 4.2 on a Snow Lopard and when iOS SDK was published I imported the iOS 5.1 SDK following this topic Is it possible to get the iOS 5.1 SDK for Xcode 4.2 on Snow Leopard?

我在 Snow Lopard 上安装了 Xcode 4.2,当 iOS SDK 发布时,我按照本主题导入了 iOS 5.1 SDK是否可以在 Snow Leopard 上获得适用于 Xcode 4.2 的 iOS 5.1 SDK?

Now I need to import iOS 6 SDK and I would know if this tutorial is still working for iOS 6 SDK.

现在我需要导入 iOS 6 SDK,我想知道本教程是否仍然适用于 iOS 6 SDK。

Thank you!

谢谢!

采纳答案by Fry

I tried following the tutorial that you have linked. It works perfectly for me. Just copy "6.0" instead of "5.1".

我尝试按照您链接的教程进行操作。它非常适合我。只需复制“6.0”而不是“5.1”。

回答by Stan Sieler

This worked for me (after "su -", so I'm running as root), and with the Xcode 4.5 .dmg file mounted as a disk drive.

这对我有用(在“su -”之后,所以我以 root 身份运行),并且将 Xcode 4.5 .dmg 文件安装为磁盘驱动器。


echo copying iPhoneOS6.0.sdk
cp -R /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk               /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/

echo copying iphonesim6.0.sdk
cp -R /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/

echo copying devicesupport for 6.0
cp -R /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/6.0\ \(10A403\)                 /Developer/Platforms/iPhoneOS.platform/DeviceSupport/

#remove old -latest- link
rm -f /Developer/Platforms/iPhoneOS.platform/DeviceSupport/Latest

echo setting up Latest link
cd /Developer/Platforms/iPhoneOS.platform/DeviceSupport/
ln -s ./6.0\ \(10A403\) ./Latest

Note: Xcode dmg file available from https://developer.apple.com/downloads/index.action?name=Xcode(1.56 GB)

注意:Xcode dmg 文件可从https://developer.apple.com/downloads/index.action?name=Xcode(1.56 GB) 获得

回答by Tony Langdon

With a Intel Core Duo (32 bit) running Snow Leopard the iOS 6 simulator doesn't work (because some of the libraries are missing 32 bit variants).

使用运行 Snow Leopard 的 Intel Core Duo(32 位),iOS 6 模拟器不起作用(因为某些库缺少 32 位变体)。

It also appears that while it is possible to test on an iPhone 4 device upgraded to iOS6 by copying the iPhoneOS.platform files but it does not appear to be possible to do the same with an iPhone 5. I assume this is due to the new armv7s format on the device.

似乎还可以通过复制 iPhoneOS.platform 文件在升级到 iOS6 的 iPhone 4 设备上进行测试,但似乎无法对 iPhone 5 进行相同的测试。我认为这是由于新的设备上的 armv7s 格式。

So what you can do depends on your mac and your iOS device.

所以你能做什么取决于你的 Mac 和你的 iOS 设备。

回答by cube

For the building of Cordova projects the same procedure works, however you will probably get this error:

对于 Cordova 项目的构建,相同的过程有效,但是您可能会收到此错误:

dyld: Library not loaded: /usr/lib/system/libdispatch.dylib
Referenced from: /Developer42/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk/usr/lib/libSystem.dylib Reason: no suitable image found. Did find: /Developer42/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk/usr/lib/system/libdispatch.dylib: unknown required load command 0x80000023 Command /Developer42/usr/bin/ibtool failed with exit code 255

dyld:库未加载:/usr/lib/system/libdispatch.dylib
引用自:/Developer42/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk/usr/lib/libSystem.dylib 原因:没有合适的图像成立。是否找到:/Developer42/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk/usr/lib/system/libdispatch.dylib: unknown required load command 0x80000023 Command /Developer42/usr/bin/ibtool failed with exit code 255

This build fail happens because of /Classes/MainViewController.xibwhich is not compatible with iOS 6.... i think ;)

这个构建失败的发生是因为/Classes/MainViewController.xib它与 iOS 6 不兼容......我认为 ;)

The workaround:

解决方法:

Select your projects target and expand the Supporting Files folder. Inside this folder, click on any file OTHER THANMainViewController.xib. You need to expose the File Inspector. After you expose the File Inspector, select the file MainViewController.xib. At this point xcode will try to crash, don't let it!... just keep pressing Continuein the crash prompt until the File Inspectors settings changes to reflect the .xib file. You should keep pressing Continueuntil you get past the crash prompts such that you can make edits to the File Inspector. In the File Inpsector, under Target Membershipunselect the target.

选择您的项目目标并展开 Supporting Files 文件夹。此文件夹中,点击任何文件以外的其他MainViewController.xib。您需要公开文件检查器。公开文件检查器后,选择文件MainViewController.xib. 此时 xcode 将尝试崩溃,不要让它崩溃!...只需在崩溃提示中继续按继续,直到文件检查器设置更改以反映 .xib 文件。您应该一直按继续直到您通过崩溃提示,以便您可以对文件检查器进行编辑。在文件检查器中,在目标成员资格下取消选择目标。

enter image description here

在此处输入图片说明

Close xcode, reopen and all should be golden!!

关闭 xcode,重新打开,一切都应该是金色的!!

Avoid selecting MainViewController.xibin the future as it will crash your session.

避免MainViewController.xib在将来选择,因为它会使您的会话崩溃。

回答by KYT

I just tried to import the iOS 6 SDK into Xcode 4.2 for Snow Leopard, but when I tried to build one of my old projects, I got the same errors that iOSGuru mentioned. The troublemaker seems to be the iOS 6 simulator. Once I removed the iOS 6 simulator, my old project built normally using "Latest iOS(iOS 6.0)" selected as the Base SDK. That means I can't test on the iOS 6 simulator, but I'm testing on my real device running iOS 6 so I don't think that's such a big deal.

我只是尝试将 iOS 6 SDK 导入 Snow Leopard 的 Xcode 4.2,但是当我尝试构建我的一个旧项目时,我遇到了与 iOSGuru 提到的相同的错误。麻烦制造者似乎是 iOS 6 模拟器。一旦我删除了 iOS 6 模拟器,我的旧项目通常使用“最新的 iOS(iOS 6.0)”作为基础 SDK 构建。这意味着我无法在 iOS 6 模拟器上进行测试,但我正在运行 iOS 6 的真实设备上进行测试,所以我认为这没什么大不了的。

I haven't tried to build anything using iOS 6 features yet, so there's a chance something might still break there, but omitting the iOS 6 simulator seems to let me build with the iOS 6 SDK.

我还没有尝试使用 iOS 6 功能构建任何东西,所以有可能仍然会出现问题,但是省略 iOS 6 模拟器似乎让我可以使用 iOS 6 SDK 进行构建。