Skip to main content

Upload your apps to BrowserStack

To perform Flutter integration tests of an Android app on BrowserStack App Automate, upload the app to BrowserStack first. Your app could be on your local filesystem or on a public URL (for example, S3 bucket). To upload it, use the Upload app REST API. To automate the upload process, configure it as part of your CI/CD pipeline.

When you upload an app, BrowserStack generates a unique url (app_url) for it. Use this url in your test API call. This is how BrowserStack knows which app to run your test on.

Note that BrowserStack treats every subsequent upload of your app as unique. Suppose you upload sample_calculator_v1.apk. Then, you make a few changes to the app, as a result of which you now have sample_calculator_v2.apk. To test it on BrowserStack App Automate, upload this version (v2). BrowserStack assigns it a new url. To ensure your tests run on this latest version, modify your API call to reference the new app_url.

Command to upload an app

Here’s a cURL command that uses sample values to upload an app to BrowserStack:

Copy icon
Copy icon

API response

When you run the sample cURL command, the BrowserStack server returns the following response:

{
    "app_name": "app-flutter.apk",
    "app_url": "bs://c8ddcb5649a8280ca800075bfd8f151115bba6b3",
    "app_version": "1.0",
    "app_id": "c8ddcb5649a8280ca800075bfd8f151115bba6b3",
    "uploaded_at": "2020-05-05 14:52:54 UTC",
    "expiry" : "2020-06-05 14:52:54 UTC"
}

Note the app_url key in the response. Its value is the unique url that BrowserStack has created for the app. Use this value to denote the app you want to test in your API call.

Also note the expiry date. It indicates that the app you uploaded gets deleted from the server after 30 days.

Specify a custom ID for the app

You can streamline the process of app upload and avoid API call modifications after each build upload by using a constant value to specify the application under test. To do this, you can follow the steps below:

Define a custom ID for your app the first time you upload it.

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(-).

In your API calls, reference your app using the custom ID.

For all subsequent uploads, use the same ID.

Here is the sample cURL command that sets custom_id:

Copy icon
Copy icon

During the execution of your Flutter integration tests, you can simply use the custom_id value (SampleApp in the above example) to specify the application under test. The test execution then picks the last uploaded build associated with that custom ID.

Here is a sample response with the custom_id:

{
    "app_name": "app-flutter.apk",
    "app_url": "bs://c8ddcb5649a8280ca800075bfd8f151115bba6b3",
    "app_version": "1.0",
    "app_id": "c8ddcb5649a8280ca800075bfd8f151115bba6b3",
    "uploaded_at": "2020-05-05 14:52:54 UTC",
    "custom_id": "SampleApp",
    "shareable_id": "userid/SampleApp",
    "expiry" : "2020-06-05 14:52:54 UTC"
}

Share your app

Other users in your team can execute Flutter integration tests with an app uploaded by you. They need to use the shareable_id value to specify the application under test while executing their Flutter integration tests.

A sample response with the shareable_id is shown in the section above.

Depending on size, it takes a few seconds to about a minute to upload an app. Don’t interrupt the cURL command execution. Wait until you get a response.

When you upload an unsigned Android app, we sign it with our certificates before installing it on our devices. The same applies to .aab files, which we convert to a universal APK and sign with our certificates. However, if Browserstack resigns the apps, your app’s integration with third-party libraries like Google Firebase services, Google Maps SDK, Facebook SDK, etc., may be affected if you have restricted API key usage based on the app’s SHA-1 certificate fingerprint. To prevent this problem, it’s advisable to sign the APK with your own certificates before uploading the app to BrowserStack.

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