无法使用 iOS 4.3.5 设备在 Xcode 4.1 中构建源代码

发布于 2024-12-06 03:11:41 字数 366 浏览 2 评论 0原文

我一直在 Xcode 4.1 中使用 iOS 4.3.5 的 iPhone 进行开发。没有版本不匹配的问题就很好了。今天,我连接了另一部具有相同版本 iOS (4.3.5) 的 iPhone,但我无法在该设备上构建源代码。主办方窗口说,

“Hee's iPhone”上的 iOS 版本与任何版本都不匹配 支持通过此安装进行开发的 iOS 版本 iOS SDK。请将设备恢复到列出的操作系统版本 如下,或更新至最新版本的 iOS SDK;这是 可以在这里找到。

我知道如果我更新 Xcode 或降级 iPhone 就会解决这个问题。但是,我想知道是否还有其他选择。我真的很想知道为什么有些设备很好但其他设备却不行。

I have been developing in Xcode 4.1 with iphone of iOS 4.3.5. It was fine without a version mismatch problem. Today, I connected another iphone which has the same version of iOS (4.3.5) and I could not build source code on to the device. The organizer window said,

The version of iOS on “Hee’s iPhone” does not match any of the
versions of iOS supported for development with this installation of
the iOS SDK. Please restore the device to a version of the OS listed
below, or update to the latest version of the iOS SDK; which is
available here.

I know it will be solved if I update Xcode or downgrade iPhone. However, I want to know other options if there are any. I really wonder why some devices are fine but others are not.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

围归者 2024-12-13 03:11:41

您可以将适用于 iPhoneOS/iPhoneSimulator 平台的其他 SDK/符号放入其中:

/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/[insert ios version folder here]

我所做

/Developer/Platforms/iPhoneOS.platform/DeviceSupport/[insert ios version folder here]

的就是下载旧的 xcode 和新的 beta xcode,将它们安装到类似 /Developer-3.2.3/ 的位置,然后从以下位置对上面的文件夹进行符号链接/别名/Developer-3.2.3 到 /Developer。

这让我的 4.1 xcode 在 iOS5.0 手机上进行测试!上面的目录路径可能不准确,因为我是用手机写的,但它们与此接近。当我回到我的计算机时,我将确保这些目录是正确的。

对于模拟器版本,它将是:

/Developer/Platforms/iPhoneSimulator.platform/SDK/...

编辑(回到我的计算机):

这是我的开发人员目录的样子:

[ 17:49 root@MacBookPro / ]# ll
drwxrwxr-x+ 44 root      admin      1.5K Sep 20 12:37 Applications
drwxrwxr-x  15 root      admin      510B Sep 20 13:27 Developer
drwxrwxr-x@ 17 root      admin      578B Sep 20 13:12 Developer-3.2.4
drwxr-xr-x@ 10 root      admin      340B Sep 20 13:54 Developer-3.2.5
drwxrwxr-x@ 18 root      admin      612B Sep 20 13:44 Developer-4.2-beta7

[ 17:46 root@MacBookPro /Developer/Platforms/iPhoneOS.platform/Developer/SDKs ]# ll
lrwxr-xr-x  1 root  wheel    75B Sep 20 13:53 iPhoneOS3.2.sdk -> /Developer-3.2.4/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.2.sdk
drwxr-xr-x  8 root  wheel   272B Sep 20 13:26 iPhoneOS4.3.sdk
lrwxr-xr-x  1 root  wheel    79B Sep 21 12:50 iPhoneOS5.0.sdk -> /Developer-4.2-beta7/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk

[ 17:46 root@MacBookPro /Developer/Platforms/iPhoneOS.platform/Developer ]# cd ../../DeviceSupport/
[ 17:46 root@MacBookPro /Developer/Platforms/iPhoneOS.platform/DeviceSupport ]# ll
drwxrwxr-x  5 root      admin   170B Sep 20 13:26 3.0
drwxrwxr-x  5 root      admin   170B Sep 20 13:26 3.1
drwxrwxr-x  5 root      admin   170B Sep 20 13:26 3.1.2
drwxrwxr-x  5 root      admin   170B Sep 20 13:26 3.1.3
drwxrwxr-x  5 root      admin   170B Sep 20 13:26 3.2
drwxrwxr-x  5 root      admin   170B Sep 20 13:26 3.2.1
drwxrwxr-x  5 root      admin   170B Sep 20 13:26 3.2.2
drwxrwxr-x  5 root      admin   170B Sep 20 13:26 4.0
drwxrwxr-x  5 root      admin   170B Sep 20 13:26 4.0.1
drwxrwxr-x  5 root      admin   170B Sep 20 13:26 4.0.2
drwxrwxr-x  5 root      admin   170B Sep 20 13:26 4.1
drwxrwxr-x  5 root      admin   170B Sep 20 13:26 4.2
drwxrwxr-x  5 root      admin   170B Sep 20 13:26 4.3
lrwxr-xr-x  1 root      admin    77B Sep 21 12:54 5.0 (9A5313e) -> /Developer-4.2-beta7/Platforms/iPhoneOS.platform/DeviceSupport/5.0 (9A5313e)/
lrwxr-xr-x  1 root      admin    13B Sep 21 12:54 Latest -> 5.0 (9A5313e)
[ 17:46 root@MacBookPro /Developer/Platforms/iPhoneOS.platform/DeviceSupport ]#

为了做到这一点,您需要安装具有不同 iOS SDK 的不同版本的 Xcode。为了实现上述目的,我只安装了 Xcode 3.2.4、3.2.4、4.1 和 4.2(测试版)。我使用 4.1 作为我的主 /Developer 目录。

将每个 Xcode 安装到单独的位置后,您可以通过以下方式将符号/SDK 目录从非主 Xcode 安装符号链接到主安装路径:

/Developer/Platforms/iPhoneOS.platform/DeviceSupport
[ 17:54 root@MacBookPro /Developer/Platforms/iPhoneOS.platform/DeviceSupport ]# cd /Developer/Platforms/iPhoneOS.platform/DeviceSupport
[ 17:54 root@MacBookPro /Developer/Platforms/iPhoneOS.platform/DeviceSupport ]# ln -sf "/Developer-4.2-beta7/Platforms/iPhoneOS.platform/DeviceSupport/5.0 (9A5313e)/" "5.0 (9A5313e)"
[ 17:54 root@MacBookPro /Developer/Platforms/iPhoneOS.platform/DeviceSupport ]# cd ../Developer/SDKs
[ 17:54 root@MacBookPro /Developer/Platforms/iPhoneOS.platform/DeviceSupport ]# ln -sf "/Developer-3.2.4/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.2.sdk" "iPhoneOS3.2.sdk"
[ 17:54 root@MacBookPro /Developer/Platforms/iPhoneOS.platform/DeviceSupport ]# ln -sf "/Developer-4.2-beta7/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk" "iPhoneOS5.0.sdk"

在主 /Developer/Platforms 中对每个 SDK/Symbol 目录进行符号链接后/iPhoneOS.platform/DeviceSupport/Developer/Platforms/iPhoneOS.platform/Developer/SDKs 目录,打开 Xcode,你应该能够查看您的设备并使用它来测试构建等。


编辑 2(命令解释):

ll 是我为 ls -l 制作的别名 命令:

[ 18:07 root@MacBookPro / ]# alias
cd..='cd ..'
cls='clear'
df='/usr/local/bin/df.nawk'
du='du -L'
l='ls -lsG'
ldir='ls -d */'
ll='ls -lhG'
ls='ls -G'
lsdir='ls -d */'
text='open -a TextWrangler'
v='ls -lhG'
vi='vim'
vu='vim'
vv='du . --max-depth=1 -L | sort -n | cut -f2 | xargs -d "\n" du -sh -L'
xcode='open -a xcode'

ln(符号链接)是创建快捷方式/别名的命令。 (非常基本的)语法是:

 [ 18:07 root@MacBookPro / ]# ln -s [TARGET_PATH] [LINK_NAME]

这是 ln手册页

这是 ls 手册页

You can put additional SDKs/Symbols for the iPhoneOS/iPhoneSimulator platforms inside:

/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/[insert ios version folder here]

and

/Developer/Platforms/iPhoneOS.platform/DeviceSupport/[insert ios version folder here]

What I do is download old xcode and new beta xcode, install them to something like /Developer-3.2.3/, then symlink/alias the folders above from the /Developer-3.2.3 to the /Developer.

This lets my 4.1 xcode test on an iOS5.0 phone! The directory paths above might not be exact as I am writing this from my phone but they areaomething close to that. When I get back to my computer I will make sure those directories are correct.

For the simulator versions it would be:

/Developer/Platforms/iPhoneSimulator.platform/SDK/...

Edit (back at my computer):

Here is what my Developer directories looks like:

[ 17:49 root@MacBookPro / ]# ll
drwxrwxr-x+ 44 root      admin      1.5K Sep 20 12:37 Applications
drwxrwxr-x  15 root      admin      510B Sep 20 13:27 Developer
drwxrwxr-x@ 17 root      admin      578B Sep 20 13:12 Developer-3.2.4
drwxr-xr-x@ 10 root      admin      340B Sep 20 13:54 Developer-3.2.5
drwxrwxr-x@ 18 root      admin      612B Sep 20 13:44 Developer-4.2-beta7

[ 17:46 root@MacBookPro /Developer/Platforms/iPhoneOS.platform/Developer/SDKs ]# ll
lrwxr-xr-x  1 root  wheel    75B Sep 20 13:53 iPhoneOS3.2.sdk -> /Developer-3.2.4/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.2.sdk
drwxr-xr-x  8 root  wheel   272B Sep 20 13:26 iPhoneOS4.3.sdk
lrwxr-xr-x  1 root  wheel    79B Sep 21 12:50 iPhoneOS5.0.sdk -> /Developer-4.2-beta7/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk

[ 17:46 root@MacBookPro /Developer/Platforms/iPhoneOS.platform/Developer ]# cd ../../DeviceSupport/
[ 17:46 root@MacBookPro /Developer/Platforms/iPhoneOS.platform/DeviceSupport ]# ll
drwxrwxr-x  5 root      admin   170B Sep 20 13:26 3.0
drwxrwxr-x  5 root      admin   170B Sep 20 13:26 3.1
drwxrwxr-x  5 root      admin   170B Sep 20 13:26 3.1.2
drwxrwxr-x  5 root      admin   170B Sep 20 13:26 3.1.3
drwxrwxr-x  5 root      admin   170B Sep 20 13:26 3.2
drwxrwxr-x  5 root      admin   170B Sep 20 13:26 3.2.1
drwxrwxr-x  5 root      admin   170B Sep 20 13:26 3.2.2
drwxrwxr-x  5 root      admin   170B Sep 20 13:26 4.0
drwxrwxr-x  5 root      admin   170B Sep 20 13:26 4.0.1
drwxrwxr-x  5 root      admin   170B Sep 20 13:26 4.0.2
drwxrwxr-x  5 root      admin   170B Sep 20 13:26 4.1
drwxrwxr-x  5 root      admin   170B Sep 20 13:26 4.2
drwxrwxr-x  5 root      admin   170B Sep 20 13:26 4.3
lrwxr-xr-x  1 root      admin    77B Sep 21 12:54 5.0 (9A5313e) -> /Developer-4.2-beta7/Platforms/iPhoneOS.platform/DeviceSupport/5.0 (9A5313e)/
lrwxr-xr-x  1 root      admin    13B Sep 21 12:54 Latest -> 5.0 (9A5313e)
[ 17:46 root@MacBookPro /Developer/Platforms/iPhoneOS.platform/DeviceSupport ]#

In order to do this, you need to install the different versions of Xcode that have different iOS SDKs. To achieve the above, I only installed Xcode 3.2.4, 3.2.4, 4.1, and 4.2 (beta). I use 4.1 as my main /Developer directory.

Once each Xcode is installed into seperate locations, this is how you would symlink the Symbols/SDKs directories from a non-primary Xcode install to your main install path:

/Developer/Platforms/iPhoneOS.platform/DeviceSupport
[ 17:54 root@MacBookPro /Developer/Platforms/iPhoneOS.platform/DeviceSupport ]# cd /Developer/Platforms/iPhoneOS.platform/DeviceSupport
[ 17:54 root@MacBookPro /Developer/Platforms/iPhoneOS.platform/DeviceSupport ]# ln -sf "/Developer-4.2-beta7/Platforms/iPhoneOS.platform/DeviceSupport/5.0 (9A5313e)/" "5.0 (9A5313e)"
[ 17:54 root@MacBookPro /Developer/Platforms/iPhoneOS.platform/DeviceSupport ]# cd ../Developer/SDKs
[ 17:54 root@MacBookPro /Developer/Platforms/iPhoneOS.platform/DeviceSupport ]# ln -sf "/Developer-3.2.4/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.2.sdk" "iPhoneOS3.2.sdk"
[ 17:54 root@MacBookPro /Developer/Platforms/iPhoneOS.platform/DeviceSupport ]# ln -sf "/Developer-4.2-beta7/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk" "iPhoneOS5.0.sdk"

After symlinking each SDK/Symbol directory in your main /Developer/Platforms/iPhoneOS.platform/DeviceSupport and /Developer/Platforms/iPhoneOS.platform/Developer/SDKs directories, open up Xcode, and you should be able to see your device and use it to test builds, etc.


Edit 2 (commands explained):

ll is an alias I made for the ls -l command:

[ 18:07 root@MacBookPro / ]# alias
cd..='cd ..'
cls='clear'
df='/usr/local/bin/df.nawk'
du='du -L'
l='ls -lsG'
ldir='ls -d */'
ll='ls -lhG'
ls='ls -G'
lsdir='ls -d */'
text='open -a TextWrangler'
v='ls -lhG'
vi='vim'
vu='vim'
vv='du . --max-depth=1 -L | sort -n | cut -f2 | xargs -d "\n" du -sh -L'
xcode='open -a xcode'

ln (symlink) is a command to create a shortcut/alias. The (very basic) syntax is:

 [ 18:07 root@MacBookPro / ]# ln -s [TARGET_PATH] [LINK_NAME]

Here is the ln man page

Here is the ls man page

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文