2017.12.7 10:09 更新:該文中提到的影響開(kāi)發(fā)的問(wèn)題娄涩,現(xiàn)在已不存在。除特殊情況外,不建議關(guān)閉該功能燎斩。
- Cocoapods使用這個(gè)命令安裝
sudo gem install -n /usr/local/bin cocoapods
原因是原來(lái)使用的/usr/bin
這個(gè)目錄被rootless保護(hù)了杯活,那個(gè)-n
參數(shù)作用是把二進(jìn)制文件安裝到指定目錄匆帚,參考stackoverflow解決Cocoapods無(wú)法安裝 注意stackoverflow中提到的使用這個(gè)參數(shù)「rootless=0」就不要用了,該方法apple官方已經(jīng)封了旁钧,要停用rootless就用我下述的方法(也是官方推薦方法) - ......暫時(shí)就這些吸重,有問(wèn)題在更新,或者留言給我你的問(wèn)題均践,我看看能不能解決
注意:SIP功能是Apple在OSX上推出的系統(tǒng)完整性保護(hù)功能晤锹,對(duì)于普通MAC用戶來(lái)說(shuō)是一項(xiàng)安全保護(hù)功能,如果不了解他的作用請(qǐng)不要隨意關(guān)閉彤委,對(duì)于開(kāi)發(fā)者來(lái)說(shuō)鞭铆,因?yàn)闀?huì)使用到很多的第三方輔助工具(例如:Cocoapods、Homebrew)焦影,而這些工具可能會(huì)修改系統(tǒng)目錄车遂,在這些工具未推出適應(yīng)OSX 10.11的版本時(shí),有必要臨時(shí)關(guān)閉SIP以確保開(kāi)發(fā)工具的使用斯辰。
建議:普通用戶隨意舶担,開(kāi)發(fā)者目前請(qǐng)謹(jǐn)慎升級(jí),如果你已經(jīng)升級(jí)彬呻,相信你可能需要惡心一陣了衣陶,因?yàn)橛行┕ぞ邲](méi)有更新不能正常使用或部分功能失效,甚至在關(guān)閉SIP后也有點(diǎn)問(wèn)題闸氮,當(dāng)然你只要耐心等待軟件更新和網(wǎng)友的智慧或是自己動(dòng)手豐衣足食剪况,很多問(wèn)題還是可以解決的。
1.進(jìn)入RecoveryHD
開(kāi)機(jī)按住Option
鍵在出現(xiàn)的啟動(dòng)選擇菜單中選擇RecoveryHD
進(jìn)入恢復(fù)模式
2.使用csrutil命令
打開(kāi)終端Terminal蒲跨,鍵入csrutil
可以顯示該命令的使用方法
usage: csrutil <command>
Modify the System Integrity Protection configuration. All configuration changes apply to the entire machine.
Available commands:
clear
Clear the existing configuration. Only available in Recovery OS.
disable
Disable the protection on the machine. Only available in Recovery OS.
enable
Enable the protection on the machine. Only available in Recovery OS.
status
Display the current configuration.
netboot
add <address>
Insert a new IPv4 address in the list of allowed NetBoot sources.
list
Print the list of allowed NetBoot sources.
remove <address>
Remove an IPv4 address from the list of allowed NetBoot sources.
可以看到在正常系統(tǒng)模式下中僅可以用status命令查詢SIP狀態(tài)
3.常用參數(shù)
- clear:清除配置設(shè)置译断,等同于完全開(kāi)啟SIP(
僅在恢復(fù)模式下有效
) - disable:關(guān)閉SIP(
僅在恢復(fù)模式下有效
) - enable:開(kāi)啟SIP(
僅在恢復(fù)模式下有效
) - status:查詢SIP狀態(tài)
4.常用參數(shù)進(jìn)階
除了可以完全關(guān)閉/打開(kāi),還可以進(jìn)行單項(xiàng)和多項(xiàng)組合關(guān)閉相關(guān)功能或悲,用法如下
csrutil enable [--without kext|fs|debug|dtrace|nvram] [--no-internal]
單項(xiàng)使用:
sudo csrutil enable –without fs:Filesystem Protections disable
sudo csrutil enable –without kext:Kext Signing disable
sudo csrutil enable –without debug:Debugging Restrictions disable
sudo csrutil enable –without nvram:NVRAM Protections disable
sudo csrutil enable –without dtrace:DTrace Restrictions disable
組合使用:
sudo csrutil enable –without kext –without fs:Filesystem Protections and Kext Signing are disabled
更多詳情請(qǐng)參考:
可丁丹尼@一路往前走2.0
csrutil updated in DP7
SIP/Rootless Internal in El Capitan