Created
March 26, 2025 11:10
-
-
Save dongri/c7957002f8a6c186cb5a30e7cb9ad96c to your computer and use it in GitHub Desktop.
reset_mac.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "⚠️ 5秒後にディスクを完全に消去し、macOSを再インストールします。キャンセルするには Ctrl+C を押してください。" | |
sleep 5 | |
# APFSでディスクを消去(ディスク番号は自動検出) | |
DISK_ID=$(diskutil list | grep "Apple SSD" | head -n 1 | awk '{print $NF}') | |
diskutil eraseDisk APFS "Macintosh HD" /dev/$DISK_ID | |
# macOS再インストール(Ventura の例) | |
"/Applications/Install macOS Ventura.app/Contents/Resources/startosinstall" \ | |
--eraseinstall \ | |
--agreetolicense \ | |
--forcequitapps \ | |
--nointeraction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment