Looking for other options? Check out the Local Quickstart for local devices, Cloud Mobile Quickstart for Minitap cloud devices, or Physical iOS Setup for USB-connected devices.
What is BrowserStack?
BrowserStack App Automate provides access to real physical iOS devices in the cloud. Key benefits:Real Physical Devices
Test on actual iPhones and iPads, not simulators
No Local Hardware
No need to own or maintain iOS devices
CI/CD Ready
Perfect for automated testing pipelines
Cross-Device Testing
Access multiple device models and iOS versions
Prerequisites
BrowserStack Account
Sign up at BrowserStack and get access to App Automate.
Get Credentials
From your BrowserStack dashboard, get your:
- Username: Your BrowserStack username
- Access Key: Your BrowserStack access key
Creating Your First BrowserStack Automation
Basic Example
browserstack_demo.py
Run the Script
Configuration Options
BrowserStackClientConfig
| Parameter | Type | Required | Description |
|---|---|---|---|
username | str | ✅ | Your BrowserStack username |
access_key | SecretStr | ✅ | Your BrowserStack access key |
device_name | str | ✅ | Device name (e.g., “iPhone 17”, “iPhone 16 Pro”) |
platform_version | str | ✅ | iOS version (e.g., “17”, “18”, “26”) |
app_url | str | ✅ | BrowserStack app URL (bs://…) |
hub_url | str | None | ❌ | Custom hub URL (defaults to BrowserStack cloud) |
project_name | str | None | ❌ | Project name for organizing sessions |
build_name | str | None | ❌ | Build name for grouping sessions |
session_name | str | None | ❌ | Human-readable session name |
Available Devices
BrowserStack supports a wide range of iOS devices. Some popular options:| Device | Example device_name | Available iOS Versions |
|---|---|---|
| iPhone 17 Pro Max | "iPhone 17 Pro Max" | 26 |
| iPhone 17 Pro | "iPhone 17 Pro" | 26 |
| iPhone 17 | "iPhone 17" | 26 |
| iPhone 16 Pro Max | "iPhone 16 Pro Max" | 18 |
| iPhone 16 Pro | "iPhone 16 Pro" | 18 |
| iPhone 16 | "iPhone 16" | 18 |
| iPhone 15 Pro Max | "iPhone 15 Pro Max" | 17, 26 |
| iPhone 15 Pro | "iPhone 15 Pro" | 17 |
| iPhone 15 | "iPhone 15" | 17, 26 |
| iPad Pro 13 2025 | "iPad Pro 13 2025" | 26 |
| iPad Pro 11 2025 | "iPad Pro 11 2025" | 26 |
| iPad Air 6 | "iPad Air 6" | 17 |
Environment Variables
For security, store your credentials as environment variables:.env
Viewing Session Results
After running your automation, you can view detailed session information in the BrowserStack dashboard:- Navigate to BrowserStack App Automate Dashboard
- Find your session by build name or session name
- View:
- Video recording of the session
- Screenshots at each step
- Device logs
- Network logs
The session URL is also logged when the session starts:
Supported Operations
The BrowserStack client supports the following operations:| Operation | Method | Description |
|---|---|---|
| Tap | tap(x, y) | Tap at coordinates |
| Swipe | swipe(x1, y1, x2, y2) | Swipe gesture |
| Screenshot | screenshot() | Capture screen |
| Type Text | text("hello") | Type text input |
| Launch App | launch(bundle_id) | Launch app by bundle ID |
| Terminate App | terminate(bundle_id) | Close an app |
| Open URL | open_url(url) | Open a URL |
| Press Button | button(type) | Press hardware button (home, volume) |
| UI Hierarchy | describe_all() | Get UI element tree |
Some operations like
app_current() and install() are not supported on BrowserStack. Apps must be pre-uploaded to BrowserStack.Complete Example with Structured Output
browserstack_structured.py
Troubleshooting
Session fails to start
Session fails to start
Possible causes:
- Invalid credentials
- Invalid app_url
- Device/OS combination not available
- Verify your username and access key
- Re-upload your app and get a fresh
app_url - Check BrowserStack device list for valid device/OS combinations
App not launching
App not launching
Possible causes:
- App not properly signed
- App incompatible with selected iOS version
- Ensure your .ipa is signed for distribution
- Try a different iOS version that matches your app’s minimum deployment target
Timeout errors
Timeout errors
Possible causes:
- Slow network connection
- BrowserStack queue delays
- Check your internet connection
- Try during off-peak hours
- Consider using BrowserStack’s priority queue (paid feature)
Element not found
Element not found
Possible causes:
- UI not fully loaded
- Different UI on physical device vs simulator
- Add appropriate waits in your automation
- Use
describe_all()to inspect the actual UI hierarchy - Check the session video in BrowserStack dashboard
Best Practices
Use Environment Variables
Never hardcode credentials - use environment variables or secrets management
Organize Sessions
Use
build_name and session_name to organize and find sessions easilyHandle Cleanup
Always use try/finally to ensure
agent.clean() is calledCheck Device Availability
Verify device/OS combinations before running tests

