security unlock-keychain -p mac_password /Users/lizeyang/Library/Keychains/login.keychain security list-keychains -s /Users/lizeyang/Library/Keychains/login.keychain security import p12_filepath -k /Users/lizeyang/Library/Keychains/login.keychain -P p12_password -T /usr/bin/codesign注:將mac_password替換成你的機器登錄密碼,lizeyang替換為登錄賬號(下面兩個命令,也需要替換),p12_filepath替換成p12文件路徑,p12_password替換成p12密碼,如果為空,則替換為“”
security find-identity -p codesigning /Users/lizeyang/Library/Keychains/login.keychain
security delete-certificate -Z SHA1
注:將SHA1替換成證書的sha1,sha1的值,可以通過find-identity命令看到,它是一個40位的隨即字符串
關於security命令的更多介紹,請查閱蘋果官方文檔