Upload using public URL

Upload an Android app (.apk file) or iOS app (.ipa file) from a public URL to BrowserStack using the REST API. This is useful when your app is not available on the local machine from where tests are running but hosted on a different server accessible via public URL. You need to pass the URL as shown in the example API request below :

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST "https://api-cloud.browserstack.com/app-automate/upload" \
-F "data={\"url\": \"https://www.browserstack.com/app-automate/sample-apps/android/WikipediaSample.apk\"}"

The URL specified should be accessible over the internet so that BrowserStack can directly upload it from that location. A sample response to the above API request is shown below:

{"app_url":"bs://f7c874f21852ba57957a3fdc33f47514288c4ba4"}

Note:

  1. App upload will take a few seconds to about a minute depending on the size of your app. Do not interrupt the curl command until you get the response back.
  2. We will delete the uploaded app after 30 days from the date of upload.

Please note the app_url value (“bs://f7c874f21852ba57957a3fdc33f47514288c4ba4”) in the response. This will be used later to set the app capability in your appium tests.

Note:

  1. iOS apps in the development phase are required to be “provisioned” for any specific device. When you upload your iOS app on BrowserStack, we re-provision your apps for our devices.
  2. However, if your app is already signed using the Apple Developer Enterprise Program, you can disable this behavior to test features such as push notifications on BrowserStack devices. Use the capability browserstack.resignApp to false in your appium tests.
  3. For more details refer “Disable re-signing for Enterprise apps” under the Advanced Features section.

Define custom ID for your app

If you upload a new build of your app, you need to update the app capability in your appium tests to use the new app_url value. Alternatively, if you want to set a constant value for the app capability and don’t want to modify your appium tests after every build upload, you can define a custom ID for your app. Use the same custom ID for every build you upload. The use of custom ID is optional.

Here is an example API request to upload an Android app with a custom ID defined:

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST "https://api-cloud.browserstack.com/app-automate/upload" \
-F "data={\"url\": \"https://www.browserstack.com/app-automate/sample-apps/android/WikipediaSample.apk\",  \"custom_id\": \"WikipediaSample\"}"

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

{"app_url":"bs://f7c874f21852ba57957a3fdc33f47514288c4ba4", "custom_id":"WikipediaSample","shareable_id":"username/WikipediaSample"}

In addition to the app_url, note that there are two additional values in the response. You can use either of the above values to set the app capability in your appium tests:

  • custom_id:

Use this value to set the app capability if you want Appium to always pick the latest build of the app uploaded using that custom ID. For example, if you upload 3 different builds of your app using the same custom ID, Appium will pick the last build of the app to execute your test.

  • shareable_id:

Share this value with other users in your group to allow them to run tests using the app uploaded by you. The user can use the shareable_id value to set the app capability in their appium tests to use your app.

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
Talk to an Expert