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:
- Locate the IPA file
- Install the appcenter cli
- Log in to App Center using the API Token
- Push the IPA to App Center Distribute
#!/usr/bin/env bash
IPAFile=`find . -name *.ipa | head -1`
npm install -g appcenter-cli@1.2.2
appcenter login --token [login token]
appcenter distribute release -f $IPAFile -g Collaborators --app Punday/mondaypundayapp--ios