Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Senor Cuete

macrumors 6502
Original poster
Nov 9, 2011
432
32
According to the developer documentation all I have to do to build my application for Apple silicon and Intel is click on application in the task bar and select appname>Any Mac (Apple Silicon, Intel). I can't build my app with this selected. I get an error:

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

Please select an available device or choose a simulated device as the destination.

In my Build Settings I have Architectures set to Standard Architectures (Apple Silicon, Intel) - default for XCode 12.3.
My Build Active Architecture Only is set to NO. This is the default for XCode 12.3.

I don't see where I could change the settings to fix this and build an app for both architecture. What's wrong?

Also newer versions of the settings pane have three columns: Resolved, appname and macOS Default. I'm guessing that the third column shows the default setting, which is useful but what's the Resolved column for? Can I get rid of it?
 
Looking for similar posts on the Apple Developer Forums, It looks like you can only do this on an ARM MAC.
 
I mean the error you’re getting is not a build error. It sounds like you’re clicking build and run with a target that’s just a build target. CMD+B to just build and not run; Doesn’t that work just fine for you?
 
You have to archive the project on an Intel Mac to make a binary that runs on both Intel and M1 Macs. Choose Product > Archive to archive the project. After archiving the project, you can export it from the Organizer.
 
No, you CAN'T build it with the project set to build for both and I don't think you can archive it unless it's built.
 
Choose My Mac from the jump bar instead of Any Mac. I built and archived an existing Mac project as a universal binary on an Intel Mac that way.

I tried choosing Any Mac from the jump bar. I was unable to build the project, and I got the same error described in the original post. I was able to archive the project.
 
No, you CAN'T build it with the project set to build for both and I don't think you can archive it unless it's built.
This is evidently false, mate

Screenshot 2020-12-22 at 1.42.57 PM.png


You cannot Build & Run. But you can indeed build it.
 
  • Like
Reactions: martyjmclean
In the build settings for my project the default architecture setting is Standard Architectures (Apple Silicon, Intel) $(ARCHS_STANDARD). When I use the
lipo path/appname.app/Contents/MacOS/appname -archs it returns x86_64 arm64 so it's building a universal binary automatically. I'm wondering what the task bar Any Mac (Apple Silicon, Intel) does.
 
In the build settings for my project the default architecture setting is Standard Architectures (Apple Silicon, Intel) $(ARCHS_STANDARD). When I use the
lipo path/appname.app/Contents/MacOS/appname -archs it returns x86_64 arm64 so it's building a universal binary automatically. I'm wondering what the task bar Any Mac (Apple Silicon, Intel) does.
That builds the Universal binary for releasing. If you build the app with MyMac as your target, it will build for that machine (x86_64 for an Intel Mac and arm64 for an Arm Mac). Xcode on the Arm Macs also allow you to build and run an Intel binary using Rosetta.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.