腳本地址
大家首先下載腳本地址:
腳本地址
里面蒲公英地址對應的key、都需要修改自己的
使用
- 先配置DevelopmentExportOptionsPlist文件中的信息(解包方法,標識符及對應的描述文件名稱)
- 將xcodebuild.sh中appName置換為項目工程名
- 將文件放置于項目文件中和.xcodeproj平級
在終端中進入.xcodeproj上級目錄
輸入./xcodebuild.sh即可自動打包、如無執行權限則先執行hmod +x xcodebuild.sh
腳本運行授權
切回 腳本制定目錄下(比如我的腳本在桌面)
bogon:~ gaoguangxiao$ cd /Users/gaoguangxiao/Desktop
運行腳本
bogon:Desktop gaoguangxiao$ ./Test.sh
授權否定的意思,需要解除授權,運行下面步驟解出授權
./Test.sh: Permission denied
解除授權 chmod a+x Test.sh
bogon:Desktop gaoguangxiao$ chmod a+x Test.sh
重新運行腳本
參考文檔
問題
M1/M2芯片執行腳本報錯
"Provisioning profile "iOS Team Provisioning Profile" doesn't include the currently selected device "xxx's MacBook Pro"
"Provisioning profile "iOS Team Provisioning Profile" doesn't include the currently selected device "Mac Mini"
解決方法
xcodebuild \
archive -workspace ${project_name}.xcworkspace \
-scheme ${scheme_name} \
-destination 'generic/platform=iOS' \
-configuration ${development_mode} \
-archivePath build/${project_name}.xcarchive -quiet || exit
重點是這句話
-destination 'generic/platform=iOS'
xcode-select: error
這個錯誤是Xcode路徑錯誤
Error: xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
使用以下命令把xcode的路徑修改為安裝的位置
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
exportArchive: ipatool failed
error: exportArchive: ipatool failed
AppThinning.StubError(errorDescription: Optional("ipatool failed"))
解決方法
修改exportOptions文件中compileBitcode為NO,即可