AirtestProject /Airtest
UI Automation Framework for Games and Apps
★ 9,656⑂ 1,456👁 214⑃ 145● 1,145▤ 26
+2
Daily
9,656
stars
1,456
forks
214
watchers
145
prs
1,145
issues
26
releases
README
Airtest ·
Cross-Platform UI Automation Framework for Games and Apps
跨平台的UI自动化框架,适用于游戏和App (中文版点这里)
!image
Features
Write Once, Run Anywhere: Airtest provides cross-platform APIs, including app installation, simulated input, assertion and so forth. Airtest uses image recognition technology to locate UI elements so that you can automate games and apps without injecting any code.
Fully Scalable: Airtest cases can be easily run on large device farms, using commandline or python API. HTML reports with detailed info and screen recording allow you to quickly locate failure points. NetEase builds Airlab on top of the Airtest Project.
AirtestIDE: AirtestIDE is an out of the box GUI tool that helps to create and run cases in a user-friendly way. AirtestIDE supports a complete automation workflow: create - run - report.
Poco: Poco adds the ability to directly access object(UI widget) hierarchy across the major platforms and game engines. It allows writing instructions in Python, to achieve more advanced automation.
Get started from airtest homepage
Supported Platforms
Installation
Use pip to install the Airtest python library.
Shell
pip install -U airtest
On MacOS/Linux platform, you need to grant adb execute permission.
Shell
for mac
cd {your_python_path}/site-packages/airtest/core/android/static/adb/mac
for linux
cd {your_python_path}/site-packages/airtest/core/android/static/adb/linux
chmod +x adb
Download AirtestIDE from our homepage if you need to use the GUI tool.
Documentation
You can find the complete Airtest documentation on readthedocs.
Examples
Airtest aims at providing platform-independent API so that you can write automated cases once and run it on multiple devices and platforms.
1. Using connect_device API you can connect to any android/iOS device or windows application.
1. Then perform simulated input to automate your game or app.
1. DO NOT forget to make assertions of the expected result.
Python
from airtest.core.api import
connect an android phone with adb
init_device("Android")
or use connect_device api
connect_device("Android:///")
install("path/to/your/apk")
start_app("package_name_of_your_apk")
touch(Template("image_of_a_button.png"))
swipe(Template("slide_start.png"), Template("slide_end.png"))
assert_exists(Template("success.png"))
keyevent("BACK")
home()
uninstall("package_name_of_your_apk")
For more detailed info, please refer to Airtest Python API reference or take a look at API code
Running .air cases from CLI
Using AirtestIDE, you can easily create automated cases as .air directories.
Airtest CLI provides the possibility to execute cases on different host machines and target device platforms without using AirtestIDE itself.
Shell
run cases targeting on Android phone connected to your host machine via ADB
airtest run "path to your .air dir" --device Android:///
run cases targeting on Windows application whose title matches Unity.
airtest run "path to your Top issues
#470Airtest adb.exe runs code 200x faster than Python adb.exe. 23 comments · 2019-07-22#255运行脚本时报minitouch setup timeout错误21 comments · 2019-01-03#585iOS设备打开横屏app,定位到元素后无法点击14 comments · 2019-10-30#322airtest 如何 ios 设备多设备调试13 comments · 2019-03-15#274【ios模拟器】localhost:8100连接成功后,执行air脚本,报错:FileNotFoundError: [Errno 2] No such file or directory: 'iproxy': 'iproxy'13 comments · 2019-02-15#396Airtest在linux上面执行提示http里面提示json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0),执行失败12 comments · 2019-05-10#369无法正常识别Cocos-lua打出来的windows程序中的图片11 comments · 2019-04-22#131Failed to establish a new connection11 comments · 2018-08-11
Latest release
v1.4.3 v1.4.3 2025-12-04锁定facebook-wda版本