通过shell脚本上传IPA

之前一直使用的altools.最近因为过期需要迁移到notarytool.本片文章介绍一下该脚本如何使用

altool的使用(旧版)

假如你的Xcode的路径是下面的路径:

复制代码
/Applications/Xcode.app

那么之前使用到的工具的路径就是下面的路径:

复制代码
/Applications/Xcode.app/Contents/Developer/usr/bin/altool

APPLEACCOUNT = "[email protected]" # 替换为你的账号
APPLEPASSWORD = "123123123" # 替换为你的密码(这里建议在appleid.com中创建一个单独密码来专门使用)
EXPORT_IPA = "/xx/xx/xx.ipa" #替换为要上传的ipa路径
1. 验证ipa
xcrun altool -v -f ${EXPORT_IPA} -u ${APPLEACCOUNT} -p ${APPLEPASSWORD} -t ios
2. 上传ipa包
xcrun altool --upload-app -f ${EXPORT_IPA} -u ${APPLEACCOUNT} -p ${APPLEPASSWORD} -t ios

notarytool的使用

Xcode版本 >= Xcode13

shell

复制代码
APPLEACCOUNT = "[email protected]" # 替换为你的账号
APPLEPASSWORD = "123123123" # 替换为你的密码(这里建议在appleid.com中创建一个单独密码来专门使用)
EXPORT_IPA = "/xx/xx/xx.ipa" #替换为要上传的ipa路径
APPLETEAMID = "xxxxxx" # 替换为developer网站中对应团队member中显示的的teamid
1. 上传IPA包
xcrun notarytool submit {EXPORT_IPA} --apple-id {APPLEACCOUNT} --team-id {APPLETEAMID} --password {APPLEPASSWORD} --wait
2. 查看上传结果
xcrun notarytool history --apple-id {APPLEACCOUNT} --team-id {APPLETEAMID} --password {APPLEPASSWORD}

python

复制代码
..
import subprocess
...
APPLEACCOUNT = "[email protected]" # 替换为你的账号
APPLEPASSWORD = "123123123" # 替换为你的密码(这里建议在appleid.com中创建一个单独密码来专门使用)
EXPORT_IPA = "/xx/xx/xx.ipa" #替换为要上传的ipa路径
APPLETEAMID = "xxxxxx" # 替换为developer网站中对应团队member中显示的的teamid
...
upload_script = f"{notarytool} submit {EXPORT_IPA} --apple-id {APPLEACCOUNT} --team-id {APPLETEAMID} --password {APPLEPASSWORD} --wait"
upload_output = subprocess.Popen(upload_script, stdout=subprocess.PIPE, shell=True)
upload_log = upload_output.stdout.read().decode()
upload_output.wait()
if upload_output.returncode == 0:
	print("AppStore上传成功:\n" + upload_log)
else:
	print(""AppStore上传失败:\n" + upload_log)
# 查看上传结果
upload_result_script = f"{notarytool} history --apple-id {APPLEACCOUNT} --team-id {APPLETEAMID} --password {APPLEPASSWORD}"
upload_result_output = subprocess.Popen(upload_result_script, stdout=subprocess.PIPE, shell=True)
upload_result_log = upload_result_output.stdout.read().decode()
upload_result_output.wait()
if upload_result_output.returncode == 0:
	print("AppStore上传状态查询成功:\n" + upload_result_log)
else:
	print("AppStore上传状态查询失败:\n" + upload_result_log)
相关推荐
xbd_zc8 小时前
【Jenkins简单自动化部署案例:基于Docker和Harbor的自动化部署流程记录】
docker·自动化·jenkins·harbor
水银嘻嘻11 小时前
web 自动化之 selenium 下拉&鼠标键盘&文件上传
selenium·自动化
深圳安锐科技有限公司11 小时前
高速边坡监测成本高?自动化如何用精准数据省预算?
运维·自动化
IT轻生活12 小时前
TestNG接口自动化
运维·自动化
水银嘻嘻12 小时前
Web 自动化之 HTML & JavaScript 详解
前端·自动化·html
莫负初13 小时前
Excel使用VBA批量计算指定列的中位数和标准差并筛选指定列数据
数据分析·自动化·excel·vba·方差·标准差
水银嘻嘻14 小时前
web 自动化之 Unittest 应用:报告&装饰器&断言
前端·python·自动化
杜子腾dd1 天前
17.Excel:实用的 VBA 自动化程序
数据分析·自动化·excel
奋斗者1号1 天前
浏览器自动化与网络爬虫实战:工具对比与选型指南
运维·爬虫·自动化
一只专注api接口开发的技术猿1 天前
1688 API 自动化采集实践:商品详情实时数据接口开发与优化
大数据·运维·数据库·自动化