一盖高、關(guān)閉SIP系統(tǒng)完整性保護(hù) (修復(fù)模式環(huán)境)
(一)、查看保護(hù)狀態(tài)仲闽,打開Mac終端輸入命令:csrutil status
關(guān)閉了的是disable脑溢,開啟了的是enabled。默認(rèn)情況下是開啟赖欣。
(二)屑彻、已開啟(狀態(tài)為enabled),需要關(guān)閉
1畏鼓、點(diǎn)擊logo重動(dòng)酱酬,同時(shí)按住鍵盤上面的command+r壶谒,進(jìn)入修復(fù)模式
2云矫、進(jìn)入終端(選擇實(shí)用工具Utilities --> 終端Terminal),
3、終端輸入:csrutil disable汗菜,按return鍵让禀,(有可能要求你輸入管理員密碼)挑社。
4、點(diǎn)擊logo重啟電腦巡揍。
5痛阻、在終端,重查狀態(tài)(csrutil status), 如果為disable腮敌,則關(guān)閉成功阱当。
二、卸載軟件糜工,如iTunes (正常模式環(huán)境)
(一)弊添、手動(dòng)刪除:
1、在終端中輸入命令: sudo -i 進(jìn)入到系統(tǒng)的root目錄
sudo -i
2捌木、繼續(xù)輸入命令油坝,卸載iTunes
rm -rf /Applications/iTunes.app
3、刪除相關(guān)路徑下刨裆,舊的相關(guān)iTunes文件夾
<1>~/Library 路徑下
<2>~/Music 路徑下
(二)澈圈、mac自帶的腳本編輯器(AppleScript), shell命令刪
方式一:會(huì)刪除原來iTunes
set question to display dialog "Delete iTtunes?" buttons {"Yes", "No"} default button 1
set answer to button returned of question
if answer is equal to "Yes" then
do shell script "rm -rf /Applications/iTunes.app" with administrator privileges
display dialog "iTunes was deleted" buttons {"Ok"}
set theDMG to choose file with prompt "Please select iTunes 12.6 dmg file:" of type {"dmg"}
do shell script "hdiutil mount " & quoted form of POSIX path of theDMG
do shell script "pkgutil --expand /Volumes/iTunes/Install\\ iTunes.pkg ~/tmp"
do shell script "sed -i '' 's/18A1/14F2511/g' ~/tmp/Distribution"
do shell script "sed -i '' 's/gt/lt/g' ~/tmp/Distribution"
do shell script "pkgutil --flatten ~/tmp ~/Desktop/iTunes.pkg"
do shell script "hdiutil unmount /Volumes/iTunes/"
do shell script "rm -rf ~/tmp"
end if
if answer is equal to "No" then
display dialog "iTunes was not deleted" buttons {"Ok"}
return
end if
set question to display dialog "Install iTtunes?" buttons {"Yes", "No"} default button 1
set answer to button returned of question
if answer is equal to "Yes" then
do shell script "open ~/Desktop/iTunes.pkg"
return
end if
if answer is equal to "No" then
display dialog "Modified iTunes.pkg saved on desktop" buttons {"Ok"}
return
end if
方式二:不會(huì)刪除iTunes
display dialog "Please select iTunes 12.6 dmg file" buttons {"Ok"}
set theDMG to choose file with prompt "Please select iTunes 12.6 dmg file:" of type {"dmg"}
do shell script "hdiutil mount " & quoted form of POSIX path of theDMG
do shell script "pkgutil --expand /Volumes/iTunes/Install\\ iTunes.pkg ~/tmp"
do shell script "sed -i '' 's/18A1/14F2511/g' ~/tmp/Distribution"
do shell script "sed -i '' 's/gt/lt/g' ~/tmp/Distribution"
do shell script "pkgutil --flatten ~/tmp ~/Desktop/iTunes.pkg"
do shell script "hdiutil unmount /Volumes/iTunes/"
do shell script "rm -rf ~/tmp"
set question to display dialog "Install iTtunes?" buttons {"Yes", "No"} default button 1
set answer to button returned of question
if answer is equal to "Yes" then
do shell script "open ~/Desktop/iTunes.pkg"
return
end if
if answer is equal to "No" then
display dialog "Modified iTunes.pkg saved on desktop" buttons {"Ok"}
return
end if
運(yùn)行時(shí)如果 提示 iTunes Library.itl 錯(cuò)誤,刪掉
終端運(yùn)行命令:
sudo rm ~/Music/iTunes/iTunes\ Library.itl
三、恢復(fù)完整性保護(hù) (修復(fù)模式環(huán)境)
重復(fù)上面一中(二)的步驟帆啃,在終端輸入如下命令:csrutil enable瞬女。成功后會(huì)有成功的提示英文。重啟努潘,進(jìn)入正常模式拆魏。