GithubHelp home page GithubHelp logo

lychhayly / android_controller Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bennbuildvgc/android_controller

0.0 0.0 1.0 10 KB

A python module to control your android phone

License: MIT License

Python 100.00%

android_controller's Introduction

PyPI - Python Version GitHub

android-controller

A python module to control your android phone

Installation

Prerequisites

Using PyPi (recommended)

Open a command prompt and run:

pip install android_controller

From source

Open a command promp and clone this repo. Now cd to that folder and run:

pip install .

Usage

The package can be imported using:

import android_controller

Most of the times devices connect to adb automatically, but if they don't you can use:

android_controller.connect(host) #host is where your device is connected to. For example, bluestacks would be localhost:5555

You can then check which devices are connected using:

connections = android_controller.checkConnections()

This will return a list with the names of all connected devices. Please make sure you only have one device connected, otherwise the module might not work properly.

Documentation

android_controller.checkConnections()

Returns a list of all devices currently connected.

android_controller.connect(host: str)

Connects to the chosen host.

android_controller.disconnect(host: str)

Disconnects from the chosen host. If no host is defined, disconnects from all hosts.

android_controller.keyEvent(key: str, longpress: bool)

Executes a keyevent. Set longpress to True for a longpress.

android_controller.screenshot(outputpath: str)

Makes a screenshot and saves it at the defined location.

android_controller.swipe(x1: int, y1: int, x2: int, y2: int)

Swipes from the first location to the second location.

android_controller.tap(x: int, y: int)

Taps at the defined location.

Distributing

All distributions are welcome. There are quite some functions that are less commonly used I left out, but they can of course still be added.

License

This project is licensed under the MIT license.

android_controller's People

Contributors

bennbuildvgc avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.