通过shell脚本上传IPA

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

altool的使用(旧版)

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

复制代码
/Applications/Xcode.app

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

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

APPLEACCOUNT = "xxx@xx.com" # 替换为你的账号
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 = "xxx@xx.com" # 替换为你的账号
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 = "xxx@xx.com" # 替换为你的账号
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)
相关推荐
AiTEN_Robot1 小时前
AGV 无人叉车关键技术问题解析:精准定位算法 / 安全避障逻辑 / 系统对接协议全方案
人工智能·机器人·自动化·制造
Hacker_Oldv16 小时前
软件测试(功能、工具、接口、性能、自动化、测开)详解
运维·自动化
Java樱木16 小时前
使用字节Trae + MCP,UI 到网页自动化。
运维·自动化
小小鱼儿小小林21 小时前
免费一键自动化申请、续期、部署、监控所有 SSL/TLS 证书,ALLinSSL开源免费的 SSL 证书自动化管理平台
开源·自动化·ssl
从零开始学习人工智能1 天前
深入解析 OPC UA:工业自动化与物联网的关键技术
运维·物联网·自动化
真智AI1 天前
AI智能体时代来临:数据分析的变革与自动化之路
人工智能·数据分析·自动化
程序员的世界你不懂11 天前
Appium+python自动化(三十)yaml配置数据隔离
运维·appium·自动化
东窗西篱梦11 天前
LNMP一键自动化部署
运维·自动化
Deepoch11 天前
Deepoc大模型重构核工业智能基座:混合增强架构与安全增强决策技术
人工智能·科技·学习·自动化·创业创新
忘记安全带11 天前
AWS EC2使用SSM会话管理器连接
服务器·网络·自动化·云计算·aws