How to Enter an x86_64 Shell on macOS: A Guide for Apple Silicon Users

Learn how to enter an x86_64 shell on macOS using Rosetta 2. Switch between ARM64 and x86_64 environments, and perform tasks like compiling software with ease.

If you’re the owner of an Apple Silicon Mac, you might find yourself in situations where you need to run software designed for the x86_64 or Intel environment. This could be for compiling and installing the Apple Game Porting Toolkit or simply testing your application in an x86_64 environment. The good news is, macOS offers a seamless way to switch between these environments using a feature called Rosetta 2. In this guide, we’ll walk you through the steps to enter an x86_64 shell on your ARM64 Mac, making it a breeze to switch back and forth as needed.

Checking Rosetta 2 Installation

Before we dive into the Rosetta 2 magic, it’s essential to ensure that Rosetta 2 is installed on your ARM64 Mac. Rosetta 2 is a translation layer that allows you to run x86_64 apps on ARM64 architecture. To check if Rosetta 2 is installed, open your terminal and run the following command:

/usr/sbin/softwareupdate --install-rosetta --agree-to-license

If Rosetta 2 is already installed, you’ll receive a message indicating that no update is available. If it’s not installed, the command will trigger the installation process, and you’ll need to agree to the license terms.

Checking Your Current Environment

With Rosetta 2 confirmed or installed, let’s proceed to check your current environment. Open your terminal and enter the following command:

uname -m

As an ARM64 macOS user, this command will return arm64, confirming that you are currently in the ARM64 environment.

Entering the Rosetta 2 Environment

To switch to the x86_64 environment, you need to use the Rosetta 2 translation layer. In your terminal, type the following command:

arch -x86_64 zsh

This command tells your system to open a new zsh shell using the x86_64 architecture. You’re now operating in an x86_64 environment.

Verifying Your Environment

It’s always a good practice to double-check. Run the following command again in your new shell:

uname -m

This time, it should return x86_64, confirming that you’re indeed in the x86_64 environment.

Switching Back to Your ARM64 Environment

If you need to return to your previous ARM64 environment, it’s a simple process. Just type exit, and you’ll be back in your default environment.

Alternatively, you can re-enter the ARM64 environment with the following command:

arch -arm64 zsh

These quick and easy steps to switch between environments can be a lifesaver for developers, especially when working on projects that require compatibility with both ARM64 and x86_64 systems.

In conclusion, entering an x86_64 shell on your ARM64 Mac is a straightforward process thanks to Rosetta 2. With just a few terminal commands, you can seamlessly transition between environments, enabling you to tackle a wide range of tasks with ease. Whether it’s for compiling software, testing applications, or any other use case, you’re now equipped to navigate both worlds effortlessly.

Thanks for reading and Happy coding!