Node package with Express server
npm install farm-runnerNode server package for the Device Farm project - connects devices to the hub for distributed testing.
All documentation has been consolidated in the main README.
Please refer to the main README for:
- Node Configuration - Complete configuration reference
- Embedded Appium Server - Built-in Appium server setup
- ADB Log Capture - Automatic Android log capture
- iOS Automation Setup - WebDriverAgent preparation
- Node Liveness & Heartbeat System - How nodes stay connected
- Available Scripts - Commands to run the node server
After installing farm-runner globally or locally:
``bashInstall globally
npm install -g farm-runner
$3
`bash
Copy and edit the configuration file
cp packages/node/node.config.example.json packages/node/node.config.jsonEdit node.config.json with your hub credentials
Then start the node server
npm run start:node
`$3
`bash
Copy and edit the configuration file
cp node.config.example.json node.config.jsonEdit node.config.json with your hub credentials
Then start the server
npm run startOr use the CLI in development
npm run cli -- run prepare-wda
`🔧 Minimal Configuration
Create
packages/node/node.config.json:`json
{
"hubUrl": "http://localhost:3000",
"accessKey": "YOUR_ACCESS_KEY",
"token": "YOUR_TOKEN",
"name": "My Node"
}
`The node will automatically:
- Detect and register connected devices
- Start an embedded Appium server
- Send heartbeats to the hub
- Process automation requests
🖥️ CLI Commands
When installed as
farm-runner, the following commands are available:$3
`bash
Default command - starts the node server
farm-runner
farm-runner startWith custom configuration file
farm-runner start --config /path/to/node.config.json
`$3
`bash
Interactive mode - prompts for options
farm-runner run prepare-wdaWith mobile provisioning profile
farm-runner run prepare-wda -m ~/Library/MobileDevice/Provisioning\ Profiles/profile.mobileprovisionWith custom WDA project path
farm-runner run prepare-wda -p ~/WebDriverAgentSpecify platform (ios, tvos, or both)
farm-runner run prepare-wda --platform iosComplete example with all options
farm-runner run prepare-wda -m ./profile.mobileprovision -p ./WebDriverAgent --platform bothShow help
farm-runner run prepare-wda --help
`The
prepare-wda command will:1. Build and sign WebDriverAgent with your provisioning profile
2. Create a
.ipa` file- Device Detection: Automatically discovers connected Android and iOS devices
- Appium Integration: Runs an embedded Appium server (no global installation needed)
- Hub Communication: Registers with the hub and maintains connection via heartbeats
- Session Management: Creates and manages Appium sessions on local devices
- Log Capture: Automatically captures device logs (ADB logcat for Android)
- Capability Processing: Handles device-specific capabilities like WDA for iOS
- Complete Configuration: See Node Configuration in main README
- Database Setup: See Database Setup in main README
- iOS Setup: See iOS Automation Setup in main README
- Heartbeat System: See Node Liveness & Heartbeat System in main README
MIT