139

我还有雪豹。我有用于 iOS 开发的 Xcode 4.2。今天早上我将我的 iPhone 和 iPad 升级到了 iOS 5.1。

但是 Xcode 4.2 没有检测到我的设备进行测试。我在 Apple 的开发人员网站上找不到 Xcode 4.2 的 iOS 5.1 SDK 映像。

我现在不想升级到 Lion 以获得 XCode 4.3。

我现在可以使用 Xcode 4.2(在 Snow Leopard 上)进行 iOS 开发吗?

4

15 回答 15

213

要让Snow Leopard 上的Xcode 4.2在运行 iOS 5.1 的设备上运行代码,您可以执行以下操作:

  1. 如果您有另一台 Mac 运行 Lion 和 Xcode 4.3.1,您可以从以下位置复制文件:

    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/5.1 (9B176)

  2. 将复制的文件放在 Snow Leopard Mac 上的相同位置:可能

    /Developer/Platforms/iPhoneOS.platform/DeviceSupport

  3. 同样复制此目录中的 iOS 5.1 SDK 文件:

    /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk

  4. 还将“version.plist”从 iPhoneOS.platform 文件夹中的 Lion 机器复制到 Snow Leopard 机器。

  5. 在 Snow Leopard 机器上重新启动 Xcode 并重新连接设备,看起来很开心。

如果您无法访问装有 Lion 和 Xcode 4.3.1 的机器:

  1. 您可以在此处4.3.1 DMGApple下载文件:Apple Developers 下载

  2. 挂载 DMG,在 Xcode 图标上显示包内容并向下钻取

    /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport

  3. 请按照上述步骤操作。

您可能会发现在终端窗口中使用 Apple 的专有ditto方法 ( ) 来复制文件夹更方便。sudo ditto src dest

注意,这个 hack 也适用于最新的 iOS 6 SDK。

于 2012-03-08T16:33:33.407 回答
14

你必须得到 Lion,iOS 5.1 SDK 仅适用于 Xcode 4.3.1,它仅适用于 Lion。

...如果您已经将 Xcode 更新到 5.1,那么您的 Xcode 将无法构建到您的设备上,因为它不在 Xcode 批准的 SDK 版本上

于 2012-03-08T06:26:27.487 回答
14

我现在正在做这件事。我有同样的问题。

这里的主要问题是:

1) Apple 从未提供过警告对话框,表明这可能会禁用在 Snow Leopard 下开发的人。

2) 没有简单的方法可以撤消此操作。

3) 这不应该发生在点发布更新上。

我尝试从此处为我的 Gen 4 iPod Touch 安装 5.0.1 以前的 ipsw: 在哪里下载 ipod touch 固件恢复链接 它不会安装。

我已经从这里下载了 Lion Xcode 4.3.1(首先以开发人员身份登录) Lion Xcode 4.3.1

并在此处从开发论坛运行一些脚本:

sudo cp -R /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/
sudo cp -R /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/

sudo cp -R /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/5.1\ \(9B176\) /Developer/Platforms/iPhoneOS.platform/DeviceSupport/
cd /Developer/Platforms/iPhoneOS.platform/DeviceSupport/

sudo rm -f ./Latest

sudo ln -s ./5.1\ \(9B176\) ./Latest

卸载 Lion DMG 并重新启动 Xcode。这让我可以在模拟器中测试 5.1,但每次构建都会因 SIGABRT 或链接错误而破坏每个设备。

我要去苹果商店让他们恢复我的设备。如果我得到更多信息,我会告诉大家。这是一个非常昂贵和非常不愉快的惊喜。

于 2012-03-13T21:28:34.423 回答
8

添加到上面的理查兹解决方案中,我发现如果你复制,从 XCode 4.3.1 dmg ...

编辑:更新为 dmg 中的正确路径

/Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Develope‌​r/SDKs/iPhoneOS5.1.sdk ~~(整个目录树)

/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/

XCode 调试器将正确启动(没有所有错误日志和转储)

ie:
===============================================================================
warning: Unable to read symbols from "dyld" (prefix __dyld_) (not yet mapped into memory).
warning: Unable to read symbols from "SystemConfiguration" (not yet mapped into memory).
warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/5.1 (9B176)/Symbols/System/Library/Frameworks/MessageUI.framework/MessageUI (file not found).
warning: No copy of dyld found locally, reading from memory on remote device.  This may slow down the debug session.
warning: No copy of <No file name> found locally, reading from memory on remote device.  This may slow down the debug session.
warning: No copy of <No file name> found locally, reading from memory on remote device.  This may slow down the debug session.
warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/5.1 (9B176)/Symbols/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration (file not found).
warning: No copy of SystemConfiguration.framework/SystemConfiguration found locally, reading from memory on remote device.  This may slow down the debug session.
warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/5.1 (9B176)/Symbols/System/Library/Frameworks/MessageUI.framework/MessageUI (file not found).
warning: No copy of MessageUI.framework/MessageUI found locally, reading from memory on remote device.  This may slow down the debug session.
warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/5.1 (9B176)/Symbols/System/Library/Frameworks/AudioToolbox.framework/AudioToolbox (file not found).
warning: No copy of AudioToolbox.framework/AudioToolbox found locally, reading from memory on remote device.  This may slow down the debug session.
warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/5.1 (9B176)/Symbols/System/Library/Frameworks/iAd.framework/iAd (file not found).
warning: No copy of iAd.framework/iAd found locally, reading from memory on remote device.  This may slow down the debug session.
warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/5.1 (9B176)/Symbols/System/Library/PrivateFrameworks/SpringBoardServices.framework/SpringBoardServices (file not found).
warning: No copy of SpringBoardServices.framework/SpringBoardServices found locally, reading from memory on remote device.  This may slow down the debug session.
warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/5.1 (9B176)/Symbols/System/Library/PrivateFrameworks/FTClientServices.framework/FTClientServices (file not found).
warning: No copy of FTClientServices.framework/FTClientServices found locally, reading from memory on remote device.  This may slow down the debug session.
===============================================================================
于 2012-03-12T17:59:28.487 回答
7

这里有一个答案,它还提供了模拟器 v 5.1 的副本。无需手动操作。只需打开终端,复制并粘贴提供的命令。

http://www.iphonedevsdk.com/forum/iphone-sdk-development/100229-snow-leopard-sdk-5-1-a.html

于 2012-03-13T11:39:37.500 回答
5

如果您还想将 iphone 模拟器 5.1 添加到您的 xcode 中,请复制

/Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk

整个目录到以下路径=>

/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/

之后您还可以使用 iPhone 模拟器 5.1 来调试您的应用程序。

于 2012-03-24T07:21:24.887 回答
5

您可以在 5.1 或 5.1.1 设备上使用为 5.0 编译的应用程序,方法是编译它们并手动将 .app 文件拖到 iTunes。今天在 10.6.8 和 XCode 4.2 上尝试过。

于 2012-05-14T06:30:49.270 回答
4

在此链接上下载您设备的 iOS 5.0.1 固件:http ://www.iphonefirmware.com/firmwares-download 。

并在 iTunes 上进行手动恢复。

我今天(3 月 8 日)在我的 iPad 2 上完成了它,它有效,Apple 似乎仍然签署了这个 iOS 版本。我想不会很长时间,所以快点做吧。

于 2012-03-08T15:01:30.850 回答
3

在 xcode 4.2 上无法使用 5.1 设备,因为您不想升级,您可以使用管理器,选择您的设备,然后使用恢复功能。您可以谷歌搜索 5.0.1 版本并使用该版本。

(虽然升级到狮子超级便宜)

编辑:似乎这是可能的,向上滚动以获得最高投票的答案。

于 2012-03-08T06:31:41.347 回答
3

我正在使用 Mac OS X 10.6.8 和 Xcode 4.2,并将我的 iPhone 升级到 iOS 5.1。昨天我需要在设备上快速获得一个测试版本,但没有时间安装 Lion 和 Xcode 4.3。

我一直在使用 TestFlight (www.testflightapp.com) 进行 beta 测试。我从 Xcode 4.2 创建了一个 .ipa 存档,并且能够通过 TestFlight 将它安装在我的 iOS 5.1 升级 iPhone 上。

我知道这不是一个理想的解决方案,但它昨天帮助我摆脱了困境,而无需求助于黑客。

ps 我不以任何方式隶属于 TestFlight。

于 2012-03-16T05:37:55.973 回答
2

Xcode 4.2 在 developer.apple.com 上似乎不再适用于雪豹用户 :( 也适用于像我这样的注册付费 iOS 开发者......

似乎目前没有合法的方式获得它......

于 2012-07-30T13:13:55.533 回答
2

您也必须添加 Symbols 别名。例如,/Developer/Platforms/iPhoneOS.platform/DeviceSupport/6.0 (10A403)您必须添加指向的 Symbols 别名,/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk以便 xcode 4.2 可以检测到您的 ios6 设备(在 mac mini 1.5 intel core solo with snow leopard 上测试)。干杯

于 2012-10-18T14:26:53.540 回答
1

我认为您可以按照上述帖子中的说明在 Snow Leopard 中测试 ios 5.1 设备。但是升级到 Lion 并使用官方 sdk 版本总是安全的。因为我们无法预测如果我们在我们的机器上执行一些“技巧”来实现它会发生什么问题,并且它可能会在您最不想要的时间发生(比如提交到应用商店时)。:)

于 2012-03-15T17:45:57.110 回答
1

截至 2012 年 3 月 20 日撰写本文时,Apple 不允许人们从 5.0.1 安装以前的 ipsw 文件。如果您将设备升级到 iOS 5.1,就像我使用 gen 4 Touch 所做的那样,那么您要么必须让 iOS 5.1 在 Xcode 4.2 中运行,要么必须将设备恢复到 4.x,或者更换设备。

我把我的触摸带到了 Apple Store,他们把它换了。

如果您为 5.0.1 安装 ipsw,Apple 的服务器将声明您的设备不允许这样做,您将无法恢复。您必须在您的设备上尝试 4.x 或确保 iOS 5.1 SDK 在 Xcode 4.2 中运行。

于 2012-03-20T21:02:25.763 回答
0

我已经找到解决方法了!

我的系统是雪豹10.6.8,我有两套Xcode 3.2.5和4.2,我将iPad 1升级到iOS 5.1后,我启动Xcode 3.2.5,它提示我一个'未知设备'的窗口被发现”,我回答“是”从我的 iPad 下载大量库,几分钟后,我可以在我的 iPad 上调试和运行我的项目!

然后我启动了 Xcode 4.2 并打开了我以前的一个项目,我真的可以在我的 iPad 上调试和运行它!

通过这种方式,您可以使用任一版本的 Xcode 在 Snow Leopard 系统上开发应用程序。

于 2012-03-12T11:54:33.920 回答