iTMSTransporter上传ipa文件

背景

uni-app云打包之后生成的ipa包需要上传到app
store上,applicationloader和香蕉云编都收费,转用iTMSTransporter上传

环境:mac

第1步 选择安装目录
xcode-select --switch /Applications/Xcode.app/Contents/Developer
第2步 下载
xcrun iTMSTransporter

安装目录在
/Applications/Xcode.app/Contents/Developer/usr/bin/iTMSTransporter

第3步 添加环境变量
vi ~/.zshrc

// 添加如下配置

#iTMSTransporter begin
export TRANSPORTER_HOME=/Applications/Xcode.app/Contents/Developer/usr
export PATH=${PATH}:${TRANSPORTER_HOME}/bin# #iTMSTransporter end

// 配置更新
source ~/.zshrc
第4步 测试
iTMSTransporter -version
第5步 上传
iTMSTransporter -m upload -assetFile <ipa路径> -u <username> -p <appId管理中创建的App 专用密码> -asc_provider <团队id>  -v informational

-asc_provider <团队id> 可不加,如果自己的账号加入了多个团队需要加,否则会报错

Error Messages:
		could not find a provider public id: actorsGetCollection call failed with: 401 - {
	"errors": [{
		"status": "401",
		"code": "NOT_AUTHORIZED",
		"title": "Authentication credentials are missing or invalid.",
		"detail": "Provide a properly configured and signed bearer token, and make sure that it has not expired. Learn more about Generating Tokens for API Requests https://developer.apple.com/go/?id=api-generating-tokens"
	}]
}