百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
A

Airtest

> 测试质量
开源

UI 游戏和应用程序自动化框架

9.5K stars0 点赞3 次浏览
访问官网GitHub

工具介绍

UI 游戏和应用程序自动化框架

Airtest ·

Cross-Platform UI Automation Framework for Games and Apps

跨平台的UI自动化框架,适用于游戏和App (中文版点这里)

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.

bash
pip install -U airtest

On MacOS/Linux platform, you need to grant adb execute permission.

bash
# 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.
  2. Then perform simulated input to automate your game or app.
  3. 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.

bash
# 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 .air dir" --device "Windows:///?title_re=Unity.*"

# generate HTML report after running cases
airtest report "path to your .air dir"

# or use as a python module
python -m airtest run "path to your .air dir" --device Android:///

Try running provided example case: airtest/playground/test_blackjack.air and see Usage of CLI. Here is a multi-device runner sample.

Contribution

Pull requests are very welcome.

Thanks

Thanks for all these great works that make this project better.

  • stf
  • atx
  • pywinauto

Issues· 486 开放

查看全部 Issues在 GitHub 打开
  • #1328

    在 Androd 11 之后,get_render_resolution 返回的值不正确

    更新于 2026年8月2日
  • #1327

    在执行 airtest 时,会出现许多类似“Poco 连接断开”的错误,导致自动化任务无法正常运行。

    更新于 2026年6月4日
  • #1325

    目前 android 微信的最新版本的发送消息框使用 AirTestIDE 无法识别

    更新于 2026年5月27日
  • #1326

    airtest.netease官网打不开,无法下载ide

    更新于 2026年5月26日
  • #1324

    调用 snapshot 截图后的图片显示有问题

    更新于 2026年4月30日
  • #1310

    airtestIDE 横屏游戏错误显示为竖屏

    更新于 2026年4月28日
  • #1323

    airtetest Yosemite.apk 是否开源

    更新于 2026年4月28日
  • #1322

    airtest 是否支持局域网下的 ios 自动化?

    更新于 2026年4月28日
  • #1321

    ADB.push() 通过扩展名错误解析文件/目录,导致 minicap 安装失败

    更新于 2026年4月20日
  • #1314

    一直使用 ADB 屏幕截图

    更新于 2026年3月29日

> 标签

Pythonandroidautomated-testingautomationgame

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月29日
分类测试质量
定价开源

> 相关工具

J
Jest
JavaScript 测试框架
P
Playwright
现代端到端测试框架
E
eslint-plugin-test-selectors
Enforces that data-test-id attributes are added to interactive DOM elements (JSX) to help with UI testing. JSX only.