1

I need to enable a test whenever the system running the test is not an m1 mac.

Struggling to find a way to identify when the device is an m1

  • Does this answer your question? [How do I detect apple silicon (M1) vs. intel in java?](https://stackoverflow.com/questions/74315665/how-do-i-detect-apple-silicon-m1-vs-intel-in-java) – Joshua Goldberg Jun 05 '23 at 15:12

1 Answers1

2

In Java you can get informations about the system running the JVM using the following:

 //Operating system name
 System.out.println("Your OS name -> " + System.getProperty("os.name"));

 //Operating system version
 System.out.println("Your OS version -> " + System.getProperty("os.version"));

 //Operating system architecture
 System.out.println("Your OS Architecture -> " + System.getProperty("os.arch"));

So you should build your logics around the last method, the returned values are Strings.

On your M1 Mac you should get an output like this:

Your OS Architecture -> aarch64