Boost Mobile App Testing Efficiency with Parallel Multi‑Device Synchronization
This article explores how Hu Jia‑chun and the Huolala testing team tackled the exploding complexity of mobile app testing across Android, iOS, and HarmonyOS by applying task decomposition, parallel execution, cloud‑based device farms, OCR‑driven precise control, and custom multi‑device synchronization tools to dramatically improve coverage and speed.
Background
As the mobile market diversifies, the number of brands, operating systems, and OS versions that need to be tested has exploded, greatly increasing test complexity and workload.
HarmonyOS Next adds a new platform alongside Android and iOS, making cross‑platform testing especially challenging.
Limited physical devices and the need to rent devices cause waiting time and higher costs.
Functional testing now requires step‑by‑step comparison across multiple platforms, further increasing effort.
To achieve efficient, comprehensive coverage under tight timelines, the team looks for breakthroughs beyond traditional automation scripts.
Efficiency Solution Exploration
2.1 The 1=N Idea
Frederick Taylor’s scientific management principle advocates breaking complex tasks into simple, standardized subtasks that can be executed in parallel, improving overall efficiency.
Key takeaways: sub‑tasks, standardization, parallelism.
Let 1 = N? From Serial Testing to Parallel Testing
Sub‑tasks: Separate functional and compatibility tests for Android, iOS, and HarmonyOS.
Standardization: Define coverage scenarios as acceptance criteria.
Parallelism: Testers execute multiple sub‑tasks concurrently using standardized processes.
2.2 Multi‑Device Synchronization Requirements
Support multiple control modes: Android, iOS, and cross‑platform control.
High precision and fast response: Control actions must respond within 1 second.
Simplicity: Control flow should be straightforward without extra steps.
2.3 Industry Solutions
We surveyed several vendors:
Ant SoloPi – element‑level sync via AccessibilityService, image, wireless ADB; unlimited devices; high setup difficulty; not cross‑platform.
Testin – relative‑coordinate sync on cloud devices; supports Android and iOS; limited to 8 devices; low difficulty.
ZeZhong Cloud Real Device – similar to Testin; supports 4 devices.
SoloPi offers element‑level sync but lacks cross‑platform support and is harder to set up, so we decided to develop a custom multi‑device sync tool tailored to Huolala’s needs, borrowing SoloPi’s strengths while improving cross‑platform compatibility and usability.
Core Multi‑Device Sync Solution
We built the solution on Huolala’s cloud‑real‑device platform, which provides a rich device pool, robust scheduling, and low‑cost cross‑platform implementation.
3.1 Cloud‑Device Master‑Slave Coordination
EventBus: A websocket‑based message bus that routes commands from a central Agent to device Agents for execution.
eventBus.emit('syncAppointControl', { udId: serial, action: JSON.stringify(MITT_MESSAGE) }) // control message
eventBus.emit('syncKeyevent', JSON.stringify(message)) // key eventMessage Protocol: Unified messages are generated from browser‑captured actions and dispatched via EventBus to Android, iOS, and HarmonyOS agents, which parse and adapt them per platform.
import { ANDROID, IPHONE, MITT_MESSAGE, TOUCH_U, TOUCH_D, TOUCH_M, LONG_PRESS, SWIPE, TAP, KEY_EVENT, INPUT_EVENT, SHELL_EVENT, OPEN_APP, OPEN_IOSAPP, STOP_APP, STOP_IOSAPP, INSTALL, UN_REINSTALL, REINSTALL, UNINSTALL, UNLOCK } from '../Sync/ActionEvent'3.2 OCR‑Based Precise Control
3.2.1 Precise Control
We reuse PaddleOCR to locate UI elements as images, avoiding platform‑specific accessibility services and achieving cross‑platform compatibility.
3.2.2 Model Tuning
We fine‑tuned PaddleOCR’s detection model (PP‑OCRV4_det) on real Huolala UI failures, adding data augmentation (scaling, cropping, noise, blur) to improve robustness.
3.2.3 Expanding Click Hot‑Area
After OCR detection, we enlarge bounding boxes while preventing overlap using an iterative algorithm.
def is_overlapping(box1, box2):
# rectangle collision detection
...
def expand_box(box, expand_pixels):
...
def adjust_boxes(ocr_results, max_expand_pixels, min_expand_pixels=0, step=1):
...
def zoom_in(ocr_results):
max_expand_pixels = 10
return adjust_boxes(ocr_results, max_expand_pixels, min_expand_pixels=1, step=0.5)3.3 Controlling Traffic Overhead
Compress video streams (resolution, bitrate) to reduce bandwidth.
Disable unnecessary animations to lower data usage.
PD2130:/ $ settings put global window_animation_scale 0
PD2130:/ $ settings put global transition_animation_scale 0
PD2130:/ $ settings put global animator_duration_scale 03.4 Reducing Popup Interference
3.4.1 System Popups
adb shell pm disable-user com.huawei.android.hwouc
adb shell pm disable-user com.hihonor.ouc
adb shell pm disable-user com.meizu.flyme.update
adb shell pm disable-user com.bbk.updater3.4.2 App Popups
We use a DeviceOwner‑enabled app (Tiangong Manager) to suppress permission dialogs across Android devices.
<?xml version="1.0" encoding="utf-8"?>
<device-admin xmlns:android="http://schemas.android.com/apk/res/android">
<uses-policies>
<force-lock/>
<expire-password/>
<encrypted-storage/>
<disable-camera/>
<limit-password/>
<watch-login/>
<reset-password/>
<wipe-data/>
</uses-policies>
</device-admin> public class DevAdminReceiver extends DeviceAdminReceiver {
@Override
public void onDisabled(Context context, Intent intent) { super.onDisabled(context, intent); }
// other overrides omitted for brevity
} ComponentName adminComponentName = new ComponentName(context, DevAdminReceiver.class);
DevicePolicyManager devicePolicyManager = (DevicePolicyManager) context.getSystemService(Context.DEVICE_POLICY_SERVICE);Practical Demonstration
4.1 Demo
Android 5‑device parallel order placement demo
Android + iOS parallel order placement demo
4.2 R&D Efficiency Scenarios
Applicable to new feature verification, compatibility testing, and cross‑platform testing, significantly boosting coverage and speed.
Enables developers to validate UI across devices during development.
Provides UI teams with easy cross‑platform consistency checks.
Accelerates product acceptance by allowing simultaneous Android and iOS validation without external devices.
Future Plans
“The road is long and steep, but walking will bring us there; perseverance leads to a promising future.” – Xunzi, *Cultivation of the Self*
We will continue iterative model optimization, add icon recognition, and extend multi‑device sync to HarmonyOS NEXT and mini‑programs.
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.
