Specify application under test

After uploading your app to BrowserStack servers using REST API, you are ready to run your Appium tests on BrowserStack App Automate. In your Appium test scripts, you first need to reference your uploaded app using the app capability. During test execution, BrowserStack will automatically fetch and install your app on target device(s). In order to do so, you need to set the app capability in one of the following ways :

  1. Using an app_url value : This is returned in the response to an app upload REST API request.
  2. Using a custom_id value : This is the custom ID you defined in an app upload REST API request. By default, it will pick the last build of your uploaded app under the given custom ID.
  3. Using a shareable_id value : This is returned in the response to an app upload REST API request. It enables other users in your organization to test an app you uploaded.
Capability Description Values
app Specify the app to test on. This is a required capability. For your uploaded app, use one of these values : <app_url> or <custom_id> or <shareable_id>
browserstack.app_version If a custom ID value is being used to set the app capability, use this capability to test previous builds of your uploaded app under the same custom ID. This is optional. ‘-1’, ‘-2’ and so on. This will pick the latest-1, latest-2 etc. builds of your uploaded app to install during test execution

Examples:

Use app_url to specify the app

DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.setCapability("app", "bs://9fg0rt302be241e6524ebc67253ecdee266343");
var capabilities = {
	'app': 'bs://9fg0rt302be241e6524ebc67253ecdee266343'
}
DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.SetCapability("app", "bs://9fg0rt302be241e6524ebc67253ecdee266343");
$capabilities = new DesiredCapabilities();
$capabilities->setCapability("app", "bs://9fg0rt302be241e6524ebc67253ecdee266343");
desired_cap = {
	'app': 'bs://9fg0rt302be241e6524ebc67253ecdee266343'
}
desired_caps = {
    'app': 'bs://9fg0rt302be241e6524ebc67253ecdee266343'
}

Use custom_id to specify the app:

DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.setCapability("app", "MyCalculatorApp");
var capabilities = {
	'app': 'MyCalculatorApp'
}
DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.SetCapability("app", "MyCalculatorApp");
$capabilities = new DesiredCapabilities();
$capabilities->setCapability("app", "MyCalculatorApp");
desired_cap = {
	'app': 'MyCalculatorApp'
}
desired_caps = {
    'app': 'MyCalculatorApp'
}