Xcode Cannot Run on the Selected Destination

Xcode cannot run using the selected device

  • 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.

Sample Image

Xcode 4.6.2 error: cannot run on the selected destination

Well here's my new fix: I had (for some reason) changed the highlighted line below:

info.plist

I had changed the ${EXECUTABLE_NAME} to something else. Changing it back did not fix the issue immediately: I had to first click the + to add a new row then delete the new row.

My app runs fine now


OLD FIX:

OK, so yes, it's true, there are other questions like this one. They helped me figure out a different (and stranger) solution.

  1. I right-clicked on my .xcodeproj file and chose "Show Package Contents"
  2. I then opened "project.pbxproj"
  3. I copied all the text from it to another file, deleted all the text from it and saved
  4. This "crashed" my XCode Project that I had accidentally left open in XCode.
  5. I closed my project, then pasted the original contents of "project.pbxproj" back into "project.pbxproj"
  6. I saved "project.pbxproj" and closed it
  7. After opening my XCode Project again, I was able to run it on my device!

To me, it doesn't make sense why this worked because I didn't modify an files... But it did, so hurrah!

PS
Back up your project beforehand, just in case.

EDIT: Well mine has stopped working again and I can't use the above method to fix it...

Xcode can not run the project on selected device

I think that if the project finds some cache memory problem then after restarting the system it some times start working fine or in case of same project with different destination with some minute changes you are running then it some times hanged in the device or simulator for that we have to need to switch off the device and restart again then after it start working fine. And if the project code is in iOS 5.0 and the IPod/IPhone device os is 6.0 then it does not show in the device section for running. For that first you have to run the device to the xcode with ios 6.0 and then it start working fine . But here, you have to notice that for each and every time after switch off you have to run the device first with xcode 6.0. But in your case some build target problem which is not clear to me . So , if you provide the details of bug then it will be easy for understand.



Related Topics



Leave a reply



Submit