Package: adb-connector-python
PY-ADBThis is a package to command android device with Python, it useADB, so if you don't have it, plaese install it before.REQUIREMENTSPython > 3.7ADB# WINDOWSchocoinstalladb# LINUXsudoapt-getinstallandroid-tools-adb# MACbrewinstallandroid-platform-toolsBEFORE STARTING USING PY-ADB ENSURE YOU HAVE ENABLED DEVELOPER OPTIONSUsing PY-ADB is simple, just install adb-connector-pythonpipinstalladb-connector-python# create main.py fileEXAMPLES# in main.pyfromadb_connector_python.connectorimportPy_adbadb_connector=Py_adb()print(adb_connector.ADB_VERSION)#  1.0.41print(adb_connector.ADB_EXECUTABLE)# /usr/bin/adbBASIC INFOadb_connector.list_devices()# [ { "id":"fh8swx9cs", "status":"device" }, { "id":"2439vjsacs", "status":"unauthorized" } ]adb_connector.is_adb_running()# it runs on every action and raise exception if adb is not running# Trueadb_connector.get_first_avaiable_device()# { "id":"fh8swx9cs", "status":"device" }adb_connector.phone_data()# {#    "battery_data":{ "is_charging":True, "level":64 },#    "device_data":{ "model":"AS3D24SS", "android_version":13,"brand":"Redmi" },#    "status":{ "is_locked":True, "is_awake":False },#    "packages":{ "count":130, "list":["com.android.google.youtube", ... ] }# }adb_connector.start_logcat()# start android logadb_connector.start_logcat(term="Flutter")# only return log containing Flutter string# This can be useful for debug, for example creating a custom error and ther looking for itMANAGING APKadb_connector.install_apk(path="path/to/apk")adb_connector.uninstall_apk(package_name="com.android.google.youtube",device_id="2439vjsacs")SCREEN ACTIONS# swipe on the screen from points x100 y100 to x300 y300adb_connector.swipe(x_from=100,y_from=100,y_to=300,y_to=300)# tap on screen at cordinates x100 y100adb_connector.tap(x=100,y=100)adb_connector.home()# return to device homeadb_connector.back()# go backadb_connector.foreground_apps()# background app checkOPEN APPSadb_connector.open_call_log()adb_connector.open_calendar()adb_connector.open_music()adb_connector.open_calculator()adb_connector.open_email()adb_connector.open_browser()adb_connector.open_camera()# to see all supported app runadb_connector.SUPPORTED_APPSUSER ACTIONS# phone calladb_connector.call(phone_number="xxxxxxxx")# send smsadb_connector.send_sms(phone_number="xxxxxxxx",message="hello world")# unlock screenadb_connector.unlock_screen(password="12345")# lock screenadb_connector.power_button()# take screenshotadb_connector.screenshot()# input textadb_connector.insert_text("important data")# take a picture with frontal camera zoomming 5 timesadb_connector.take_picture(frontal_camera=True,zoom_in=5)# video capture with external camera for 10 seconds, zoomming 3 timesadb_connector.video_capture(zoom_out=3,duration=10)# activate voice assistant (ok google)adb_connector.voice_assistant()# toggle notification centeradb_connector.notification_center()OTHER ACTIONS# turn off device in 2 secondsadb_connector.turn_off(countdown=2)# reboot device in 10 secondsadb_connector.reboot(countdown=10)# raise / low volumeadb_connector.volume_up()adb_connector.volume_down(times=7)# do it 7 times# raise / low brightnessadb_connector.brightness_up(times=2)# do it 2 timesadb_connector.brightness_down()