Runtime Analysis of native M1 versus Rosetta

I am trying to figure out how I can determine during runtime whether my app is running natively on the M1 processor or is using Rosetta translation. I have a universal app that works well, but seems to be defaulting to Rosetta even though I have not checked the “Run using Rosetta” option.

This doesn’t need to be in the Testers channel.

Like this:

If TargetMacOS Then
  If SystemInformationMBS.isARM Then
    MsgBox "Running ARM version on ARM CPU."
  Elseif SystemInformationMBS.IsTranslated Then
    MsgBox "Running Intel version on ARM CPU."
  Else
    MsgBox "Running Intel version on Intel CPU."
  End If
End If

Thanks Christian!!

Tim,

I got into a bit of trouble for posting something involving a beta release under general a few years back, so I default to Testers whenever it involves a beta. I do agree this also applies to 2020R21, however.

See Detect if running under rosetta - #4 by Mike_D for other methods.

Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.