本文介绍了无法使用iOS 4.3.5设备在Xcode 4.1中构建源代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我一直在使用iOS 4.3.5的iphone开发Xcode 4.1。没有版本不匹配问题就可以了。今天,我连接了另一部具有相同版本iOS(4.3.5)的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,我知道如果我更新Xcode或降级iPhone,它将会被解决。但是,如果有的话,我想知道其他选项。我真的很想知道为什么有些设备没问题但其他设备没有。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.推荐答案你可以为iPhoneOS / iPhone模拟器添加额外的SDK /符号内部平台:You can put additional SDKs/Symbols for the iPhoneOS/iPhoneSimulator platforms inside:/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/[insert ios version folder here]和/Developer/Platforms/iPhoneOS.platform/DeviceSupport/[insert ios version folder here]我是什么do是下载旧的xcode和新的beta xcode,将它们安装到类似/Developer-3.2.3/的内容,然后将上面的文件夹从/Developer-3.2.3符号链接/别名到/ Developer。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.这可以让我在iOS5.0手机上进行4.1 xcode测试!上面的目录路径可能不完全正确,因为我正在通过手机写这个,但是它们与之相近。当我回到我的电脑时,我会确保这些目录是正确的。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/... 编辑(回到我的电脑): 以下是我的开发者目录的样子: / p>Edit (back at my computer):Here is what my Developer directories looks like:[ 17:49 root@MacBookPro / ]# lldrwxrwxr-x+ 44 root admin 1.5K Sep 20 12:37 Applicationsdrwxrwxr-x 15 root admin 510B Sep 20 13:27 Developerdrwxrwxr-x@ 17 root admin 578B Sep 20 13:12 Developer-3.2.4drwxr-xr-x@ 10 root admin 340B Sep 20 13:54 Developer-3.2.5drwxrwxr-x@ 18 root admin 612B Sep 20 13:44 Developer-4.2-beta7[ 17:46 root@MacBookPro /Developer/Platforms/iPhoneOS.platform/Developer/SDKs ]# lllrwxr-xr-x 1 root wheel 75B Sep 20 13:53 iPhoneOS3.2.sdk -> /Developer-3.2.4/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.2.sdkdrwxr-xr-x 8 root wheel 272B Sep 20 13:26 iPhoneOS4.3.sdklrwxr-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 ]# lldrwxrwxr-x 5 root admin 170B Sep 20 13:26 3.0drwxrwxr-x 5 root admin 170B Sep 20 13:26 3.1drwxrwxr-x 5 root admin 170B Sep 20 13:26 3.1.2drwxrwxr-x 5 root admin 170B Sep 20 13:26 3.1.3drwxrwxr-x 5 root admin 170B Sep 20 13:26 3.2drwxrwxr-x 5 root admin 170B Sep 20 13:26 3.2.1drwxrwxr-x 5 root admin 170B Sep 20 13:26 3.2.2drwxrwxr-x 5 root admin 170B Sep 20 13:26 4.0drwxrwxr-x 5 root admin 170B Sep 20 13:26 4.0.1drwxrwxr-x 5 root admin 170B Sep 20 13:26 4.0.2drwxrwxr-x 5 root admin 170B Sep 20 13:26 4.1drwxrwxr-x 5 root admin 170B Sep 20 13:26 4.2drwxrwxr-x 5 root admin 170B Sep 20 13:26 4.3lrwxr-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 目录。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.将每个Xcode安装到单独的位置后,这是如何您可以将Symbols / SDKs目录从非主要Xcode安装符号链接到主安装路径: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"在符号链接主 /Developer/Platforms/iPhoneOS.platform/DeviceSupport 和 /Developer/Platforms/iPhoneOS.platform/Developer/SDKs 目录,打开Xcode,你应该能够看到你的设备并用它来测试构建等等。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.编辑2(解释的命令):Edit 2 (commands explained): ll 是一个别名我是为 ls -l 命令:ll is an alias I made for the ls -l command:[ 18:07 root@MacBookPro / ]# aliascd..='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 (符号链接)是一个创建快捷方式/别名的命令。 (非常基本的)语法是: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] 这是 ln 手册页 这是 ls 手册页 这篇关于无法使用iOS 4.3.5设备在Xcode 4.1中构建源代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-29 07:17