A build only device cannot be used to run this target

后端 未结 21 2353
情深已故
情深已故 2020-12-25 09:25

I get this error when I trying to test an app.

A build only device cannot be used to run this target.

No supported iOS devices are available

相关标签:
21条回答
  • 2020-12-25 09:42

    With XCode 8.3.2 I had this error message after I tried to run the app on a locked device. I unlocked and reattached as requested but the "A build only device cannot be used to run this target." message appeared.

    I simply changed the target to a simulator and changed it back - it resolved my issue.

    0 讨论(0)
  • 2020-12-25 09:44

    Maybe the Scheme has switched to a Generic device. Try to choose again the connected device from the Scheme menu:

    0 讨论(0)
  • 2020-12-25 09:44

    I encountered the same error message. Here's what I have experienced and did so far;

    Step 1: Check your target.

    My current target is IOS 13.2. From here, you will not see what versions you currently have on your machine.

    Step 2: Check available versions on your local

    • Click the Generic IOS Device

    • This will display a dropdown menu that contains a Download Simulators... selection
    • In case the Download Simulators... selection is not visible, you need to lower down your target. In my case, from 13.2 I made it 13.0 (This depends on your current XCode) then repeat the Step 2 again
    • From here, I can now see the Download Simulators... selection
    • Select it

    • You will now see what are the available versions you have
    • From here, you may choose to download or just use the version you have (The one that is selected)

    Step 3: Change your IOS target accordingly

    • Now that you already know what are the available versions of the simulator you have locally, you can now change the IOS target.
    • In my case I choose to use IOS 11 (Just for this sample)
    • Then I change the target

    • Again click the Generic IOS Device

    • From here, you can now select any simulator under that IOS

    I am not an expert, I just wanted to share my experience and I hope this can help someone.

    0 讨论(0)
  • 2020-12-25 09:45

    In my case this happened, when I selected a Generic iOS device and tried to "build" in order to publish it to the AppStore.
    But I should have selected Product -> Archive instead

    0 讨论(0)
  • 2020-12-25 09:45

    Well if you want to get the list of available destinations then call xcodebuild and pass in the command line option -showdestinations, and it will print valid options for you to pick from:

    xcodebuild -showdestinations -workspace Register.xcworkspace -scheme ThatTestTarget
    
    0 讨论(0)
  • 2020-12-25 09:46
    1. I applied for a new AppleID and added it to the "Xcode->Preferences->Account" to solve this problem. (Xcode 7.3)
    2. At the same time I deleted original AppleID in the "Xcode->Preferences->Account",because it was no longer a paid account and couldn't add new devices.
    0 讨论(0)
提交回复
热议问题