An Android automation framework.
Project description
Cerium
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:ffujiawei/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).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file cerium-1.2.6.tar.gz
.
File metadata
- Download URL: cerium-1.2.6.tar.gz
- Upload date:
- Size: 853.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c32c160e4a35fc77064f2368a076058ed1f740afa8b59ee27e6a9e6450b291cd |
|
MD5 | 77f7b87bb37bfaec4caa6bb78861682c |
|
BLAKE2b-256 | 71e26c6f28d166068101409c21276c6801751d1e1894434dea429a8ba113a956 |
File details
Details for the file cerium-1.2.6-py3-none-any.whl
.
File metadata
- Download URL: cerium-1.2.6-py3-none-any.whl
- Upload date:
- Size: 859.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 036195eda311ab028b246e0ddc9b6f44741db53708a0edf9dd140eb7cd2437e8 |
|
MD5 | 668d2fc7c48a0986f3914cf5991b565e |
|
BLAKE2b-256 | c939c17cb2a920a0e666a5fd7f1baa47474bbc00cb3d75543a75a026150a6e13 |