Technology
New Framework Tackles Challenge of Migrating Mobile App Interfaces to HarmonyOS
Researchers developed ArkTrans, an AI-powered system that automates the translation of modern UI code from Android and iOS to HarmonyOS, achieving significantly higher success rates than previous approaches.
Translating user interfaces between mobile operating systems has grown more complex as platforms have adopted modern declarative UI frameworks—such as Kotlin Jetpack Compose for Android, SwiftUI for iOS, and ArkUI for HarmonyOS. Researchers have now addressed this challenge by developing ArkTrans, a framework designed to automate the migration of these interfaces from Android and iOS applications to Huawei's HarmonyOS.
Why UI Migration Matters#
HarmonyOS is gaining adoption as an emerging mobile platform, yet developers need a systematic way to port existing applications. While prior tools could handle backend code or older-style imperative UI designs, they struggle with modern declarative approaches that express interfaces as code rather than through manual layout files. This gap has left developers without effective solutions for translating large codebases.
The Research Approach#
A team of researchers built a comprehensive benchmark to evaluate the problem. They created a parallel dataset of 100 Kotlin Jetpack Compose files and 100 SwiftUI files spanning eight different UI scenarios, along with 52 real-world interface pages extracted from nine open-source applications. Testing nine different AI translation setups—using various language models and AI agents—revealed that direct translation achieved only 0%-35% compilation success. Even when augmented with common strategies like reference screenshots and compiler-guided fixes, these baseline approaches maxed out at 94%-99% success, and failed entirely on smaller, lightweight LLMs.
ArkTrans: A Four-Step Solution#
The researchers identified three root causes behind translation failures: broken structural patterns, APIs that don't exist in the target framework, and missing resources like colors, strings, and icon files. Their framework, ArkTrans, tackles each through a structured four-step process:
- Metadata Extraction: Analyzing the source code to extract structural information
- Skeleton Construction: Building the foundational layout pattern for ArkUI
- LLM-driven Translation: Injecting ArkUI knowledge and resource references through demonstration examples
- Compiler-Guided Iterative Repair: Using compiler feedback to fix remaining errors

