通过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)

相关推荐

  1. 通过shell脚本IPA

    2024-01-17 17:22:01       57 阅读
  2. shell脚本参调用http接口

    2024-01-17 17:22:01       22 阅读
  3. iTMSTransporteripa文件

    2024-01-17 17:22:01       63 阅读
  4. shell 局域网IP探活脚本

    2024-01-17 17:22:01       29 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-01-17 17:22:01       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-01-17 17:22:01       100 阅读
  3. 在Django里面运行非项目文件

    2024-01-17 17:22:01       82 阅读
  4. Python语言-面向对象

    2024-01-17 17:22:01       91 阅读

热门阅读

  1. 一个Python网站。

    2024-01-17 17:22:01       54 阅读
  2. 为什么要用B+树

    2024-01-17 17:22:01       57 阅读
  3. zabbix-api

    2024-01-17 17:22:01       50 阅读
  4. conda install Solving environment: \ Killed

    2024-01-17 17:22:01       70 阅读
  5. Python 配置 pip 国内源

    2024-01-17 17:22:01       48 阅读
  6. Python从入门到精通秘籍六

    2024-01-17 17:22:01       54 阅读
  7. React16源码: React中调度之requestWork的源码实现

    2024-01-17 17:22:01       43 阅读
  8. 99个Python脚本实用实例

    2024-01-17 17:22:01       36 阅读
  9. Nmap工具详细使用过程

    2024-01-17 17:22:01       46 阅读