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.
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:
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.
- I right-clicked on my .xcodeproj file and chose "Show Package Contents"
- I then opened "project.pbxproj"
- I copied all the text from it to another file, deleted all the text from it and saved
- This "crashed" my XCode Project that I had accidentally left open in XCode.
- I closed my project, then pasted the original contents of "project.pbxproj" back into "project.pbxproj"
- I saved "project.pbxproj" and closed it
- 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
iOS - Push Viewcontroller from Code and Storyboard
How to Draw a Single Point Line in iOS
Wrap Items in a Horizontal Uistackview on Multiple Lines
Xcode Version 6.1 (6A1030) - Apple MACh O-Linker Error - Building
How to Keep Uiswitch State When Changing Viewcontrollers
Searchdisplaycontroller Deprecated in iOS 8
Swift Force-Unwrapping Exception Not Propagated
How to Disable the Back Navigation Menu in iOS 14+
Replace Occurrences of Nsnull in Nested Nsdictionary
Will iOS Region Monitoring Call Didenterregion on My App If My App Is in a Terminated State
Aes/Cbc/Pkcs5Padding in iOS Objective C Result Differs from Android
Local and Push Notifications in iOS Version Compatible
Xcode Error on Simulator: Mgisdeviceoneoftype Is Not Supported on This Platform
Set Rootviewcontroller of Uinavigationcontroller by Method Other Than Initwithrootviewcontroller
Show Current Location and Update Location in Mkmapview in Swift
iOS 13 Uibarbuttonitem Not Clickable and Overlapping Uinavigationbars When Using Uisearchcontroller