Understanding devices
In Uplink, a device (also called a worker) is a mobile phone or tablet that connects to your session and can host browsers. Devices can join sessions through either:- Connect app: Users scan a QR code or enter a session code
- SDK integration: Your custom app connects programmatically
Connecting devices
Waiting for devices
The most common pattern is to wait for a device to connect before starting automation:Listing connected devices
Get all currently connected devices:Device connection events
React to devices connecting and disconnecting in real-time:Device information
Retrieve information about a device’s capabilities and specifications:Using device info for targeting
Multi-device patterns
Parallel execution
Run automation on multiple devices simultaneously:Device pool management
Manage a pool of devices for load distribution:Platform-specific testing
Run different tests based on platform:Browser management per device
Each device can host multiple browsers. Manage them effectively:Launching browsers
Listing browsers
Connecting to existing browsers
Browsers are persistent and can be reconnected using their handle:Cleaning up browsers
Always close browsers when done to free device resources:Device lifecycle
Terminating devices
When necessary, you can terminate a device connection:Handling disconnections
Devices can disconnect unexpectedly (network issues, app closure, etc.). Handle disconnections gracefully:Addressing devices
Devices have unique addresses for identification and targeting:Best practices
Clean up resources
Clean up resources
Always close browsers and pages when done to free device resources:
Handle device variability
Handle device variability
Different devices have different capabilities. Test your automation across various device types and OS versions.
Monitor device health
Monitor device health
Keep track of device connection stability and browser success rates:
Use timeouts
Use timeouts
Set appropriate timeouts when waiting for devices or operations:
Next steps
Client API
Full Client API reference
ClientWorker API
Device-specific methods
Browser API
Managing browsers
Core concepts
Review core architecture