-
Android SDK Platform-Tools (for ADB)
- Download: https://developer.android.com/studio/releases/platform-tools
- Ensure
adbis in your PATH
-
Scrcpy (for screen mirroring)
- Download: https://github.com/Genymobile/scrcpy/releases
- Or install via package manager:
- Windows:
scoop install scrcpy - macOS:
brew install scrcpy - Linux:
apt install scrcpy(or equivalent)
- Windows:
-
Node.js and Electron (already installed via npm)
- Enable Developer Options on your Android device
- Enable USB Debugging in Developer Options
- Connect device via USB cable
- Authorize the computer when prompted on device
# Check ADB
adb version
adb devices
# Check Scrcpy
scrcpy --version
# Check Node.js and dependencies
npm list# This should show your connected device
adb devicesExpected output:
List of devices attached
ABCD123456 device
npm startWhen no devices are connected:
- App should show the "Devices not detected" screen
- Links to USB debugging help and scrcpy download should be visible
When devices are connected:
- Device list should appear with device brand, model, and ID
- Clicking on a device should:
- Show visual feedback ("Conectando..." status)
- Trigger IPC communication
- Attempt to execute scrcpy for that device
- If scrcpy unavailable, fallback to ADB connection test
Check the Electron console for:
Device selected: [DEVICE_ID]
Executing device control for device: [DEVICE_ID]
Starting scrcpy for device: [DEVICE_ID]
Scrcpy started for device [DEVICE_ID]
Or if scrcpy is not available:
Scrcpy not found in PATH
Scrcpy not available, trying alternative methods...
Alternative connection successful: Device connected successfully
- Click device → Visual feedback appears
- Scrcpy window opens showing device screen
- Device can be controlled via mouse/keyboard
- Console shows successful execution logs
- Click device → Visual feedback appears
- Console shows scrcpy unavailable message
- ADB connection test runs successfully
- User guidance provided about installing scrcpy
- Invalid device IDs are rejected
- Connection errors are logged
- User-friendly error messages provided
- Ensure USB debugging is enabled
- Try different USB cable/port
- Check device authorization
- Restart ADB:
adb kill-server && adb start-server
- Verify scrcpy is in PATH
- Test manual execution:
scrcpy -s [DEVICE_ID] - Check device compatibility
- Check console for JavaScript errors
- Verify all files are present
- Restart the application
The execution flow follows this pattern:
UI Click → IPC Message → Execution Handler → Scrcpy/ADB → Device Control
Files involved:
app/device.js- UI and user interactionipc.js- Inter-process communication and execution logicmain.js- Electron main processapp/index.js- Device detection and React app