Xcode 13 on Apple silicon not running app with error A build only device cannot be used to run this target.

On xcode 13, I have macos project that runs fine on intel machine. On apple silicon (M1 Plus) I get the error "A build only device cannot be used to run this target.", when I try to run from Xcode. This seems to be an ios error. All Google suggested fixes involve picking a new device which is an ios fix. Right?

Bulids fine and Archive app runs fine.

I get the error for both intel and Arm64 architectures. I tried building for Target deployment target device families and Deployment as: macos 12.0 sdk

any suggestions?

I must have changed something in the app parameters. I recopied the project directory over from the Intel machine and It runs!

I just tried to run the app again without any changes to the app's parameters or code and I now get the same error as before: "A build only device cannot be used to run this target." Any suggestions now?

Whenever I hit this problem it’s because I’ve accidentally set the destination popup to a build-only device rather than my local Mac. In the screen shot below, note the difference by My Mac, which I can run on, and Any Mac, which is in the Build group, which is build-only.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I've got the same error. macOS App. and I've tried to build and run on Apple Silicon.

I don't see "My Mac" as an option - only "Any Mac (Intel)"... which of course this mac is an M2.

the build architectures include Apple Silicon.

There must be some setting I have missed. Oh... BTW, I have created a new app from scratch (i.e. built in default) and it builds and runs successfully. So it must be something misconfigured my legacy app.

Posting this again so I can include the image.

I think I've found it. Quite possibly my project includes some legacy code or otherwise... i.e. Intel based. I'll have to look into that. under the PRODUCT menu, go down to DESTINATION. I had to change the Destination Architectures to Show Both. After doing this "My Mac (Rosetta)" was then showing back in Product --> Destination from the dropdown menu.

I’m glad to hear you’re making progress here.

Quite possibly my project includes some legacy code or otherwise... i.e. Intel based.

A common cause of such problems is legacy build settings. One of my colleagues wrote TN3117 Resolving architecture build errors on Apple silicon that explains how to fix such issues.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Xcode 13 on Apple silicon not running app with error A build only device cannot be used to run this target.
 
 
Q