Xcode Cannot Run on the Selected Destination

后端 未结 30 2274
梦如初夏
梦如初夏 2020-12-02 18:22

I was running my app this morning and now all of a sudden I am getting the following error when I try to run on the iPhone 5.1 simulator.

Cannot run on the selected

相关标签:
30条回答
  • 2020-12-02 18:56

    You might follow the steps:

    • Quit Xcode and iPhone simulator
    • Unplug your devices
    • Goto /Users/your_usr_name/Library/Developer/Xcode/DerivedData/
    • Delete all data under this folder
    • Start Xcode again and run your project

    Hope this will solve your problem.

    0 讨论(0)
  • 2020-12-02 18:56

    You have to find in the "Activity Monitor" the Xcode process and kill it! I just did it to solve a similar problem!

    0 讨论(0)
  • 2020-12-02 18:58

    Look at both the project and target build settings, at that Architectures, and see if anything has changed. When first going from Xcode 3 to 4, it use to wreck havoc in a hidden way, giving the same error, and in the end you had to add i386 to the "Valid Architectures" line. I just looked at my big project started in Xcode 4.1, and it shows nothing about i386 etc, but I have other newer projects where I get this grayed out thing in that line $(ARCHS_STANDARD_32_BIT).

    EDIT: I took a relook at this with a guru friend. Neither of us can find a linkage to i386 in our projects - Xcode is using some magic. That said, I did get a hit to i386 in a binary plist within the project, which leads me to another suggestion.

    In your build settings, insure that ALL "Architectures" are $(ARCHS_STANDARD_32_BIT).

    If that does not work, we suggest that you look at the compile and ld lines of your build when you select iPhone 5.1 Simulator in the scheme menu - to see if in fact its i386,

    Another idea - move all your schemes and user settings to a save folder somewhere (with the project closed), then reopen and recreate a scheme. Now try again. There is no reference to i386 in any of my project.pbxproj files, so our suspicion is that this is somehow related to the scheme setting for the target device.

    Good luck!

    0 讨论(0)
  • 2020-12-02 18:59

    I've solved changing in both the project and target build settings the key "Build variants" from "armv7" to "normal"

    0 讨论(0)
  • 2020-12-02 19:00

    I tried everything metioned here. Nothing worked. It seems that I somehow imported the Info.plist twice. To fix it I selected the project and pressed the "Validate Settings" button. Afterwards it works for me.

    0 讨论(0)
  • 2020-12-02 19:01

    I was running into this same problem. In my case, it appeared to be that I had changed the Bundle Name for my multi-target project instead of the Product Name. Once I corrected that by editing the Project Name correctly and then setting the Bundle Name back to ${PRODUCT_NAME} it would run in the simulator again.

    This may not be the answer for everyone, but it does appear that product naming errors (special characters, spaces, etc.) are a contributor for many, and that's what drove me to review the renaming that I had one.

    0 讨论(0)
提交回复
热议问题