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

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

============================================================
博文原创,转载请声明出处
蓝岩--移动互联网老兵
============================================================

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

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

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


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

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

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

第一种:

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

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


第二种:

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

第三种:

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


第四种:

cd ~/Library/Developer/Xcode/DerivedData

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

ls
rm -fr *
然后重启xocde