How to make an M1-only (native-only) app?

I moved my Intel-based project to my new M1 machine (Pro Max), and it builds and runs fine, but only as a Intel/Rosetta app.

I read that xCode builds a hardware-specific app for testing and debugging, but the app it's building for me is running as an Intel app (regardless of whether I'm running it under xCode or launching it stand-alone).

Under Architectures, it says: Standard Architectures (Apple Silicon, Intel) - $(ARCHS_STANDARD)

What should I put there to force it to make an M1-only app? (I'm making an app just for my own use, not for distribution.)

It looks like $(ARCHS_STANDARD) evaluates to arm64 x86_64, so setting the architecture to just arm64 should build for Apple Silicon only.

I made that change. It still builds, but when I try to run it, I get the message "A build only device cannot be used to run this target."

At the top, is says this ...

... and the "My Mac" (without Rosetta) option is grayed-out. Does that mean that it thinks my machine is Intel-based?

Can you set the architecture in both the project’s and target’s build settings? When I set the architecture to arm64 in both places, I only get the option to build for ‘My Mac’ and ‘Any Mac (Apple Silicon)’ in Xcode 13.1 (13A1030d)

I found the answer: there was a User-Defined value for VALID_ARCHS which was set to x86_64. I added arm64 to this, and I'm now running my app as Apple Silicon natively.

i get similar issue but the major issue is i have a project ie. IOS Native app which is develop in intel based chip now i am switching to apple silicon but i get some issue

can any one suggest me or share reference how to run or update to silicon base chip ie macBook m2

Setting the Architecture under Build Settings to arm64 works well:

To get valid architectures, in your project folder, run:

xcodebuild -project <Your project name>.xcodeproj -scheme "Your Project Scheme" -showBuildSettings | grep ARCHS

For my project, it prints:

    ARCHS = arm64 x86_64
    ARCHS_STANDARD = arm64 x86_64
    ARCHS_STANDARD_32_64_BIT = arm64 x86_64 i386
    ARCHS_STANDARD_32_BIT = i386
    ARCHS_STANDARD_64_BIT = arm64 x86_64
    ARCHS_STANDARD_INCLUDING_64_BIT = arm64 x86_64
    VALID_ARCHS = arm64 arm64e i386 x86_64

This is where I got arm64 as the value.

What solved it for me (on Xcode 15, not sure if this works on earlier versions) was to set the shown destinations. I'm not really sure why this option exists.

How to make an M1-only (native-only) app?
 
 
Q