Skip to main content

GET /api/devices

List all connected Android devices with detailed information. This endpoint fetches device properties (brand, model, IP) in parallel for optimal performance.

Response

devices
array
required
Array of connected device objects

Example Request

curl http://localhost:3000/api/devices
const response = await fetch('http://localhost:3000/api/devices');
const data = await response.json();
console.log(data.devices);

Example Response

{
  "devices": [
    {
      "serial": "ABC123456789",
      "status": "device",
      "label": "Samsung Galaxy S21",
      "ip": null,
      "wireless": false,
      "customName": "My Phone"
    },
    {
      "serial": "192.168.1.100:5555",
      "status": "device",
      "label": "Xiaomi Redmi Note 10",
      "ip": "192.168.1.100",
      "wireless": true,
      "customName": null
    }
  ]
}

Implementation Notes

  • Devices are fetched using adb devices
  • Brand and model are retrieved with getprop ro.product.manufacturer and getprop ro.product.model
  • For wireless devices, IP is extracted from serial or ip route output
  • Saved devices are automatically updated when a matching IP is detected
  • All device property fetches are parallelized for performance

GET /api/devices/poll

Lightweight endpoint to quickly get the list of connected device serials. This is faster than /api/devices as it skips property fetching.
Use this endpoint for frequent polling to detect device connections/disconnections without the overhead of fetching device properties.

Response

serials
string[]
required
Array of device serial numbers

Example Request

curl http://localhost:3000/api/devices/poll
const response = await fetch('http://localhost:3000/api/devices/poll');
const data = await response.json();
console.log(data.serials);
// ["ABC123456789", "192.168.1.100:5555"]

Example Response

{
  "serials": [
    "ABC123456789",
    "192.168.1.100:5555"
  ]
}

GET /api/devices/:serial/info

Get detailed hardware and software information for a specific device.

Path Parameters

serial
string
required
Device serial number (must be URL-encoded if it contains special characters like :)

Response

serial
string
required
Device serial number
brand
string
required
Device manufacturer (e.g., "Samsung", "Xiaomi")
model
string
required
Device model name (e.g., "Galaxy S21")
android
string
required
Android version (e.g., "13")
sdk
string
required
Android SDK level (e.g., "33")
device
string
required
Device codename (e.g., "SM-G991B")

Example Request

curl http://localhost:3000/api/devices/ABC123456789/info
const serial = 'ABC123456789';
const response = await fetch(`http://localhost:3000/api/devices/${serial}/info`);
const data = await response.json();

Example Response

{
  "serial": "ABC123456789",
  "brand": "Samsung",
  "model": "Galaxy S21",
  "android": "13",
  "sdk": "33",
  "device": "SM-G991B"
}

Error Response

Returns 500 if device is not connected or ADB command fails:
{
  "error": "Command failed: adb ..."
}

GET /api/network/ip

Get local network interface IP addresses. Useful for displaying the IP address users should connect to for wireless debugging.

Response

addresses
array
required
Array of network interface objects

Example Request

curl http://localhost:3000/api/network/ip
const response = await fetch('http://localhost:3000/api/network/ip');
const data = await response.json();
console.log(data.addresses);

Example Response

{
  "addresses": [
    {
      "name": "Wi-Fi",
      "address": "192.168.1.50"
    },
    {
      "name": "Ethernet",
      "address": "192.168.0.100"
    }
  ]
}

Implementation Notes

  • Only returns IPv4 addresses
  • Excludes internal/loopback interfaces (127.0.0.1)
  • Uses Node.js os.networkInterfaces() API

Build docs developers (and LLMs) love