Skip to main content
Transform your testing process with: Real Device Features, Company-wide Licences, & App Percy

Define custom ID for app

By default, every app upload generates a new app_url value. Accordingly, you also need to update the app capability in your Appium test scripts to test the latest build of the app.

If you want to use a constant value to specify the application under test and don’t want to modify your test scripts after every app upload, you can define a custom ID for your app. Use the same custom ID every time you upload a new build of the app. Here is an example cURL request to upload an Android app with the custom ID defined as CalculatorApp :

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST "https://api-cloud.browserstack.com/app-automate/upload" \
-F "file=@/path/to/app/file/Application-debug.apk" \
-F "custom_id=CalculatorApp"
curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST "https://api-cloud.browserstack.com/app-automate/upload" \
-F "url=https://www.browserstack.com/app-automate/sample-apps/android/WikipediaSample.apk" \
-F "custom_id=CalculatorApp"

A sample response to the above API request is shown below :

 {
    "app_url":"bs://f7c874f21852ba57957a3fdc33f47514288c4ba4", 
    "custom_id":"CalculatorApp",
    "shareable_id":"exampleuser/CalculatorApp"
 }

In your Appium test script, simply use the custom_id value (CalculatorApp in the above example) to set the app capability to specify the application under test. The test execution will pick the last uploaded build corresponding to that custom ID.

  • Other users in your team can test an app uploaded by you. They need to use the shareable_id value to specify the application under test while setting the app capability in their tests.
  • The use of custom ID or shareable ID is optional.
  • The maximum character limit in the custom_id parameter is 100 and the characters allowed are a-z, A-Z, 0-9, period(.), underscore(_), and hyphen(-).

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback!

Talk to an Expert
Download Copy