Xcode11后Application Loader正式从Xcode的工具栏中消失
- 如果想在xcode11之后还使用
Application Loader
可以在Applications(应用程序,你的不一定在这里,其实就是xcode的安装位置)/Xcode.app/Contents/Applications/
找到Application Loader
,把它放在xcode11同样的路径,重启xcode就可以看到它.
怎么通过xcrun altool上传IPA包
- 你需要准备apiKey & apiIssuer
- 登陆itunes connection,
- 点击用户和访问 > 密钥 > 生成密钥 (帐户的拥有人,才有权限生成)
- 生成后可以找到 密钥ID(apiKey) & IssuerId (apiIssuer)
- 也把密钥下载下来, 在mac上: 你的用户目录新建一个private_keys文件夹把秘钥放进去,否则会报错。
验证:
xcrun altool --validate-app -f <包的路径.ipa> -t iOS --apiKey <密钥ID> --apiIssuer <issuer ID> --verbose
示例:
xcrun altool --validate-app -f ./app.ipa -t iOS --apiKey $apiKey --apiIssuer $apiIssuer --verbose
上传:
xcrun altool --upload-app -f <包的路径.ipa> -t iOS --apiKey <密钥ID> --apiIssuer <issuer ID> --verbose
示例:
xcrun altool --upload-app -f ./app.ipa -t iOS --apiKey $apiKey --apiIssuer $apiIssuer --verbose
我写的一个shell , 命名为: appstore.sh
<随意>
apiKey=""
if [ -z "$1" ]; then
echo -e "\033[31m Please enter apiKey \033[0m"
read key
while ([ -z "$key" ]); do
echo -e "\033[31m Please enter apiKey \033[0m"
read key
done
apiKey=$key
else
apiKey=$1
fi
apiIssuer=""
if [ -z "$2" ]; then
echo -e "\033[31m Please enter apiIssuer \033[0m"
read issuer
while ([ -z "$issuer" ]); do
echo -e "\033[31m Please enter apiIssuer \033[0m"
read issuer
done
apiIssuer=$issuer
else
apiIssuer=$2
fi
echo -e "\033[46;30m apiKey is: $apiKey -- apiIssuer is: $apiIssuer \033[0m"
#上傳
function uploadFunc() {
upload="xcrun altool --upload-app -f ./app.ipa -t iOS --apiKey $apiKey --apiIssuer $apiIssuer --verbose"
echo "running upload cmd" $upload
uploadApp="$($upload)"
echo uploadApp
if [ -z "$uploadApp" ]; then
echo -e "\033[31m upload failed \033[0m"
else
echo -e "\033[46;30m upload success \033[0m"
fi
}
# 验证
validate="xcrun altool --validate-app -f ./app.ipa -t iOS --apiKey $apiKey --apiIssuer $apiIssuer --verbose"
echo "running validate cmd" $validate
runValidate="$($validate)"
echo $runValidate
if [ -z "$runValidate" ]; then
echo -e "033[31m validate failed \033[0m"
else
uploadFunc
fi
使用
- 把你的ipa 命名为: app.ipa
- 把
appstore.sh
丢到与你的ipa 同一目录 - run:
bash appstore.sh xx xxxxxx
- 第一个xx 是apiKey
- xxxxxx 是apiIssuer
- 它会检测你有没输入, 会一直提醒到你输入为止
苹果也出了一个工具:
Transporter
方便快捷
网友评论