BrowserStack
Use BrowserStack App Automate for hosted Android and iOS WebDriver sessions.
Credentials and connection
Set BrowserStack credentials in a non-interactive environment:
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. BrowserStack uploads a local path when it creates the hosted session.
During connect, agent-device verifies the BrowserStack credentials and the exact device/OS pair. It checks a bs:// reference against recent uploads and confirms that a local artifact exists before saving its absolute path. A public URL stays configured and BrowserStack validates it when the session starts. open still needs the app's installed package or bundle identifier, not its upload name.
Optional labels:
Optional device features:
BrowserStack receives these values in bstack:options 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 launching it when needed. --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; opt out when testing entitlement-dependent features such as push notifications.
CLI workflow
For MCP-only use, run connect in the same effective state directory before starting agent-device mcp. MCP exposes open, snapshot, click, close, and artifacts, but not provider connect commands.
Node.js client
Use direct client configuration when the Node process manages BrowserStack credentials and selectors rather than a saved CLI connection profile:
Artifacts and troubleshooting
After close, BrowserStack can return session video, Appium logs, device logs, dashboard URLs, and public URLs. Run agent-device artifacts --json, or look up a previous session explicitly:
BrowserStack errors distinguish rejected credentials, an unavailable device/OS pair, a missing bs:// upload, and a missing local artifact. If artifact lookup is pending immediately after close, retry it. BrowserStack may still be finalizing video and log URLs.
On hosted WebDriver sessions, fill checks that the field received focus before it sends keys. If it cannot confirm focus, it fails without typing. Use snapshot -i to confirm the target. If the driver cannot expose focus at all, use press <target> followed by type <text>. That sends text without confirming the destination.
