I have to implement different logic between normal(?) mac cpu and m1 cpu.
But I don't know how can I detect that.
Under the assumption that M1 is the only arm64 chip that runs OSX then you can use:
var isArm = System.Runtime.InteropServices.RuntimeInformation.ProcessArchitecture == Architecture.Arm64;
var isOSX = System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
var isM1 = isArm && isOSX;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With