Does the same code work for both M1 & M2? Also making an universal dmg..

Hi, is there any hardware diffs between M1 & M2, without the performances?

As the title suggests, will i be able to create/test apps for both intel & arm(M1&M2) in my m1 mac with the same code in xcode?

And How can i make an universal dmg without having an intel mac? Also, correct me if i'm wrong: does 'the rosetta swaps' hamper ssd life?

Thanks in advance.

Replies

is there any hardware diffs between M1 & M2

Yes. In any new generation of CPUs there’s always a wide range of hardware differences.

Does the same code work for both M1 & M2?

Yes. Apple’s tools and APIs isolate you from these low-level changes.

How can i make an universal dmg without having an intel mac?

“Universal dmg” isn’t a term we use. Presumably “dmg” refers to a disk image, with the .dmg extension. Disk images themselves don’t contain code, and thus I have to assume that you’re asking about creating a universal app that’s packaged in a disk image.

If so, then yes, you can do this from an Apple silicon Mac. How you do this depends on what tools you’re using. If you’re using Xcode then it creates a universal app by default when you use the Product > Archive workflow.

Once you have a universal app, you can package it in a disk image like you would any other app. See Packaging Mac Software for Distribution for specific advice on that topic.

Share and Enjoy

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