Skip to content

luis-gustta/adbtv

Repository files navigation

Contributors Forks Stargazers Issues MIT License


Logo

ADB Python Module

An easy way to control Android (TV) devices remotely using Python

Examples · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Contributing
  5. License
  6. Contact
  7. Acknowledgements

About The Project

Like any project, this one have started to solve a simple problem,

"How can I integrate my AndroidTV with smart home applications, without using Google Home"
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.

Getting Started

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

Prerequisites

The following modules are requirements to AdbTV:

  • os and time

  • typing:

    python3 -m pip install typing

ADB:

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

Usage

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.

Contributing

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.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Luis Gustavo - lang.gaiato@ufrgs.br

Project Link: https://github.com/luis-gustta/adbtv/

Acknowledgements