Skip to main content

Cerium

Platform PyPI version Wheel Python version License Documentation status

Cerium is an umbrella project encapsulating a variety of tools and libraries enabling android automation.

Cerium's source code is made available under the Apache 2.0 license.

Welcome to Read the Docs for Cerium!

Introduction

Cerium: A Toy for Android Automation

Cerium is an Android automation framework for Python, safe for human consumption.

Behold, the power of Cerium:

>>> from cerium import AndroidDriver
>>> driver = AndroidDriver()
>>> driver.unlock(1997)   # unlock your device by password
>>> driver.auto_connect()   # connect to your device via TCP/IP automatically
Now you can unplug the USB cable, and control your device via WLAN.
>>> driver.view_packgets_list(keyword='tencent')
['com.tencent.mm', 'com.tencent.android.qqdownloader', 'com.tencent.tim']
>>> driver.make_a_call(18268237856)   # call me

Cerium allows you to send organic, grass-fed commands, without the the need for manual labor.

Android Debug Bridge (adb) is a versatile command line tool that lets you communicate with an emulator instance or connected Android-powered device. This project is based on it.

Supported Python Versions

  • Python 3.6+

Supported Platforms

  • Windows 10 (Other platforms have not been tested and are not intended to be supported for the time being officially)

Installation

If you have pip on your system, you can simply install or upgrade cerium:

pip install -U cerium

Alternately, you can download the source distribution from PyPI, unarchive it, and run:

python setup.py install

Or by github.com:

git clone git@github.com:fjwCode/cerium.git
cd cerium
python setup.py install

Note: You may want to consider using virtualenv to create isolated Python environments.

Android Debug Bridge

Cerium requires Android Debug Bridge Tool to with the chosen android device. And Cerium contains Android Debug Bridge by default. You don't need to set the environment variable by yourself.

Quickstart

  • List connected android devices or simulator.
  • Show the version of Android Debug Bridge.
from cerium import AndroidDriver

driver = AndroidDriver()

print(driver.devices())
print(driver.devices_l())  # show devices and models

print(driver.version())
  • Copy local files/directories to device.
  • Copy files/directories from device.
  • Taking a screenshot of a device display, then copy it to your computer.
from cerium import AndroidDriver

driver = AndroidDriver()

driver.push(local='README.md', remote='/sdcard/README.md')
driver.pull(remote='/sdcard/README.md', local='README.md')

driver.pull_screencap(local='screencap.png')
  • Simulate finger click.
  • Simulate finger slide.
  • Input text.
from cerium import AndroidDriver

driver = AndroidDriver()

driver.click(100, 100)
driver.swipe(100, 200, 100, 100, duration=100)
driver.send_keys("I'm White Turing.")

Demonstration

Author

Cerium is written and maintained by White Turing (fujiawei@stu.hznu.edu.cn).

Metadata

Release files for cerium 1.2.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cerium 1.2.5
File Size Uploaded Provenance Actions
cerium-1.2.5.tar.gz 853.1 kB Without provenance Details for cerium-1.2.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cerium 1.2.5
File Interpreter ABI Platform Actions
cerium-1.2.5-py3-none-any.whl Python 3 none any Details for cerium-1.2.5-py3-none-any.whl

Total release size: 1.7 MB

Release files / cerium-1.2.5.tar.gz

Download URL cerium-1.2.5.tar.gz
Size 853.1 kB
Tags Source
SHA-256 checksum
How to use checksums
abeadd57b661d3b202052d61a921618a28c6ec72f6808fa8da22a878ae6fa1bf
BLAKE2b-256 checksum
How to use checksums
f2b4c67047133e0966cc66e4ef576789fb0d534ec3f0a07f8eb5790e7340b8ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.1

Release files / cerium-1.2.5-py3-none-any.whl

Download URL cerium-1.2.5-py3-none-any.whl
Size 859.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7823bbf1393ab612167867feaf23875216f688da0c91274de775ec54ca893057
BLAKE2b-256 checksum
How to use checksums
9c6a69ac83ccc3f52987073a47070d3e2e696dc7ce96cfc00f03674889ae2109
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.1

Security for cerium 1.2.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page