From f8acd4691475667bca0d4a7de7b10c7cd833ae30 Mon Sep 17 00:00:00 2001 From: Wesley van Tilburg Date: Mon, 13 Oct 2025 19:21:06 +0200 Subject: [PATCH] adb: pair/connect support --- adb.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/adb.go b/adb.go index f68dcb5..59e1272 100644 --- a/adb.go +++ b/adb.go @@ -6,6 +6,19 @@ import ( "strings" ) +// Pair a device using the 6 digit code +func PairDevice(endpoint string, code string) error { + _, err := ExecuteCommand(fmt.Sprintf("pair %s %s", endpoint, code)) + return err +} + +// Connect to a device +func ConnectDevice(endpoint string) error { + //todo: check if the device is paired before connecting + _, err := ExecuteCommand("connect " + endpoint) + return err +} + // Get the already connected adb devices func GetConnectedDevices() ([]Device, error) { var devices []Device