ios开发答疑录系列​---ios编译正常,但无法运行到真机和模拟器上 ,Choose a destination with a supported architecture

来源:互联网 发布:pl sql developer mac 编辑:程序博客网 时间:2024/06/05 19:50

最近在开发中遇到常见问题:

[cpp] viewplaincopyprint?
  1. Choose a destination with a supported architecture in order to run on this device.  


这是老问题了,以往重启一下xcode等等就可以了,这次死活不行,让我的项目延期了两天了,时好时坏,快疯掉了,今天又遇到,决心彻底解决。

在网上找到说product name和工程名不一致,会有空格,我看着完全一直啊。崩溃,最后检查出来是在名字后面有空格,怎么也看不出来。

下面总结一下遇到上述错误的解决方法:

第一种:

可能你的 valid architectures支持armv7,或者 armv7s,修改一下,如下图:

第二种:

  1. Close the Xcode
  2. Delete the application from device
  3. Restart the device
  4. then re-run the application

第三种:

如果今天所遇到的问题,检查product name是否和工程名一致(这里可以其实可以不一致),重点检查是否有空格或其它非法字符。


第四种:

[cpp] view plaincopyprint?
  1. cd ~/Library/Developer/Xcode/DerivedData  

跳转到这个目录下,清除里面所有缓存的数据:

[cpp] view plaincopyprint?
  1. ls  
  2. rm -fr *  
然后重启xocde


Choose a destination with a supported architecture in order to run on this device

要同时输出一个专业版,一个免费版,这时候需要复制(Duplicate)生成一个新的Target,run 新的taget到真机时出现。
解决方法:不是楼主提到的任何一种情况,是坑爹的左侧栏的Products 的XXX.app 执行文件的名称,与Target的 XXX.app ,XXX-info.plist 的Executable file 不一致。修改成一致即可


Xcode cannot run using the selected device.还有一种错误是build options中 complier for C/C++ 那里的 LLVM选择错误


0 0
原创粉丝点击