xcode4.5 各种不能运行在真机上

时间:2021-07-03 05:44:55
自从xocde升级到4.5又换了台新mac之后,xcode就一直不能运行在真机上,在网上搜索了2天,终于全部解决了。
用两部iphone4测试,一部是ios5另外一部是ios6,一开始,两部机器都运行不了xcode,一直提示的错误是:“Choose a destination with a supported architecture in order to run on this device.” 这么不着边际的错误,我上网去搜索,发现大部分人说的是,build setting里面的product name没有设置正确,可是我的name设置的很正确啊,最后无意间看到一位仁兄的话发现我的错误正是在这里:ios5的设备不支持armv7s,所以必须将Architectures设置为armv6,但是他最后说了一句,仅仅需要改动valid architectures就行,不要改动architectures,否则容易引起真机不运行, xcode4.5 各种不能运行在真机上,这就是我的错误所在,我吧architectures也给改成了armv6了。记得,architectures就保持原来的状态:$(ARCHS_STANDARD_32_BIT)。
至此为止,我的ios5可以运行了,但是当我拔下ios5,运行ios6的时候,出现了一个更令我郁闷的问题:"
Could not launch XXX.app No such file or directory (/Users/Mylaptop/Library/Developer/Xcode/DerivedData/MyApp-bldddwgazooytmdzypejnvzvetyy a/Build/Products/Debug-iphoneos/MyApps.app/MyApp)."关键是,我去查找这个文件,此文件是存在的,网上也有人说了解决办法,对我仍然不管用,我拿来分享一下,也许对某些人的情况管用:
  1. Disconnect your device
  2. Delete the app from your device
  3. Quit Xcode (Don't just simply close the window, quit it)
  4. Delete derived data folder rm -fr ~/Library/Developer/Xcode/DerivedData (console)
  5. Start Xcode,connect device & run the project
(取自于:http://*.com/questions/9987192/xcode-will-run-app-on-simulator-but-not-on-device)
但是此方法经我的实验是不管用的,我最后在这里发现解决办法,it worked for me:

Try deleting "Required device capabilities" in the -Info.plist file.

You can't require armv7 on a 3G, and you can't require armv6 on any newer device, so just delete this attribute entirely.

(取自于:http://*.com/questions/11456312/xcode-suddenly-stopped-running-project-on-hardware-could-not-launch-xxx-app)

纠结了我两天的真机问题解决了,继续我的代码研究xcode4.5 各种不能运行在真机上,我恨ios6,但是爱xcode4.5.