如何从持续集成服务器将IPA推送到App Center分发 [英] How to push IPA to App Center Distribute from Continuous Integration Server
问题描述
如何从命令行将iOS IPA文件推送到App Center Distribute?
How do you push an iOS IPA file to App Center Distribute from the command line?
我使用的是CI(持续集成)服务器来构建我的应用程序,我尝试使用由App Center测试门户网站给出的以下命令,但该命令无法正常工作,并在下面输出错误:>
I'm using a CI (Continuous Integration) server to build my app, and I tried using the following command, given by the App Center Test portal, but it isn't working and outputs the error, below:
appcenter distribute release -f ~/Desktop/MondayPundayApp.ipa -g Collaborators --app Punday/mondaypundayapp--ios
命令"appcenter分发版本"需要一个登录用户.使用"appcenter login"命令登录
Command 'appcenter distribute release' requires a logged in user. Use the 'appcenter login' command to log in
推荐答案
从CLI推送到App Center测试
1.手动获取API令牌
App Center CLI 要求用户要登录,我们可以通过提供登录令牌从构建服务器登录.
Push to App Center Test from CLI
1. Manually Retrieve an API Token
The App Center CLI requires the user to be logged in, and we can log in from our build server by providing a login token.
使用App Center CLI,输入以下命令,将[Name Of Token]
替换为您要为其命名的令牌
Using the App Center CLI, enter the following command, replacing [Name Of Token]
with whatever you want to name this token
appcenter login
appcenter tokens create -d "[Name Of Token]"
它将提供如下响应:
ID:[唯一向导]
ID: [Unique Guid]
API令牌:[唯一API令牌]
API Token: [Unique API Token]
说明:[令牌名称]
创建于:[时间戳记]
Created at: [Time Stamp]
复制API令牌结果.我们将在CI脚本中使用它.
Copy the API Token result. We will use this in our CI script.
在您的持续集成管道中,使用此bash脚本将IPA文件推送到App Center分发
In your Continuous Integration pipeline, use this bash script to push the IPA File to App Center Distribute
bash脚本执行以下操作:
The bash script does the following:
- 找到IPA文件
- 安装appcenter cli
- 使用API令牌登录到App Center
- 将IPA推送到App Center分发
#!/usr/bin/env bash
IPAFile=`find . -name *.ipa | head -1`
npm install -g appcenter-cli
appcenter login --token [login token]
appcenter distribute release -f $IPAFile -g Collaborators --app Punday/mondaypundayapp--ios
这篇关于如何从持续集成服务器将IPA推送到App Center分发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!