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"