How to push IPA to App Center Distribute from Continuous Integration Server

倖福魔咒の 提交于 2019-12-06 07:16:34

问题


How do you push an iOS IPA file to App Center Distribute from the command line?

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

Command 'appcenter distribute release' requires a logged in user. Use the 'appcenter login' command to log in


回答1:


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.

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]"

It will provide a response like this:

ID: [Unique Guid]

API Token: [Unique API Token]

Description: [Name of Token]

Created at: [Time Stamp]

Copy the API Token result. We will use this in our CI script.

2. App Center Distribute Script for CI Server

In your Continuous Integration pipeline, use this bash script to push the IPA File to App Center Distribute

The bash script does the following:

  1. Locate the IPA file
  2. Install the appcenter cli
  3. Log in to App Center using the API Token
  4. Push the IPA to App Center Distribute
#!/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 


来源:https://stackoverflow.com/questions/50361860/how-to-push-ipa-to-app-center-distribute-from-continuous-integration-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!