Can I connect to an Android device for the first time with python adb, in USB debug mode, without having to manually allow the connection?

This is my code from python adb library:

signer = sign_cryptography.CryptographySigner(
        # Connect to the device
        device = adb_commands.AdbCommands()
        device.ConnectDevice(port_path=None, serial=deviceIP, rsa_keys=[signer])

When I call this piece of code, it opens the pop up message with "Allow USB debugging ..." on the device. Is there a way to go around this pop up?


1 Answer 1


This popup is there for security reasons and can't be bypassed without system manipulation (root required).

Without that dialog an Android device would be once the user activated ADB wide open to anyone who connects to the device via USB. Therefore since Android 4.2 if I remember correctly Google added the RSA based authentication on ADB level to avoid unauthorized data access via ADB.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .