Xcode cannot run using the selected device

2019-02-12 14:39发布

I am receiving the following error when I try to run my Xcode iOS project:

Xcode cannot run using the selected device. Choose a destination with a supported architecture in order to run on this device.

I have had this error for a while now. I was able to get around it by using an actual device instead of a simulator, but now that doesn't work either. I haven't changed a single setting in the project since creating it, all that I have changed is the code itself. This has also happened before and the only way I fixed it was to create a new project and start from scratch and now it is happening again from that. I am so frustrated! I have no idea what to do. What info do I need to provide to help diagnose this? I am using the facebook sdk 3.1 if that means anything.

Thanks

10条回答
乱世女痞
2楼-- · 2019-02-12 14:47
  • Clean up your project using Clean, Clean folders, Delete derived data.
  • Delete all schemes from 'manage schemes'. Recreate them, and build using any of them that contains a version of iPhone simulator (the one that worked earlier).

If that doesn't work, try this:

  • Clean up your project using Clean, Clean folders, Delete derived data.
  • Using your favourite editor, try clearing all the profile strings from your project.pbxproj file (the one that you see when you open your xcode project using 'Show Package Contents' command).

See below image - you must delete all lines containing 'Provisioning Profile' till the ; character.

  • Then restart xcode. Select the profile using automatic profile selector and build using an iphone simulator scheme.

enter image description here

查看更多
3楼-- · 2019-02-12 14:49

Please Check the following: -Connect your device with another cable. -Check if the cable is properly connected. This was my problem Thanks

查看更多
萌系小妹纸
4楼-- · 2019-02-12 14:51

Target -> Build Settings -> Build Options set the "Compiler for C/C++/Objective-C" - "Default compiler (Apple LLVM 5.0)" and the issue will be solved

查看更多
看我几分像从前
5楼-- · 2019-02-12 14:56

I had the same problem, and fixed it by opening the info.plist file in Resources and unchecked the target membership so that nothing is checked as target membership.

查看更多
何必那么认真
6楼-- · 2019-02-12 14:58

I solved by rebooting mac (also have rebooted iPad)

查看更多
不美不萌又怎样
7楼-- · 2019-02-12 14:59

In XCode 6 I opened the Devices window (Window/Devices) and noticed my iPhone was not listed there, even though it was plugged in to the mac at that time. I unplugged it and then plugged it right back in while the Devices window was open, and it appeared in the device list and also in the scheme picker.

查看更多
登录 后发表回答