Mobile Development 6 min read

Using Maxim for Multi‑Device Parallel Monkey Stress Testing on Android Apps

This article introduces Maxim, a monkey‑based Android stress‑testing tool that supports fine‑grained scenario control, multi‑device parallel execution, blacklist/whitelist configuration, and special event handling, and provides step‑by‑step instructions with screenshots for practical use.

360 Quality & Efficiency
360 Quality & Efficiency
360 Quality & Efficiency
Using Maxim for Multi‑Device Parallel Monkey Stress Testing on Android Apps

Preface : Many Android testers are familiar with the built‑in monkey tool for stress testing, but it lacks fine‑grained scenario control. Maxim is a monkey‑derived utility that enables high‑speed clicks, scenario granularity, prevents device sleep, avoids app exit, and more. The source code is available at https://github.com/zhangzhao4444/Maxim .

1. Specific Process

(1) Multi‑device uninstall and install test package : Detect the number of connected devices; if a device already has the same package name installed, uninstall it and reinstall the new APK.

(2) Package Maxim : The command method wraps the shell commands needed for Maxim’s command‑line mode. Important parameters include package (the app’s package name), runtime (total duration in minutes), and mode (monkey execution mode such as uiautomator , mix , uiautomatordfs , uiautomatortroy ). Blacklist/whitelist support and event throttling can also be configured. The run_monkey method pushes these configurations to each device.

(3) Multi‑threaded execution of Maxim : Launch multiple threads to run monkey on several devices simultaneously, and output crash logs to a designated directory.

2. Maxim’s blacklist and special‑event usage

2.1 Blacklist : By editing the awl.string file you can force monkey to enter or avoid specific activities. Activity names can be obtained via:

adb shell dumpsys activity top | findstr ACTIVITY

Android Studio log analysis (see screenshot)

Manual adb logcat capture (save to a file, then inspect)

After determining the desired activity, set blacklist or whitelist to True in Maxim’s configuration.

2.2 Special events : To click a specific button while ignoring other UI elements, define actions in max.xpath.actions . UI element locators (XPath or resource‑id) can be obtained via:

Android SDK’s uiautomatorviewer

Appium’s Inspector

Example configuration sets prob=1 (100% execution) for the btn_reward_show button when the current activity is RewardActivity .

Summary : The above provides a concise guide to using Maxim for Android app stress testing, including multi‑device deployment, command packaging, multi‑thread execution, blacklist handling, and special‑event configuration. Feel free to reach out with any questions.

Androidmobile automationparallel testingMaximMonkey TestingApp Stress Test
360 Quality & Efficiency
Written by

360 Quality & Efficiency

360 Quality & Efficiency focuses on seamlessly integrating quality and efficiency in R&D, sharing 360’s internal best practices with industry peers to foster collaboration among Chinese enterprises and drive greater efficiency value.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.