How can I run a program or shell script in Rosetta from Terminal? I don't want to run the whole terminal in Rosetta. Just the parts I need.
How can I run a command or script in rosetta from terminal on M1 Mac?
Asked Answered
The arch
command is useful for that purpose
arch -arch_name binary args ...
See man arch
for more details
Example without rosetta:
echo "arch" > build.sh
arch -arm64 /bin/bash ./build.sh
Output:
arm64
(could run this with /bin/bash ./build.sh
directly)
Example with rosetta:
echo "arch" > build.sh
arch -x86_64 /bin/bash ./build.sh
Output:
i386
© 2022 - 2024 — McMap. All rights reserved.