03 - ADB connection - Linux - Android

update 29 aug 2024

We now have every tools to connect a local device to computer. However, a device is not able to accept connection without a preparation step.

Prepare local device

An access to Android developer options is needed:

  • Go to the Android device settings

  • Go to About phone > Software information section

  • Tap 7 times on section Build Number. A pop-up confirms activation.

  • Go back to Settings / Developer options

  • Activate USB debugging option

The procedure can vary widely from a device to another. Please follow the official Android tutorial for more information. Configure on-device developer options.

Connect device via USB

  • Connect the device to a computer via an USB cable

  • Run the following commands to verify USB connection:

adb kill-server adb devices

adb kill-server is not mandatory, but restart adb helps to prevent connection problems.

The device appears on the list as unauthorized:

Image44.png
  • The device should be detected. A pop-up Allow USB debugging? should appear on device. Click on Allow:

It’s possible to check Always allow for this computer to avoid to Allow at every connection. However, please note it's a less secure way.

  • Run the following command again to update devices list:

adb devices

Device is now listed as device and successfully connected:

Connect device via WIFI

USB connection is fast and reliable. However, USB wire supplies power to the device. Local energy measurements are not possible in this configuration. It’s also possible to transform this USB ADB connection into a wireless ADB connection.

  • Please ensure that computer and device are connected to the same Wifi network.

  • Run the following command in command prompt:

adb tcpip 5555

System confirms the restarting in TCP mode:

  • Disconnect now USB cable from the device

  • Find the IP address of the device in connection settings

  • Run the following command to establish network connection:

System confirms the connection:

  • Verify network connection with the following command:

You should see your device now identified with its IP:

Â