A build only device cannot be used to run this target

后端 未结 21 2355
情深已故
情深已故 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:48

    I fixed this issue by going to the project settings, and under my 'Targets' section I had to set the Tests target to the correct team.

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

    i meet a problem that only "Generic iOS Device" can be choosed. and when i run ,it says "A build only device cannot be used to run this target.No supported iOS devices are available. Connect a device to run your application or choose a simulated device as the destination "

    and my solution for the problem is selecting Build Settings ---> Deployment ----->IOS Deployment Target---->choose a lower version like 8.0,

    and i found the simulator come out and can be chosen.

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

    If you are using cordova/Ionic Go to Products -> Destination-> Choose the target and re run

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

    add -destination 'platform=iOS Simulator,name=iPhone 6,OS=9.3' to your xcodebuild

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

    For what it's worth, if you get the error A build only device cannot be used to run this target, and see in the Issue navigator this text:

    ProjectName
    Target Integrity:
    iOS Deployment Target 'XX.X' is
    newer than SDK 'iOS YY.Y' in
    target ProjectName

    then the issue is that the project requires an iOS SDK that is newer than what your version of Xcode has available. You'll find this issue in, say, projects taking advantage of new/beta iOS SDK functionalities such as ARKit.

    The solution is to download the newest beta version of Xcode, which should have support for the non-public released iOS SDK that the application requires. If you have the latest Xcode, try finding the target iOS in Preferences -> Components -> Simulators.

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

    Modification to @Quver's answer. With latest Xcode version(8.3), the parameters to destination command should be given in double quotes. Single quotes didn't work for me

    add -destination "platform=iOS Simulator,name=iPhone 7" to your xcodebuild

    I haven't mentioned OS version in above command because when a newer version of iOS is released, this command will through error telling that this device is not found. So it is better not to give OS version

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