Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from adb_shell.adb_device import AdbDeviceTcp, AdbDeviceUsb
- from adb_shell.auth.sign_pythonrsa import PythonRSASigner
- # Load the private and public keys (you can generate your own keys using the `adb_shell.auth.keygen` function)
- with open('path/to/adbkey') as f:
- priv = f.read()
- with open('path/to/adbkey.pub') as f:
- pub = f.read()
- signer = PythonRSASigner(pub, priv)
- # Connect to the device
- device = AdbDeviceTcp('192.168.0.222', 5555, default_timeout_s=9.)
- device.connect(rsa_keys=[signer], auth_timeout_s=0.1)
- # Install an APK
- with open('path/to/app.apk', 'rb') as fp:
- device.install(fp)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement