How do you push an UI Test along with the associated app to App Center Test 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 test run uitest --app "bminnick/uitestsampleapp" --devices b139e40f --app-path [my apk file path] --test-series "master" --locale "en_US" --build-dir [my UI Test Build Directory]
Command 'appcenter test run uitest' requires a logged in user. Use the 'appcenter login' command to log in
I'm trying to deploy a Xamarin.Android app and a Xamarin.UITest.
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.
In your Continuous Integration pipeline, use this bash script to push the APK File + UI Test to App Center Test
The bash script does the following:
[My UI Test Assembly Name]
with the name of your UI Test assembly#!/usr/bin/env bash
UITestDLL=`find . -name "[My UI Test Assembly Name].dll" | grep bin`
UITestBuildDir=`dirname $UITestDLL`
APKFile=`find . -name *.apk | head -1`
npm install -g appcenter-cli@1.2.2
appcenter login --token [login token from Step 1]
appcenter test run uitest --app "bminnick/uitestsampleapp" --devices b139e40f --app-path $APKFile --test-series "master" --locale "en_US" --build-dir $UITestBuildDir --async