Coder Social home page Coder Social logo

adb.py's Introduction

##adb.py Write your Android custom debug script easily with Python

Python ADB

###How to use First, you need to import adb.py library

from adb import ADB

Then, create your debug object

debug = ADB()

After you created debug object, you can use it to execute adb commands.

###Examples List all connected devices

print debug.devices()

Click POWER button to turn on screen

debug.call("shell input keyevent 26")

Upload a file to Device

debug.upload("D:/data.zip","/sdcard/dataCopied.zip")

Download a file from Device

debug.get("/sdcard/Download/arduino.pdf","D:/Books/Adruino.pdf")

Install APK file to Device

debug.install("D:/Games/com.gamarist.murimuri-jump.apk")

or

debug.install(("-r", "D:/Games/com.gamarist.number-tower.apk"))

Uninstall an application on device

debug.uninstall("com.colrist.kimchi")

Clear application data

debug.clearData("com.gamarist.murimuri")

Run an application

debug.start("com.gamarist.murimuri/.MainActivity")

or

debug.start(("com.gamarist.murimuri","MainActivity"))

Kill an application

debug.kill("com.gamarist.murimuri")

Execute shell command

debug.shell("input swipe 50 50 200 50")

Change screen resolution This is useful to test your application in multiple screen size

debug.screen("800x400")

To return to default resolution

debug.screen("reset")

Change screen DPI

debug.dpi("160")

Record screen to video file

debug.screenRecord("/sdcard/record/output.mp4")

By default, the recording will stop after 3 minutes. If you want to set the recording time, add a time parameter in seconds

debug.screenRecord(("60", "/sdcard/record/output.mp4"))

Take screenshot and save to local

debug.screenShot("D:/saved.png")

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.