Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adb over network without previous USB pairing

Tags:

android

adb

I have an android 4.2.2 that requires the ADB connection to match an approved fingerprint.

The problem is that the device need to be paired using a USB cable the first time which in my situation will be a problem.

My development environment is running in VirtualBox and I have previously given up trying to get USB to work and instead used the ADB over the network.

The Android SDK Platform-tools is the latest 1601.

Is there any way for me to manually add the key from the virtual machine to my device?

I have a working Android SDK on my host and root access to my device if that can be used to fix this.

like image 583
hultqvist Avatar asked Apr 01 '13 16:04

hultqvist


People also ask

Can ADB work without USB debugging?

To use adb with a device connected over USB, you must enable USB debugging in the device system settings, under Developer options. To use adb with a device connected over Wi-Fi, see Connect to a device over Wi-Fi. On Android 4.2 and higher, the Developer options screen is hidden by default.

Can you use ADB without USB?

You can run ADB in Wireless Mode. means no USB-cable connection is required.


1 Answers

This solution requires root on the device.

From the development machine, copy the single line from $HOME/.android/adbkey.pub.

QAAAAJk..................QA= @myhost

And append it to /data/misc/adb/adb_keys on your android device. adb_keys contain one key per line so if you previously have paired any other machines they will show up here.

Restart the device.

like image 151
hultqvist Avatar answered Oct 05 '22 08:10

hultqvist