macOS 13+ ARM版电脑零接触部署问题解决方法

2023-04-23 17:27:01 浏览数 (2)

ARM版本电脑部署 macOS 13 问题:

  1. 因为ARM版(M1/M2等) 苹果在macOS 13 修改大多数策略和配置文件导致在使用URL注册的MDM可以被用户删除;
  2. 因为ARM版直接在第一次开机部署的脚本无法自动连接WiFi,且无法安装Rosetta,会导致其他依赖Rosetta的软件无法安装。

最佳实践:

解决macOS 13 URL注册可以被用户删除的问题

针对第一个问题,且电脑来源无法直接ASM的情况下(例如串货,特殊优惠渠道),只能通过手机版Apple Configurator进行注册来避免。所以MDS部署需要去除掉Skip Setup Assistant勾选,让配置文件联网会下载MDM。

提示:即使是DEP设备如果跳过了Setup Assistant后,通过URL注册的方式,用户依然可以删除MDM。 所以我们必须保留Setup Assistant,之后步骤可以在MDM中设置跳过。

macOS 使用Apple Configurator注册

解决使用MDS 无法安装Intel App的问题

由于MDS部署后,不知道为什么WiFi无法连上,也就导致Intel App无法安装了。 在参考了hexnode的脚本后发现,安装Rosetta依然显示连不上网,于是稍微修改了脚本。 需要注意的是,当同一个Workflow有packages以及script的时候,需要将脚本的顺序修改为”After macOS Install, but before packages install”

代码语言:javascript复制
# Determine WiFi is Connected 
wifi_status=$(ifconfig en0 |grep "status: active")
wifi_network=$(networksetup -getairportnetwork en0 | awk -F': ' '/Current Wi-Fi Network/{print $2}') 
if [ -z "$wifi_status" ]; then 
    echo "WiFi is not Connected. Setting to AppleWiFi..." 
    # Set Wi-Fi 
    networksetup -setairportnetwork en0 AppleWiFi
    sleep 5
else 
    echo "WiFi is already connected to $wifi_network"     
fi



# Determine the architecture of the macOS device 
processorBrand=$(/usr/sbin/sysctl -n machdep.cpu.brand_string) 
if [[ "${processorBrand}" = *"Apple"* ]]; then 
    echo "Apple Processor is present." 
else 
    echo "Apple Processor is not present. Rosetta not required." 
    exit 0 
fi 
 
# Check if Rosetta is installed 
checkRosettaStatus=$(/bin/launchctl list | /usr/bin/grep "com.apple.oahd-root-helper") 
RosettaFolder="/Library/Apple/usr/share/rosetta" 
if [[ -e "${RosettaFolder}" && "${checkRosettaStatus}" != "" ]]; then 
    echo "Rosetta Folder exists and Rosetta Service is running. Exiting..." 
    exit 0 
else 
    echo "Rosetta Folder does not exist or Rosetta service is not running. Installing Rosetta..." 
fi 
 
# Install Rosetta with WIFI check
if [ -z "$wifi_status" ]; then 
    echo "Rosetta - WiFi is not Connected. Setting to AppleWiFi..." 
    # Set Wi-Fi 
    networksetup -setairportnetwork en0 AppleWiFi
    sleep 5
    echo "Starting to Install Rosetta - Setting WiFi Done"
    /usr/sbin/softwareupdate --install-rosetta --agree-to-license
else 
    echo "Rosetta - WiFi is already connected to $wifi_network" 
    echo "Starting to Install Rosetta - Detected WiFi"
    /usr/sbin/softwareupdate --install-rosetta --agree-to-license    
fi

# /usr/sbin/softwareupdate --install-rosetta --agree-to-license 
 
# Check the result of Rosetta install command 
if [[ $? -eq 0 ]]; then 
    echo "Rosetta installed successfully." 
    exit 0 
else 
    echo "Rosetta installation failed." 
    exit 1 

fi 
exit 0 

0 人点赞