5

I am using conda a lot and for some packages and environments I need x86_64 architecture. I did this by duplicating my Terminal.app and starting one duplicate with Rosetta (as described here: https://towardsdatascience.com/how-to-install-miniconda-x86-64-apple-m1-side-by-side-on-mac-book-m1-a476936bfaf0). Unfortunately, I can't duplicate my Terminal.app anymore since macOS 13. Does anyone already have a solution for this?

2 Answers 2

5

I have the same problem with react-native, nor even with sudo can duplicate it, but you can use the arch command for that:

arch -arch_name binary args ...

# example with react-native: 
arch -x86_64 npx react-native run-ios --simulator "iPhone 14"

See man arch for more details

4
  • 2
    can I use this arch the restart the terminal with it like executing arch -x86_64 source ~/.zshrc?
    – gernophil
    Oct 26, 2022 at 10:50
  • arch -x86_64 zsh would set it. So if you exec just arch it give you the current architecture running so, before arch -x86_64 zsh would be arm64 and after will be i386
    – madwyatt
    Oct 28, 2022 at 15:58
  • Thanks, this really helps. Would be great, if there would be a solution to create a duplicate still. Or maybe a shortcut, that starts with Rosetta :).
    – gernophil
    Oct 29, 2022 at 8:49
  • I suspect that disabling SIP would allow you to duplicate it. But I also suspect that Software Update will undo it. I made improvements to my "Press and Hold" which were wiped out by the next Software Update. But maybe with SIP disabled, you could make a copy in a location like ~/Desktop that would not be removed by Software Update. I have a persistent copy of my PressAndHold changes but MacOS will only use the standard location.
    – WGroleau
    Mar 6 at 19:30
6

I found the answer on the Apple Developer Forum:

% env /usr/bin/arch -arm64 /bin/zsh --login
% arch
arm64 


% env /usr/bin/arch -x86_64 /bin/zsh --login
% arch
x86_64

I tried this and it’s working as expected.

1
  • Why --login is needed here?
    – a06e
    Aug 1 at 13:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .