Visual Studio App Center

Visual Studio App Center is a Microsoft product that allows you to build your mobile apps in the cloud.
Simply connect your repository and App Center will build your app on every commit.

This integration allows you to test builds generated by App Center on our mobile device cloud.

In this guide we'll show you:

  • How to connect to the Visual Studio App Center API.
  • Fetch the public link to the latest build.
  • Upload the build to TestingBot Storage for testing.

Retrieve API Token

To get started, you'll need to log into Visual Studio App Center and generate an API key.

  • Sign into your App Center account.
  • Go to Account Settings and choose User API Tokens.
  • Click the New API Token button.
  • Add a description for your token, for example TestingBot-Token.
  • Give the token Read Only access.
  • Generate and copy the API Token.
Visual Studio App Center API Token

List All App Projects

Now that we have an API token, we can use it to fetch all app projects:

curl -sX GET  "https://api.appcenter.ms/v0.1/apps" \
 -H "Content-Type: application/json" \
 -H "X-Api-Token: [YOUR-API-TOKEN]"

The response should be similar to this:

 }, {

Fetch build info from API

Now we can fetch the build information from the App Center API.
We'll need the name and owner.name from the previous response:

If you want to fetch the build of the latest release, please use:

curl -sX GET  "https://api.appcenter.ms/v0.1/apps/[owner.name]/[name]/releases/latest" \
-H "Content-Type: application/json" \
-H "X-Api-Token: [YOUR-API-TOKEN]"

If you are looking to fetch the latest build (not necessarly released yet), please use:

curl -sX GET  "https://api.appcenter.ms/v0.1/apps/[owner.name]/[name]/branches/master/builds" \
-H "Content-Type: application/json" \
-H "X-Api-Token: [YOUR-API-TOKEN]"

Then copy the build id and use:

curl -sX GET  "https://api.appcenter.ms/v0.1/apps/[owner.name]/[name]/builds/[build-id]/downloads/build" \
-H "Content-Type: application/json" \
-H "X-Api-Token: [YOUR-API-TOKEN]"

The response should contain a URL which points to the build, similar to this example:


Upload build

Now that you've retrieved the build URL, you can upload this build to TestingBot Storage.

curl -X POST "https://api.testingbot.com/v1/storage" \
-u key:secret -d "url=[BUILD-URL]"

This will return a unique URL {"app_url": "tb://..."} which you can use with your tests.

Simply add the tb://... as an app capability to run your tests: more information.