An easy way to control Android (TV) devices remotely using Python
Examples
·
Report Bug
·
Request Feature
Table of Contents
Like any project, this one have started to solve a simple problem,
So here it is, a simple solution (or kind of), just using Python and Google's Android Debug Bridge. Of course is possible to use this to control any android device, not just the ones running AndroidTV. Using a device like a Raspberry Pi, you can easily control a lot of Android devices with Alexa, for example, and create routines; since Alexa is not natively compatible (yet?!) with AndroidTV and Chromecast devices.Clone this project and you're done:
git clone https://github.com/luis-gustta/adbtv.git
Using pip
:
python -m pip install adbtv
or:
python -m pip install git+https://github.com/luis-gustta/adbtv.git
The following modules are requirements to AdbTV:
-
os
andtime
-
typing
:python3 -m pip install typing
Also, you (of course) must have ADB installed.
Windows users:
If you're using Windows, you can download it from: https://developer.android.com/studio/releases/platform-tools.
Linux users:
If you're using Linux, you can download it using:
-
Debian-based Linux:
sudo apt install android-tools-adb
-
Fedora/SUSE-based Linux:
sudo yum install android-tools
This module was built to be simple and intuitive, every function have a little "documentation" and is very easy to use. Here's an example:
import adbtv as adb
adb.connect('ip','port')
adb.shell_cmd('echo hello world')
Because the main focus of this module is to control AndroidTV systems, most commands have been optimized for this. Another example:
import adbtv as adb
adb.connect('ip','port')
adb.launch_app('NETFLIX')
More examples about usage can be found under the examples folder.
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Luis Gustavo - lang.gaiato@ufrgs.br
Project Link: https://github.com/luis-gustta/adbtv/