How Huolala Built a Scalable Cloud Real‑Device Testing Platform for Mobile Apps
Huolala's data team created a cloud‑based real‑device platform that centralizes phone resources, enables remote screen casting and control via adb, minicap, and minitouch, and uses Spring Boot and Netty‑WebSocket to deliver scalable, cost‑effective mobile testing across multiple scenarios.
Background
As Huolala's business grew, the R&D team needed more mobile devices for testing, but faced chaotic resource management, low device utilization, incomplete model coverage, and difficulty monitoring automated tasks. To address these issues, the big‑data R&D team built the Huolala Cloud Real‑Device Platform from scratch.
Introduction
Cloud real devices are not a new concept; they emerged with the rise of mobile internet. By placing various brands, models, and OS versions of phones in the cloud and accessing them remotely, developers can test and debug in a real‑device environment, reducing hardware costs, fragmentation, and improving testing efficiency at scale.
Key Features
Phone screen casting and remote control
Phone runtime status monitoring
Phone group management
Batch distribution of automated tasks
Solution Selection
Open‑source solutions for cloud real devices include OpenSTF and OpenATX. Mature commercial products such as Baidu MTC, Testin Cloud, and Tencent WeTest also exist. Analysis of OpenSTF and OpenATX revealed three core techniques:
ADB‑based command interaction between PC and phone
Minicap for fast screenshot‑based real‑time screen casting
Minitouch for remote touch control from the PC
Considering Huolala's internal technology stack, the final architecture adopted:
Spring Boot as the base framework
Netty‑WebSocket for efficient bidirectional communication
Minicap for screen casting
Minitouch for remote control
Core Technologies
adb
ADB (Android Debug Bridge) is the core tool for PC‑to‑Android interaction, essential for device control in a cloud environment.
After installing adb on the server, phones are connected via USB. Because server USB ports are limited, a powered USB hub is required to ensure stable power for multiple devices.
Rack deployment diagram:
Common adb commands:
// Start adb server (executed automatically when running adb commands)
adb start-server
// Stop adb server
adb kill-server
// List connected devices
adb devices
// Get device CPU ABI
adb -s FIKN7SRCJV65T8M7 shell getprop ro.product.cpu.abi
// Get device SDK version
adb -s FIKN7SRCJV65T8M7 shell getprop ro.build.version.sdk
// Get Android version
adb -s FIKN7SRCJV65T8M7 shell getprop ro.build.version.preview_sdk
// List files in a directory on the device
adb -s FIKN7SRCJV65T8M7 shell ls /data/local/tmp/
// Push minicap binary to the device
adb -s FIKN7SRCJV65T8M7 push minicap /data/local/tmp/
// Grant execution permission
adb -s FIKN7SRCJV65T8M7 shell chmod 777 /data/local/tmp/minicap
// Start minicap service on the device
adb -s FIKN7SRCJV65T8M7 shell LD_LIBRARY_PATH=/data/local/tmp /data/local/tmp/minicap -P 1080x1920@1080x1920/0 -t
// Forward minicap socket port
adb -s FIKN7SRCJV65T8M7 forward tcp:1313 localabstract:minicapminicap
Minicap, an open‑source Android screenshot tool from STF, replaces the native screencap utility and streams images for real‑time casting, achieving 30‑40 FPS.
It consists of a shared library (.so) and an executable. STF provides binaries for four CPU ABIs (x86_64, x86, armeabi‑v7a, arm64‑v8a) and multiple SDK versions. The appropriate binary must be selected based on the device's ABI and SDK before pushing to the phone.
Steps to achieve real‑time screen casting with minicap:
minitouch
Minitouch, also from STF, simulates multi‑point touch events and gestures on Android devices, enabling remote manipulation.
It provides a single executable with binaries for the same four ABIs. The correct binary is pushed and granted execution permission based on the device's ABI.
Implementation steps for remote control with minitouch:
Key Implementations
1. Netty‑Socket Communication
To stream real‑time screen data and handle remote control commands, the platform establishes socket connections for minicap and minitouch. WebSocket was chosen for its stability under high concurrency; Netty‑based WebSocket outperforms Tomcat implementations when handling hundreds of devices.
Maven dependency:
<dependency>
<groupId>org.yeauty</groupId>
<artifactId>netty-websocket-spring-boot-starter</artifactId>
<version>0.9.5</version>
</dependency>2. Automatic Installation of minicap and minitouch Drivers
A listener monitors newly connected adb devices. If a device lacks the required drivers, the system automatically selects the correct binary based on ABI and SDK, pushes it, grants execution permission, and marks the device to avoid repeated installation.
3. Screen Casting Modes
The platform defines three scenarios to balance image quality, latency, and resource consumption:
Single‑device control : High‑quality, low‑latency streaming with a dedicated Netty WebSocket connection for both minicap and minitouch.
Multi‑device monitoring : Periodic screenshots (1‑3 s interval) are pushed via Netty WebSocket, reducing bandwidth while still providing visual status.
Silent mode : Screenshots are fetched only when the user opens the device list or manually refreshes, minimizing I/O.
Image quality can be adjusted via the minicap command parameter -Q (range 0‑100):
adb shell LD_LIBRARY_PATH=/data/local/tmp /data/local/tmp/minicap -hConclusion
Although Huolala's cloud real‑device platform launched later than some market leaders, it successfully consolidates internal phone resources, provides real‑time casting and remote control, and meets the company's testing needs. Ongoing evolution will continue to refine the platform based on business scenarios.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
