我一直在使用iOS 4.3.5的iphone开发Xcode 4.1。没有版本不匹配问题就没问题了。今天,我连接了另一部具有相同版本iOS(4.3.5)的iphone,我无法在设备上构建源代码。组织者窗口说,
“Hee的iPhone”上的iOS版本与任何版本都不匹配 使用此安装支持开发的iOS版本 iOS SDK。请将设备恢复为所列操作系统的版本 下面,或更新到最新版本的iOS SDK;是的 在这里。
我知道如果我更新Xcode或降级iPhone,它将会解决。但是,如果有的话,我想知道其他选项。我真的很想知道为什么有些设备很好但有些设备没有。
答案 0 :(得分:1)
您可以为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。
这可以让我在iOS5.0手机上进行4.1 xcode测试!上面的目录路径可能不完全正确,因为我正在通过手机写这个,但是它们与之相近。当我回到我的电脑时,我会确保这些目录是正确的。
对于模拟器版本,它将是:
/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(beta)。我使用4.1作为我的主/Developer
目录。
将每个Xcode安装到单独的位置后,就可以将符号/ SDKs目录从非主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/iPhoneOS.platform/DeviceSupport
和/Developer/Platforms/iPhoneOS.platform/Developer/SDKs
目录中的每个SDK / Symbol目录进行符号链接后,打开Xcode,您应该能够看到您的设备并使用它来测试构建等。
编辑2(解释的命令):
ll
是我为alias
命令制作的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]