Skip to main content

A python module to automate android

Project description

Autodroid

pip install autodroid

Usage

device = ur serial number (the device u wanna control)

swipe()

swipe(x1, y1, x2, y2, duration, device=xxxxxxxxxxxxxxx) x1, y1, x2, y2 = position, from - to (must be integer) duration = amount of time swiped (in milliseconds not seconds)

Example:

swipe(520, 1730, 520, 400, 1000)

tap()

tap(x, y, device=xxxxxxxxxxxx) x, y = position (must be integer)

Example:

tap(173, 200)

screenshot()

screenshot(device=xxxxxxxx) saves to /sdcard/autodroid/screencap

holdtap()

holdtap(x, y, duration, device=xxxxx) x, y = position (must be integer) duration = amount of time held (in milliseconds)

Example:

holdtap(167, 853, 4000, device=ABCD123)

type()

type(text, device=xxxxxxxxxxxxxxxx) text = the text you want to type (must be string)

Example:

type("hello world", device="abcd1234")

get_connected_devices()

get_connected_devices() prints the connected device S/N

scrcpy()

scrcpy(device=xxxxx) starts a session of scrcpy

key()

key(device=xxxxx) executes a key event

Key Name Alternate Names Key Code
Home 3
Back 4
Recent Apps recent, recents 187
Power pwr 26
Volume Up v_up, vol_up 24
Volume Down v_down, vol_down 25
Mute 164
Media Play mplay, play 85
Wake wakeup 224

Example:

key("pwr", device=xxxxxxxxx)

ADDED MULTI-DEVICE SUPPORT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

autodroid-3.tar.gz (1.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

autodroid-3-py3-none-any.whl (1.8 kB view details)

Uploaded Python 3

File details

Details for the file autodroid-3.tar.gz.

File metadata

  • Download URL: autodroid-3.tar.gz
  • Upload date:
  • Size: 1.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for autodroid-3.tar.gz
Algorithm Hash digest
SHA256 bd1919c70a56353d49262222f9fca76f1d2db5cd005d3023ae8e5af4de4d8e03
MD5 344f2c5951458bdb1054071efc2d34fa
BLAKE2b-256 aa27bd873afc73577620098cd66e79d177719ba301813e485b795926150bc397

See more details on using hashes here.

File details

Details for the file autodroid-3-py3-none-any.whl.

File metadata

  • Download URL: autodroid-3-py3-none-any.whl
  • Upload date:
  • Size: 1.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for autodroid-3-py3-none-any.whl
Algorithm Hash digest
SHA256 43d4d62fd2b4c66655dbd283be51cc4b6241905a397a593791174a1dcf778f73
MD5 d47e68b35109014a5185b076a71dfd43
BLAKE2b-256 b36f82f3d11e3db52c08bdb9b23a3a9afb7d834d24302b2cf123adce2bfedf81

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page