echo $(uname) // 输出Darwin 注:Darwin为MacOS的内核
scutil --get ComputerName // 输出计算机名
scutil --get HostName // 输出主机名
chflags hidden ./crash/ // 隐藏当前目录下的crash文件夹
chflags nohidden "/Users/kekec/12.txt" // 取消对/Users/kekec/12.txt文件的隐藏
SetFile -a V "/Users/kekec/docs/" // 隐藏/Users/kekec下的docs目录
SetFile -a v "/Users/kekec/docs/" // 取消对/Users/kekec下的docs目录的隐藏
SetFile -a v "/Users/kekec/12.txt" // 取消对/Users/kekec/12.txt文件的隐藏
// 将/Users/kekec/crash目录中所有文件打包到size为10m、Volume名为MyDmg的/Users/kekec/tmp.dmg中
hdiutil create -srcfolder "/Users/kekec/crash" -volname "MyDmg" -fs HFS+ -fsargs "-c c=64,a=16,e=16" -format UDRW -size 10m "/Users/kekec/tmp.dmg"
hdiutil attach -readwrite -noverify -noautoopen "/Users/kekec/tmp.dmg" // 以可读写、非验证、不自动打开的方式对/Users/kekec/tmp.dmg进行挂载 注:挂载后,对应/Volumes/MyDmg目录
hdiutil detach /Volumes/MyDmg // 卸载/Volumes/MyDmg
hdiutil convert "/Users/kekec/tmp.dmg" -format UDZO -imagekey zlib-level=9 -o "/Users/kekec/test" // 将/Users/kekec/tmp.dmg压缩并转化为UDZO格式,然后写文件到/Users/kekec/test.dmg
open /System/Applications/Utilities/Console.app // 打开控制台 注:这儿还有一款类似功能的软件:iOS Console
// 启动MyTest1项目的ue4编辑器
open -a /Users/kekec/CodeTest/UnrealEngine/Engine/Binaries/Mac/UE4Editor-Mac-Debug.app/Contents/MacOS/UE4Editor-Mac-Debug --args "/Users/kekec/CodeTest/MyTest1/MyTest1.uproject"
open -a /Users/kekec/CodeTest/UnrealEngine/Engine/Binaries/Mac/UE4Editor-Mac-Debug.app/Contents/MacOS/UE4Editor-Mac-Debug --args "/Users/kekec/CodeTest/MyTest1/MyTest1.uproject /Game/ThirdPersonCPP/Maps/ThirdPersonExampleMap -game -windowed -ResX=1280 -ResY=720"
xcrun dwarfdump --uuid MyGame.dSYM // 查看dSYM符号文件的UUID。显示如下信息:
UUID: 26D77D79-C734-303D-9223-7C1A6EB8374F (arm64) MyGame.dSYM/Contents/Resources/DWARF/MyGame
xcrun dwarfdump --uuid MyGame // 查看MyGame可执行文件的UUID。显示如下信息:
UUID: 26D77D79-C734-303D-9223-7C1A6EB8374F (arm64) MyGame
xcrun dwarfdump --uuid MyGame.dSYM | cut -d" " -f2 // 查看dSYM符号文件的UUID。显示如下信息 注:使用空格分隔,显示第2个字符串
26D77D79-C734-303D-9223-7C1A6EB8374F
codesign -d -vvvv /Test.app // 查看Test程序签名的详细信息。Test程序未签名时,显示如下信息:
Test.app: code object is not signed at all
codesign -d -vvvv /Applications/Xcode.app // 查看Xcode签名的详细信息
Executable=/Applications/Xcode.app/Contents/MacOS/Xcode Identifier=com.apple.dt.Xcode Format=app bundle with Mach-O thin (x86_64) CodeDirectory v=20200 size=469 flags=0x2000(library-validation) hashes=7+5 location=embedded VersionPlatform=1 VersionMin=658944 VersionSDK=659204 Hash type=sha256 size=32 CandidateCDHash sha1=e7b303a96a38351b6b2a7c4d8117704c82cf28a9 CandidateCDHashFull sha1=e7b303a96a38351b6b2a7c4d8117704c82cf28a9 CandidateCDHash sha256=dd839ddedd3f40999e53e76a2d4e556fcdd46f6c CandidateCDHashFull sha256=dd839ddedd3f40999e53e76a2d4e556fcdd46f6ce4b6cbbcca50a415820817f6 Hash choices=sha1,sha256 CMSDigest=014acc18a5b1cef7e9133a809c3c189075292bc39062f7dc81418d8d0229d22d CMSDigestType=2 Page size=4096 CDHash=dd839ddedd3f40999e53e76a2d4e556fcdd46f6c Signature size=4698 Authority=Apple Mac OS Application Signing Authority=Apple Worldwide Developer Relations Certification Authority Authority=Apple Root CA Info.plist entries=40 TeamIdentifier=APPLECOMPUTER Sealed Resources version=2 rules=13 files=309580 Internal requirements count=1 size=224
codesign -d --entitlements - /Applications/Xcode.app // 查看Xcode签名中的授权机制entitlements信息
Executable=/Applications/Xcode.app/Contents/MacOS/Xcode ??qq?<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>com.apple.PairingManager.Read</key> <true/> <key>com.apple.PairingManager.RemovePeer</key> <true/> <key>com.apple.PairingManager.Write</key> <true/> <key>com.apple.application-identifier</key> <string>59GAB85EFG.com.apple.dt.Xcode</string> <key>com.apple.authkit.client.private</key> <true/> <key>com.apple.developer.aps-environment</key> <string>production</string> <key>com.apple.developer.maps</key> <true/> <key>com.apple.dt.simulator.client</key> <true/> <key>com.apple.private.coreservices.definesExtensionPoint</key> <true/> <key>com.apple.private.dt.xcode.set-responsible-process-for-ui-testing</key> <true/> <key>com.apple.private.syspolicy.execution-policy-bypass</key> <true/> <key>com.apple.private.tcc.allow</key> <array> <string>kTCCServiceAppleEvents</string> <string>kTCCServicePhotos</string> <string>kTCCServiceDeveloperTool</string> </array> <key>com.apple.private.tcc.allow-prompting</key> <array> <string>kTCCServiceAll</string> </array> <key>com.apple.sysmond.client</key> <true/> </dict> </plist>
security find-identity -v -p codesigning // 查看当前机器上拥有有效的私钥证书(即可用来给程序签名的证书)
1) 2E54C48AF11C373978B9E57F121335128756B259 "iPhone Developer: zhong jianbin (Y68J4BC8T9)" (CSSMERR_TP_CERT_REVOKED) 2) 71CB408548CBAAB125F00854532134D8FA140766 "Apple Development: zhong jianbin (Y68J4BC8T9)" 2 valid identities found
codesign -f -s "iPhone Developer: zhong jianbin (Y68J4BC8T9)" Test.app // 强制使用"iPhone Developer: zhong jianbin (Y68J4BC8T9)"对Test.app进行签名(若之前有签名,则进行覆盖)。注:签名之后没有输出,说明签名正确。如果有错误,会输出错误的
codesign -f -i com.tencent.mf.test1 -s "iPhone Developer: zhong jianbin (Y68J4BC8T9)" Test.app // 修改Test.app的Identifier(即:bundle id)为com.tencent.mf.test1 注:Xcode的Identifier为com.apple.dt.Xcode
codesign -f -o 0x2200 -s "iPhone Developer: zhong jianbin (Y68J4BC8T9)" Test.app // 修改Test.app的flag为0x2200 注:Xcode的flag为0x2000
security cms -D -i "MyGamePP.mobileprovision" > "entitlements_full.plist" // 从pp文件中提取详细的entitlements信息 entitlements_full.plist内容如下
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>AppIDName</key> <string>App all</string> <key>ApplicationIdentifierPrefix</key> <array> <string>L3E7KQ25LR</string> </array> <key>CreationDate</key> <date>2020-07-09T01:50:30Z</date> <key>Platform</key> <array> <string>iOS</string> </array> <key>IsXcodeManaged</key> <false/> <key>DeveloperCertificates</key> <array> <data>MIIFmjCCBIKgAwIBAgIITnLDUpKR25UwDQYJKoZIhvcNAQELBQAwgZYxCzAJBgNVBAYTAlVTMRMwEQYDVQQKDApBcHBsZSBJbmMuMSwwKgYDVQQLDCNBcHBsZSBXb3JsZHdpZGUgRGV2ZWxvcGVyIFJlbGF0aW9uczFEMEIGA1UEAww7QXBwbGUgV29ybGR3aWRlIERldmVsb3BlciBSZWxhdGlvbnMgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMjAwNzA5MDEzNzU4WhcNMjEwNzA5MDEzNzU4WjCBjTEaMBgGCgmSJomT8ixkAQEMCkY1NDVUMjdaMkIxNTAzBgNVBAMMLGlQaG9uZSBEZXZlbG9wZXI6IHpob25nIGppYW5iaW4gKFk2OEo0RUhRVDkpMRMwEQYDVQQLDApMM0U3S1EyNUxSMRYwFAYDVQQKDA16aG9uZyBqaWFuYmluMQswCQYDVQQGEwJVUzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALKDXr4XjSXhdbnl0kI+k4WUKVbxsBlg3Ja2cviNdCv91qImIVpANKNjP0GVMJ01S5TYqsOROm2N5qRliPLVe31ZHyp+C1tKUbFekhB5lhTo7jRZBnas/LhVRcvqDUBrn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ZCB0ZXJtcyBhbmQgY29uZGl0aW9ucyBvZiB1c2UsIGNlcnRpZmljYXRlIHBvbGljeSBhbmQgY2VydGlmaWNhdGlvbiBwcmFjdGljZSBzdGF0ZW1lbnRzLjA2BggrBgEFBQcCARYqaHR0cDovL3d3dy5hcHBsZS5jb20vY2VydGlmaWNhdGVhdXRob3JpdHkvMBYGA1UdJQEB/wQMMAoGCCsGAQUFBwMDMB0GA1UdDgQWBBQugu9Bmin9q4wYI9LDIvn97UB+nTAOBgNVHQ8BAf8EBAMCB4AwEwYKKoZIhvdjZAYBAgEB/wQCBQAwEwYKKoZIhvdjZAYBDAEB/wQCBQAwDQYJKoZIhvcNAQELBQADggEBAC4SFOCYi0CGhUg37l1uTdSl3Wdvr9RHXeBVs4F1j/B99F6+AA+fcIBAdpG5b7x4Qe64uAzJw37NGjMS8KT0o96iy6nTduC+WQdy07A9jWdYAm8Gg4DjsOir7LqDajRMzVAu0ZWKr1Vo3XMZtF3zBVjCwqWRDgnIyVIb7JEZhfQ4Nk3FCW0SkkMbtU2fVrG+kRGdJ/A3AWtOKw0Ud+wLksFW7znSNQMHZulBza2/Tn9241RxDTthJWfoQsq9HE27EMnGS5Y9V8x9/sVyNdu6y6Ok3+HX3Ss9XVWrQXy4LsUsYWVwVumyCaDMzjaakGd9+C4RhpVlSeeacej5oadO1EU=</data> </array> <key>Entitlements</key> <dict> <key>application-identifier</key> <string>L3E7KQ25LR.com.*</string> <key>keychain-access-groups</key> <array> <string>L3E7KQ25LR.*</string> <string>com.apple.token</string> </array> <key>get-task-allow</key> <true/> <key>com.apple.developer.team-identifier</key> <string>L3E7KQ25LR</string> </dict> <key>ExpirationDate</key> <date>2021-07-09T01:50:30Z</date> <key>Name</key> <string>UAGamePP</string> <key>ProvisionedDevices</key> <array> <string>00008030-000435A80A91802E</string> <string>ef517a56e81ebcc95af428943981c0a57f765756</string> <string>fb64c4fdd3ad6b276e2b82d39f0d3c21ff6a3033</string> <string>51bd0b61cb2bdb8b8ede964cdadac21c948fc13a</string> <string>0f3f1a4430543305f21f17cb49d0c4bebd91ef63</string> <string>d5d8446663220fbe74aa37bc6afc3afb89ed6307</string> <string>00008020-000E35C03446002E</string> <string>00008030-001C6D391A84802E</string> <string>00008030-000D559C1EBA802E</string> </array> <key>TeamIdentifier</key> <array> <string>L3E7KQ25LR</string> </array> <key>TeamName</key> <string>zhong jianbin</string> <key>TimeToLive</key> <integer>365</integer> <key>UUID</key> <string>700539a1-132d-4ebc-9753-e9e56fcd6173</string> <key>Version</key> <integer>1</integer> </dict> </plist>
/usr/libexec/PlistBuddy -x -c 'Print:Entitlements' entitlements_full.plist > entitlements.plist // 从详细的entitlements_full.plist文件中提取entitlements文件所需的那部分内容 entitlements.plist的内容如下
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>application-identifier</key> <string>L3E7KQ25LR.com.*</string> <key>com.apple.developer.team-identifier</key> <string>L3E7KQ25LR</string> <key>get-task-allow</key> <true/> <key>keychain-access-groups</key> <array> <string>L3E7KQ25LR.*</string> <string>com.apple.token</string> </array> </dict> </plist>
注:get-task-allow为是否允许调试器调试该app的flag。为true允许调试,为false表示关闭调试(app要Distribution时需设置成该值)
codesign -f -s 'iPhone Developer: zhong jianbin (Y68J4BC8T9)' --entitlements ./entitlements.plist ./Payload/MyGame.app/ // 使用当前目录的entitlements.plist文件对./Payload/MyGame.app/目录中的内容进行签名
sudo spctl --master-disable // 在MacOS BigSur等权限管理严格的系统上,将GateKeeper disable掉
sudo spctl --master-enable // 在MacOS BigSur等权限管理严格的系统上,将GateKeeper设置成enable
spctl --status // GateKeeper disable掉时,会打印:assessments disabled GateKeeper enable时,会打印:assessments enabled
注:disable掉GateKeeper,会显示出“任何来源”按钮;enable掉GateKeeper,会隐藏出“任何来源”按钮
参考