a python3 library to communicate with your phone
Hey there! In relation to THIS library written in JAVA I decided to write another library in Python3.
I try to reach the same functionality as that JAVA lib and maybe even more. "Why Python3?" you may ask..
Because it's the language I love the most, it's platform-independent and has got a beautiful syntax.
It's in early stage and there are only some functions working right now which I will explain in another block.
- Install ADB-binary (only working on linux 64-bit for now)
- Reboot (system, recovery, bootloader)
- Execute shell commands and get output-lines as a list
- Get list of connected devices
- Get build.prop as a dictionary
I included a function called example wich will be automatically executed if you run adb_util.py.
It shows what you can do with that library. The installer isn't fully working yet, only in Linux 64bit systems.
In order to use adb_util.py the adb-binary has to be in ~/.andropy/bin.
Install adb via installer.py on Linux 64-bit machines
Just execute it like:
import andropy with andropy.ADBInterface() as ai: print(ai.exec_shell_cmd("ls /sdcard/"))
import andropy with andropy.ADBInterface() as ai: build_props = ai.get_build_props() print(build_props['ro.device.screen_res'])
Samle output from adb_util.py
marco@mk-think:~/src/andropy$ python3 adb_util.py # Welcome to AndroPy # ---------------------- Number of devices detected: 1 Number of your downloaded apps: 41 Your phone's CPU: 1.7 GHz quad-core Your phone's model: HTC m7ul
But as I mentioned it isn't nearly ready yet. Some of you maybe know how to use it in this state.
I will add features and more detailed instructions step by step.