x86 Shell

Setup shell shortcuts

You can easily switch to an x86 shell on apple silicon by

arch -x86_64 zsh

Then check the arch

ajay@Ajays-MacBook-Pro ~ % arch -x86_64 zsh
ajay@Ajays-MacBook-Pro ~ % arch
i386

As a shortcut, I can switch between x86 or apple silicon terminal editing .zshrc

alias arm="env /usr/bin/arch -arm64 /bin/zsh --login"
alias intel="env /usr/bin/arch -x86_64 /bin/zsh --login"

Then run arch specifc versions of homebrew or pyenv

alias brew86="/usr/local/bin/brew"
alias pyenv86="arch -x86_64 pyenv"

You may need to resource the shell after changing source ~/.zshrc

Now you can quickly switch shell architectures

ajay@Ajays-MacBook-Pro ~ % arm
ajay@Ajays-MacBook-Pro ~ % /usr/bin/uname -m
arm64
ajay@Ajays-MacBook-Pro ~ % intel
ajay@Ajays-MacBook-Pro ~ % /usr/bin/uname -m
x86_64
ajay@Ajays-MacBook-Pro ~ %