通过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)
相关推荐
四川合睿达自动化控制工程有限公司17 分钟前
管道位移自动化监测方案
运维·自动化
周胡杰2 小时前
鸿蒙-跨设备互通,设备互通提供跨设备的相机、扫描、图库访问能力,平板或2in1设备可以调用手机的相机、扫描、图库等功能。
数码相机·华为·自动化·电脑·harmonyos·鸿蒙·鸿蒙系统
天天进步20156 小时前
Selenium的ActionChains:自动化Web交互的强大工具
前端·selenium·自动化
亿牛云爬虫专家6 小时前
容器化爬虫部署:基于K8s的任务调度与自动扩缩容设计
爬虫·容器·kubernetes·自动化·k8s·爬虫代理·代理ip
美亚特直线轴承15 小时前
直线轴承在自动化机械设备中的应用
运维·人工智能·经验分享·笔记·机器人·自动化·制造
互联网搬砖老肖15 小时前
Selenium2+Python自动化:利用JS解决click失效问题
javascript·python·自动化
Tom Boom21 小时前
2. 什么是最普通的自动化“裸奔状态”?
自动化·自动化测试框架·对象层封装
胆大的1 天前
怎样才能设计好的自动化测试用例
自动化·测试用例·pytest
VillanelleS1 天前
前端工程化之自动化部署
运维·前端·自动化