Connect and Disconnect ADB to a Device

joelbyler edited this page Sep 4, 2012 · 1 revision

Connect to Device

connect will issue the android adb connect command using the default values for host (localhost), port (5555) and timeout.

ADB.connect

When attempting to connect to a device on a different port number, you can use the optional port argument.

ADB.connect(port=5557)

This operation also accept a timeout (seconds) argument which will throw an ADBError if the start_server command does not execute successfully within the allotted timeout period. The default timeout is 30 seconds. begin ADB.connect(120) rescue # handle the ADBError exception end

Disconnect ADB from a device

disconnect will issue the android adb disconnect command.

ADB.disconnect