Web Analytics
Back
Featured image of post Azure Devops Xcodebuild 常見問題

Azure Devops Xcodebuild 常見問題

建議可以找有經驗的開發人員一起檢視問題

The scheme must be specified to generate the package with xcodebuild archive and export

(必須指定配置,才能產生包含 xcodebuild 封存與匯出的套件)

 

解決方法

這裡的配置指的是 Schema,指的是 Xcodebuild 上 Schema 沒有指定,所以無法封裝與匯出 ipa 檔案 (xcode 中的Target)

 

 

The workspace or project path must be specified to generate the package with xcodebuild archive and export

中文: 必須指定工作區或專案路徑,才能產生包含 xcodebuild 封存檔案與匯出的套件

 

解決方法

需要指定工作區或專案路徑,依據原始碼看來,建議直接指定 xcodeproj 檔案,而不要指定專案資料夾,並免設定失敗

 

 

error: tool ‘xcodebuild’ requires Xcode, but active developer directory ‘/Library/Developer/CommandLineTools’ is a command line tools

Xcode Build 需要安裝 Xcode App,目前設定有效的開發者目錄為'/Library/Developer/CommandLineTools' (為命令工具)

 

解決方法

步驟 1. 確認已經安裝 Xcode,並且可以在啟動台內看到 Xcode app

步驟 2. 開啟終端機或 Finder,確認 Xcode app 安裝在 /Application 目錄下 (不是在 /Users/{user}/Applications 下)

Xcode 版本

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

Xcode-beta 版本

sudo xcode-select -s /Applications/Xcode-beta.app/Contents/Developer

 

 

error: Signing certificate is invalid. Signing certificate “iPhone Distribution: xxxx (xxxx)”, serial number “xxxx”, is not valid for code signing. It may have been revoked or expired. (in target ‘xxxx’ from project ‘xxxx’)

沒有匯入憑證、憑證過期或憑證不受信任

 

解決方法

步驟1. 建議開啟對外網路,確認 Xcode 有登入帳號並更新provisioning profile

 

步驟2. 點選憑證匯入鑰匙圈 (Keychain)

 

步驟3. 確認該憑證受信任(正常情況應該會自動信任,若沒有信任,請先移除,Xcode 連線外網更新後,再一次匯入)

 

 

error: exportArchive: No signing certificate “iOS Development” found

(主要原因沒有加入正確的 Plist 檔案進行封裝與匯出)

 

詳細錯誤訊息如下 error: exportArchive: “xxxx.app” requires a provisioning profile with the Push Notifications feature.

Error Domain=IDEProvisioningErrorDomain Code=9 ““xxxx.app” requires a provisioning profile with the Push Notifications feature.” UserInfo={IDEDistributionIssueSeverity=3, NSLocalizedDescription=“xxxx.app” requires a provisioning profile with the Push Notifications feature., NSLocalizedRecoverySuggestion=Add a profile to the “provisioningProfiles” dictionary in your Export Options property list.} error: exportArchive: No signing certificate “iOS Development” found Error Domain=IDECodesignResolverErrorDomain Code=1 “No signing certificate “iOS Development” found” UserInfo={IDEDistributionIssueSeverity=3, NSLocalizedRecoverySuggestion=No “iOS Development” signing certificate matching team ID “xxxx” with a private key was found., IDEProvisioningError_UserInfoKey_IDEProvisioningErrorSpecifier=iOS Development, NSLocalizedDescription=No signing certificate “iOS Development” found, IDEProvisioningError_UserInfoKey_IDEProvisioningErrorPlatform=com.apple.platform.iphoneos, IDEProvisioningError_UserInfoKey_IDEProvisioningErrorAction=5, IDEProvisioningError_UserInfoKey_IDEProvisioningErrorTeam=<IDEProvisioningBasicTeam: 0x600001943ce0; teamID=‘xxxxx’, teamName='(null)'>}

** EXPORT FAILED **

 

解決方法 開啟 Xcode,手動匯出一次。

在匯出資料夾可以找到 Plist 檔案,在 Azure DevOps Xcodebuild 上設定此 Plist 即可

Built with Hugo   Theme Stack designed by Jimmy