HmTest is an open-source, general-purpose, and intelligent automated testing framework for HarmonyOS Next apps.
To run this project, ensure the following environment requirements are met:
- Operating System: Windows or macOS
- Python: Version 3.10 or higher
- Node.js: Version 16 or higher
- DevEco Studio: Version 5.0.0 or higher
Add hdc and hvigorw to your system's environment path and set the DEVECO_SDK_HOME environment variable to the HarmonyOS SDK directory.
For example:
- Path to hdc:
D:\DevEco Studio\sdk\default\openharmony\toolchains - Path to hvigorw:
D:\DevEco Studio\tools\hvigor\bin - Path to HarmonyOS SDK:
D:\DevEco Studio\sdk
Clone the project.
git clone https://github.com/sqlab-sustech/hmtest.gitInstall the dependencies in requirements.txt.
pip install -r requirements.txtOpen the Huawei device (HarmonyOS Next) and get the serial number of the specific device.
hdc list targetsTo run RL-based Exploration, run the command:
python main.py --serial {serial} --project_path {project_path} --bundle_name {bundle_name} --module_name {module_name} --product_name {product_name} --test_time {test_time} --seed {seed}For open-source apps, you need to specify the project_path, bundle_name and product_name.
To run Targeted Exploration, you need to enter the arkanalyzer folder and install the dependencies.
cd arkanalyzer
npm installAfter installing the dependencies, run the Targeted Exploration using the same command as RL-based Exploration.
Once the testing is completed, the results will be saved in the output folder.
Chen YG, Fan YJ, Wang SN et al. HmTest: Automated testing of HarmonyOS apps via model-driven navigation and reinforcement learning. JOURNAL OF COMPUTER SCIENCE AND TECHNOLOGY, 40(4): 1006−1021, July 2025. DOI:10.1007/s11390-025-5142-4.