BrowserStack
Use BrowserStack App Automate to run agent-device on hosted Android and iOS devices over WebDriver. You need a BrowserStack account with App Automate access.
Set credentials and connect
Export your BrowserStack credentials, for example from CI secrets:
Connect with the platform, exact device and OS version, and app to test:
--provider-app accepts a BrowserStack app reference such as bs://..., an HTTP(S) app URL, or an existing local app path. agent-device uploads a local path when it creates the hosted session.
connect verifies the BrowserStack credentials and the exact device/OS pair. It checks a bs:// reference against recent uploads, and confirms that a local app file exists before saving its absolute path. A public URL is saved as-is; BrowserStack validates it when the session starts. open takes the app's installed package or bundle identifier, not its upload name.
If you change credentials while the daemon runs, see Change credentials while the daemon runs.
Optional labels:
Optional device features:
agent-device sends these values to BrowserStack as bstack:options capabilities when it creates the hosted session.
- The orientation applies when the session starts. An activity without a fixed orientation, such as a Chrome Custom Tab hosting OAuth, can still open in landscape. Run
agent-device orientation portraitafter it opens if you need portrait. --provider-appium-versionpins the Appium server BrowserStack runs for the session. Without it, BrowserStack runs its default Appium 1.x, andmobile:commands such asdeepLinkandpressButtonneed Appium 2.x or newer.--provider-network-profileand--provider-custom-networkare mutually exclusive.--provider-no-resign-appapplies to iOS only. BrowserStack re-signs uploaded iOS apps with its provisioning profile, which strips entitlements. Pass this flag when you test features that need entitlements, such as push notifications.
Run a session from the CLI
To drive BrowserStack only through MCP, see Use a provider only through MCP.
Use the Node.js client
Configure the client directly when your Node.js process manages the BrowserStack credentials and selectors instead of a saved CLI connection profile:
Get artifacts and troubleshoot
After close, BrowserStack can return session video, Appium logs, device logs, dashboard URLs, and public URLs. The provider session ID is the WebDriver session ID. See Retrieve artifacts after close.
BrowserStack errors distinguish rejected credentials, an unavailable device/OS pair, a missing bs:// upload, and a missing local app file.
To enter text, see Fill text on hosted WebDriver sessions.
