Skip to main content

Upload from local machine

Upload an Android app (.apk file) or iOS app (.ipa file) from your local filesystem to BrowserStack using the REST API.

Here is an example API request to upload an Android app :

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"

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 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, on the fly.
  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 iOS app with a custom ID defined :

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.ipa" \
-F "data={\"custom_id\": \"MyApp\"}"

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

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

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