Connecting Devices to DeviceLab

The Device Node connects your physical devices, emulators, and simulators to your private device lab. Once connected, devices become accessible for remote testing from anywhere - your laptop, CI/CD pipelines, or team members across the globe. This guide covers setup for Android, iOS, and virtual devices.

Quick Start

bash
curl -fsSL https://app.devicelab.dev/device-node/YOUR_ORG_KEY | sh

Replace YOUR_ORG_KEY with your organization ID from the DeviceLab dashboard.

Command Line Options

bash
curl -fsSL https://app.devicelab.dev/device-node/YOUR_ORG_KEY | sh -s -- [OPTIONS]

Options:
  --name           Custom name for this device node (default: hostname)
  --enable-turn    Enable TURN relay for restrictive networks
  --apple-team-id  Apple Team ID for iOS physical device testing
  --simulators     Comma-separated iOS simulators to add
  --emulators      Comma-separated Android emulators to add

Adding Simulators & Emulators

iOS Simulators

bash
# Add specific simulators
curl -fsSL https://app.devicelab.dev/device-node/YOUR_ORG_KEY | sh -s -- \
  --simulators "iPhone 16,iPad Pro"

# With specific iOS versions
curl -fsSL https://app.devicelab.dev/device-node/YOUR_ORG_KEY | sh -s -- \
  --simulators "iPhone 16:18.0,iPad Pro:17.0"

Android Emulators

bash
# Add specific emulators (AVD names)
curl -fsSL https://app.devicelab.dev/device-node/YOUR_ORG_KEY | sh -s -- \
  --emulators "Pixel_8,Pixel_Tablet"

Combined Setup

bash
curl -fsSL https://app.devicelab.dev/device-node/YOUR_ORG_KEY | sh -s -- \
  --name "Houston-Office-MacMini-2" \
  --simulators "iPhone 16:18.0,iPad Pro:17.0" \
  --emulators "Pixel_8,Pixel_Tablet"

Physical Device Setup

Android Devices

  1. Enable Developer Options: Settings → About Phone → Tap “Build Number” 7 times
  2. Enable USB Debugging: Settings → Developer Options → USB Debugging
  3. Connect via USB: Connect device and authorize the computer
  4. Verify: Run adb devices to confirm device is detected
bash
# Check connected devices
adb devices

# Expected output
List of devices attached
FA9AX2A4WE    device

iOS Devices

  1. Connect via USB: Connect device to Mac
  2. Trust Computer: Tap “Trust” on the device prompt
  3. Verify: Device appears in Finder or xcrun xctrace list devices
bash
# Check connected devices
xcrun xctrace list devices

# Expected output
== Devices ==
John's iPhone (17.1) (00008030-000XXXXXXX)

iOS Physical Device Testing with Maestro

For Maestro tests on physical iOS devices, you need an Apple Team ID:

bash
curl -fsSL https://app.devicelab.dev/device-node/YOUR_ORG_KEY | sh -s -- \
  --apple-team-id "ABCD1234EF"

Find your Team ID:

  • Xcode → Preferences → Accounts → Select Apple ID → View Details → Copy Team ID
  • Or: security find-identity -v -p codesigning | grep "Apple Development"

Custom Node Name

bash
# Set a descriptive name for this node
curl -fsSL https://app.devicelab.dev/device-node/YOUR_ORG_KEY | sh -s -- \
  --name "NYC-Office-MacMini-1"

Naming examples:

  • NYC-Office-MacMini-2 - Location + machine type
  • SF-QA-Lab-Linux-3 - Team + purpose
  • Berlin-Remote-MacPro - Remote office
  • Home-Sarah-MacBook - Home setup

Network Configuration

Standard Setup

Most networks work automatically. Device Node uses WebRTC for device streaming with automatic NAT traversal.

Restrictive Networks

If you’re behind a strict firewall or symmetric NAT, enable TURN relay:

bash
curl -fsSL https://app.devicelab.dev/device-node/YOUR_ORG_KEY | sh -s -- \
  --name "Tokyo-Office-Mac" \
  --enable-turn

Note: TURN relay routes traffic through third-party servers. Only enable if direct connection fails.

Network Detection

Device Node automatically detects your network type:

  • full_cone - Direct connection (no TURN needed)
  • restricted - Address restricted NAT
  • port_restricted - Port restricted NAT
  • symmetric - Requires TURN relay

Logs & Troubleshooting

Log Location

bash
# Main log file
./log/devicenode.log

# Device-specific logs
./log/device/

Common Issues

Device not appearing:

bash
# Android: Check ADB
adb devices

# iOS: Check device trust
xcrun xctrace list devices

Connection failed:

bash
# Check network connectivity
ping app.devicelab.dev

# Try with TURN relay
curl -fsSL https://app.devicelab.dev/device-node/YOUR_ORG_KEY | sh -s -- --enable-turn

Simulator not starting:

bash
# List available simulators
xcrun simctl list devices

# Boot manually if needed
xcrun simctl boot "iPhone 16"

Next Steps