How Huolala Scaled a Cloud Real‑Device Platform for Mobile Testing
This article details Huolala's evolution from a simple wireless ADB setup to the sophisticated TianGong system, covering architecture, video streaming, input handling, large‑scale device pool management, and future plans for intelligent scheduling and iOS optimization.
Background
As Huolala’s business expanded across cities, enterprises, and global markets, the mobile testing team needed a more robust quality assurance system. To support functional, performance, compatibility, stability, and security testing, the company built a cloud real‑device platform that enables automated testing and shared mobile resources.
Architecture Evolution
1.0 Era – Wireless ADB
Initially, a small number of devices were accessed via wireless ADB. The client sent ADB commands from a development machine, the server managed communication, and the daemon (adbd) ran on each device. This architecture allowed devices to be shared without cables, reducing hardware costs and simplifying local network usage, but suffered from Wi‑Fi bandwidth limits, unstable performance, and lack of centralized management.
2.0 Era – TianGong System
To address 1.0’s shortcomings, Huolala launched the TianGong system, introducing separate Master and Agent services. The Master handles authentication, device scheduling, and unified management, while Agents run on host machines, managing multiple phones and providing image and control streams via WebSocket. The system supports both Wi‑Fi and USB connections, automated operations, and advanced scheduling features such as reservations, queuing, dynamic scaling, and device recommendations.
Core Solutions
Video Streaming for Smooth Playback
Huolala evaluated Scrcpy (video stream) and STF minicap (image stream). Using Android MediaCodec, the platform encodes video to H.264/H.265, allowing high‑quality, low‑latency streaming with adjustable bitrate and frame rate. Experiments showed that video streaming reduced bandwidth usage by about 80% compared to image streaming (7.8 MB vs 40 MB for one minute of playback at 60 fps).
configure(codec, format);
Surface surface = codec.createInputSurface();
setDisplaySurface(display, surface, videoRotation, contentRect, unlockedVideoRect, layerStack);
codec.start();
// ... encode and push via LocalSocket ...
codec.stop();Input Management for Responsive Control
While ADB input commands (tap, swipe, drag) are simple, their client‑server‑adbd flow introduces noticeable latency. STF Minitouch offers lower‑latency input via port forwarding but requires NDK builds and is limited on newer Android versions. Huolala therefore adopted Android’s InputManager, which injects events directly and is used by tools like UiAutomator and Monkey. Sample code shows how MotionEvent objects are created, logged, and injected via InputManager.
public int injectEvent(IWindowManager iwm, IActivityManager iam, int verbose) {
MotionEvent me = getEvent();
// log event details
if (!InputManager.getInstance().injectInputEvent(me, InputManager.INJECT_INPUT_EVENT_MODE_WAIT_FOR_RESULT)) {
return MonkeyEvent.INJECT_FAIL;
}
return MonkeyEvent.INJECT_SUCCESS;
}Practical Experience
The platform now runs in a 24‑hour temperature‑controlled data center with over 200 devices covering Android 6‑13, iOS 10‑16, and HarmonyOS 2‑3. Devices are continuously refreshed based on usage statistics, aiming for 400+ devices by 2023. The system serves more than 10 business lines worldwide, accumulating nearly 120,000 hours of remote device usage and handling over 1,000 daily scheduling tasks.
Future Outlook
Huolala plans to apply intelligent algorithms to device scheduling, improve iOS screen‑casting solutions, and further automate operations to reduce manual maintenance costs.
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.
