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

BrowserStack CLI

Learn how to the use the BrowserStack CLI to upload apps and manage your test executions.

BrowserStack App Automate allows you to manage your app testing on our cloud-based infrastructure by providing full integration with the command-line interface (CLI). BrowserStack CLI provides a set of simple commands to upload apps, manage your test executions, and much more.

Set up BrowserStack CLI

Follow the steps below to setup BrowserStack CLI on your machine:

Navigate to CLI binary folder:
Double-click on the binary downloaded and open a new terminal inside the folder containing the BrowserStack CLI binary.

Make CLI executable:
Make the BrowserStack CLI executable by running the following command for MAC and Linux machines:

chmod +x browserstack

Explore BrowserStack CLI for App Automate

Get a seamless experience by testing on 3000+ real devices using the App Automate BrowserStack CLI.
To explore the list of available options, run the command below.

./browserstack [commands] [flags]

Explore the following commands:

Command Usage
app-automate Automated mobile app testing on Real Mobile devices
authenticate Set/Update your BrowserStack credentials
help Help about any command
update Update browserstack-cli to the latest version
version Print the version number of BrowserStack CLI

Explore the following flags:

Flag Description
–config Config file for your tests. Default: $HOME/.browserstack-cli.yaml
-h, –help Help for browserstack

To learn more about any specific command, use the help flag as shown below:

./browserstack [command] --help

Get started with BrowserStack CLI

Before you can upload an app or manage your test executions, you first need to authenticate yourself with your BrowserStack username and access-key. Retrieve your credentials from App Automate dashboard or Account summary page.

Run the command below to explore available flags:

./browserstack authenticate [flags]

Refer to some of the common available flags to authenticate yourself:

Flag Description
–username To identify you as a unique user on the BrowserStack account. Fetch info from https://www.browserstack.com/accounts/settings
–access-key Private BrowserStack key associated with your account. Fetch info from https://www.browserstack.com/accounts/settings
-h, –help Help for authenticate

For example:

./browserstack authenticate --username=your_username --access-key=your_access_key


Manage your applications and run your tests

Explore the BrowserStack CLI for App Automate using the command below:

./browserstack app-automate [command] [flags]

Refer to some of the common available commands to manage your tests on App Automate:

Command Usage
apps Manage your uploaded mobile apps on BrowserStack
testsuite Manage your TestSuite for different Frameworks (Espresso/XCUITest/EarlGrey)
espresso Run your Espresso mobile app tests
xcuitest Run your XCUITest mobile app tests
appium View and manage your Appium tests executed on BrowserStack real devices
plan-status Get plan details - Number of parallels allowed, currently running and queued
devices List of all devices available for testing

To learn more about any specific command, use the help flag as shown below:

./browserstack app-automate [command] -h

For help with available flags and commands within an App Automate framework, Espresso for instance, run the command below:

./browserstack app-automate espresso -h

Need help?

If you have any queries, get in touch with us.

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