26

I upgraded to xcode 5.0 today. I then pressed play to run my project in the iOS simulator. This initially worked. Then I decided that I wanted to run the profiler. When I did that, I got the message:

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

I looked at a couple past posts on this problem and decided to do a Clean and Build. Now I can no longer run in the profiler or the simulator. I consistently get the message:

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

How can I resolve this?

Here are various settings:

My Deployment Target is 6.1

My Build Settings Architectures looks like:

I have also tried changing the deployment target to 7.0, but that did not work either

JeffB6688
  • 3,782
  • 5
  • 38
  • 58

8 Answers8

77

It appears that the problem is not related to the architecture in the build settings as the error might suggest. Rather, I found that the problem seems to be related to the Build Options Compiler for C/C++/Objective C. I was using a gcc compiler (com.apple.compilers.llvmgcc42) and Xcode 5 has marked this as unsupported.

If I change the compiler to apple's default Apple LLVM 5.0, the project builds and it can now run in the simulator. The downside is that I have a lot of compiler warnings from code related to cocos2D v1.0 source code. But, at least I have a way forward.

JeffB6688
  • 3,782
  • 5
  • 38
  • 58
34

Please follow below step

1>Go to Project Build setting

2>Change compiler for c/c++/objective c as Default compiler(Apple LLVM 5.0) (see in below image)

enter image description here

Chris Alan
  • 1,426
  • 14
  • 14
10

I had to change compiler for Default compiler (Apple LLVM 5.0) at two places:

  1. Build Settings > Build Options > Compiler for C/C++/Objective-C (change to LLVM)
  2. Build Rules > Files *.mc using GCC (change to LLVM)

Hard to find because code compiles even if Build Rules point to an undefined compiler.

rjobidon
  • 3,055
  • 3
  • 30
  • 36
  • 1
    This happened to me when opening an old project after many years (also, schemes where missing). Thanks!! – Nicolas Miari Mar 10 '14 at 08:12
  • I am using Xcode 5.1.1 and I do not see a FILES option under Build Rules. Is there another way to locate this second change? – jsherk Aug 18 '14 at 22:07
7

After inspecting all the build settings for 15 minutes, this worked for me (Xcode 5.0.2):

Quit and restart Xcode

Jason Moore
  • 7,169
  • 1
  • 44
  • 45
6

Check that the Executable File (also known as CFBundleExecutable) in the Info.plist file is set to ${EXECUTABLE_NAME} as opposed to any hardcoded value. This will ensure that even if you change your project name or target name or scheme name, that it still works.

jsherk
  • 6,128
  • 8
  • 51
  • 83
3

This issue often occurs after duplicating targets on older projects.

Set the following in your Info.plist for the target:

Bundle Name = ${PRODUCT_NAME}
Bundle Display Name = ${PRODUCT_NAME}
Executable file = ${EXECUTABLE_NAME}

Build and run with these settings, after a successful build they can be changed to anything you want.

A.Badger
  • 4,279
  • 1
  • 26
  • 18
1

This works for me: "Quit and restart Xcode". I recently updated something and the testing device on Xcode said: 'iDevice' not iPhone or iPod. So I restarted then my iPhone came back to the target list.

azun
  • 391
  • 4
  • 11
0

I had this error when I changed the value of the "Bundle name"-key in the Target Properties. Changing it back to "%{PRODUCT_NAME}" solved the problem for me.

ediheld
  • 233
  • 3
  • 13