Automatic Android Device Detection
Once you start Eggplant Gateway's Persistent Connection Service (PCS), it automatically detects any Android device that's connected to ADB on the host and creates a connection for it — you don't need to run epgw add android yourself, and you don't need to reconnect the device each time you plug it back in.
Starting PCS is also what makes your devices available to Eggplant Studio. Whether you plug in a new device or start PCS with devices already connected, they show up ready to use — in the PCS web UI, and in Eggplant Studio's connection list once EggCloud is enabled.
How It Works
While PCS is running, Eggplant Gateway keeps watch over the devices ADB knows about on the host. As soon as a device shows up ready to use which plugged in over USB with debugging authorized — Eggplant Gateway creates a connection for it automatically, under the gateway name android-auto. These auto-detected connections appear in the PCS web UI at localhost:5000 alongside any connections you added manually.
Detection is event-driven — a new connection appears within moments of plugging in a device, and it disappears automatically when the device is unplugged or ADB otherwise loses track of it.
Once adb devices lists the device, Eggplant Gateway detects and connects to it exactly like a USB device.
Auto-detected connections are created but not automatically started. Use the PCS web UI to start a connection, or configure it to connect automatically as described in Starting and Stopping Connections.
Manual Connections Take Priority
If you also add the same device manually (for example, with epgw add android --serial <serial>), Eggplant Gateway treats the manual connection as authoritative for that device:
- If the auto-detected connection for that serial is currently connected, it's stopped.
- The auto-detected connection is then removed, leaving only the manual connection.
This prevents the same physical device from appearing twice in PCS — once under android-auto and once under your manual connection name.
Requirements
Automatic detection requires:
- PCS is running. Start it with
epgw.exe service, as described in Starting PCS. This is the same command that makes your devices available to Eggplant Studio. - The device itself is set up for automation and visible to ADB — USB debugging enabled and authorized, as described in Enabling Automation on Your Android Device, or already connected over Wi-Fi ADB.
If Eggplant Gateway can't reach ADB on the host, it logs a warning and skips automatic detection; any connections you added manually are unaffected.
See Also
- Android Devices — Enable automation on a device and create a manual connection.
- Persistent Connection Service (PCS) — Start PCS and manage connections from the web UI.