macOS:M1 上安装 Rosetta 2

Posted afatgoat

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了macOS:M1 上安装 Rosetta 2相关的知识,希望对你有一定的参考价值。

下面是一个简单的脚本,用于安装在 M1 的 macOS 11或更高版本上安装 Rosetta 2。

#!/bin/sh

ver=$(/usr/bin/sw_vers -productVersion)
mainVer=$ver:0:2
intel=$(/usr/sbin/system_profilersystem_profiler SPHardwareDataType | grep Intel)

if [[ $ver -ge 11 ]]; then
	if [ -n "$intel" ]; then
		softwareupdate --install-rosetta --agree-to-license
	else
		echo "Intel CPU doesn't need Rosetta 2."
	fi	
else
	echo "macOS system version is too low ($ver < 11)"
fi

 

以上是关于macOS:M1 上安装 Rosetta 2的主要内容,如果未能解决你的问题,请参考以下文章