Skip to main content

GET /api/status

Check if ADB is configured and get the current ADB executable path.

Response

configured
boolean
required
Whether ADB is configured and ready to use
adbPath
string | null
required
Full path to the ADB executable, or null if not configured

Example Request

curl http://localhost:3000/api/status
const response = await fetch('http://localhost:3000/api/status');
const data = await response.json();
console.log(data);
// { configured: true, adbPath: "C:\\platform-tools\\adb.exe" }

Example Response

{
  "configured": true,
  "adbPath": "C:\\platform-tools\\adb.exe"
}

DELETE /api/config

Clear the saved ADB configuration. This removes the stored path and resets the cache.

Response

ok
boolean
required
Always returns true

Example Request

curl -X DELETE http://localhost:3000/api/config
const response = await fetch('http://localhost:3000/api/config', {
  method: 'DELETE'
});
const data = await response.json();
// { ok: true }

Example Response

{
  "ok": true
}

POST /api/config/path

Set the path to the ADB executable. The path will be validated to ensure the file exists.

Request Body

path
string
required
Full path to the ADB executable (e.g., C:\platform-tools\adb.exe)

Response

ok
boolean
required
Whether the path was saved successfully
adbPath
string
required
The saved ADB executable path

Error Response

Returns 400 Bad Request if the path is invalid or the file doesn’t exist:
{
  "error": "Ruta inválida o no existe"
}

Example Request

curl -X POST http://localhost:3000/api/config/path \
  -H "Content-Type: application/json" \
  -d '{"path": "C:\\platform-tools\\adb.exe"}'
const response = await fetch('http://localhost:3000/api/config/path', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ path: 'C:\\platform-tools\\adb.exe' })
});
const data = await response.json();
// { ok: true, adbPath: "C:\\platform-tools\\adb.exe" }

Example Response

{
  "ok": true,
  "adbPath": "C:\\platform-tools\\adb.exe"
}

GET /api/config/download

Download and install Android Platform Tools automatically. This endpoint uses Server-Sent Events (SSE) to stream progress updates.
This endpoint is Windows-only and downloads ADB to C:\platform-tools\.

Response Format

This endpoint returns a Server-Sent Events stream with Content-Type: text/event-stream. Each event contains:
msg
string
required
Progress message describing the current step
done
boolean
required
Whether the installation is complete

Progress Messages

  1. Descargando Android Platform Tools...
  2. Descarga completa. Extrayendo...
  3. ✅ ADB instalado en C:\platform-tools (success)
  4. ❌ Error al descargar: [error] (failure)
  5. ❌ Error al extraer. Intenta manualmente. (failure)

Example Request

const eventSource = new EventSource('http://localhost:3000/api/config/download');

eventSource.onmessage = (event) => {
  const data = JSON.parse(event.data);
  console.log(data.msg);
  
  if (data.done) {
    eventSource.close();
    console.log('Installation complete!');
  }
};

eventSource.onerror = () => {
  console.error('Connection error');
  eventSource.close();
};

Example Response Stream

data: {"msg":"Descargando Android Platform Tools...","done":false}

data: {"msg":"Descarga completa. Extrayendo...","done":false}

data: {"msg":"✅ ADB instalado en C:\\platform-tools","done":true}

Implementation Details

  • Downloads from: https://dl.google.com/android/repository/platform-tools-latest-windows.zip
  • Downloads to: %TEMP%\platform-tools.zip
  • Extracts to: C:\platform-tools\
  • Automatically configures ADB path on success
  • Cleans up temporary files after installation

Build docs developers (and LLMs) love