Mobile Development 14 min read

Design and Implementation of an Automated IM Entry Inspection Tool for Mobile Apps

This article presents the design, technical selection, and system architecture of an automated IM entry inspection tool built with AutoJs for Android, detailing script stability strategies, dynamic script distribution, JSON and image comparison methods, and the achieved benefits and future enhancements for mobile app monitoring.

HomeTech
HomeTech
HomeTech
Design and Implementation of an Automated IM Entry Inspection Tool for Mobile Apps

Project Background – The IM instant communication tool generates many traffic entry points across various platforms, making manual verification of entry visibility and style changes impractical. An automated inspection tool is needed to ensure entry stability and detect anomalies efficiently.

Expected Goals – Detect whether each IM entry is displayed correctly, identify style changes, capture screenshots, and notify product operators automatically without human intervention.

Technical Selection – Evaluated Appium, Macaca, Airtest, and AutoJs. Chose AutoJs because it runs directly on Android via AccessibilityService, eliminating the need for a PC‑based client/server setup and allowing decentralized, scalable deployment.

System Design

4.1 Script Stability – Split scripts by app package, isolate independent business flows, encapsulate common operations (e.g., control lookup, clicking, swiping) into reusable functions, and avoid coordinate‑based actions when possible.

4.2 Auto‑Start – Use Android BOOT_COMPLETED broadcast to launch the inspection script after device reboot, either via a helper app or by modifying AutoJs source.

4.3 Dynamic Script Distribution – Retrieve script versions from a cloud service, compare with local versions, and download newer scripts on‑the‑fly using engines.execScriptFile('localPath') for hot updates.

4.4 Run Record Management – Log detection results, including control coordinates, JSON representations of leaf nodes, and screenshots, then upload to the server.

4.5 Entry Monitoring – Compare current run with previous run; if an entry is missing, trigger an alarm; otherwise, capture a screenshot.

4.6 JSON and Image Comparison – Compare leaf‑node JSON structures and use OpenCV template matching on captured images to detect layout or visual changes.

4.7 Change Annotation – Merge current and previous screenshots, highlight changed entries with red boxes using ImageIO, and generate a concise report.

Implementation Effects and Benefits – The tool runs unattended, monitors IM entries in the Car Home and Car Quote apps hourly, automatically detects missing or altered entries, and notifies product staff, significantly reducing manual verification effort and gaining business approval.

Future Plans – Improve execution efficiency, enhance tool generality and extensibility, and apply the inspection framework to other business scenarios.

AndroidMobile AutomationRPAApp MonitoringAutoJsScript Stability
HomeTech
Written by

HomeTech

HomeTech tech sharing

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.