Software Engineering
New tool automates conversion of legacy Android UIs to modern Compose and SwiftUI frameworks
Researchers introduce GUIMigrator, an automated system that transforms XML-based Android interfaces into declarative frameworks while preserving visual and functional integrity.
Mobile developers face a mounting challenge: most existing Android applications still rely on aging XML-based layout systems, while the industry has shifted toward modern declarative frameworks like Jetpack Compose and SwiftUI. Manually updating these interfaces is prohibitively expensive and error-prone, yet the migration is increasingly vital for long-term maintainability and code reuse across platforms.
A research team has introduced GUIMigrator, an automated migration framework designed to bridge this gap. The system translates Android XML layouts into idiomatic Jetpack Compose (for Android) and SwiftUI (for iOS) code while preserving the original design and behavior.
How GUIMigrator Works#
The framework's core component is the Semantic UI Transpiler (SUT), which takes a two-stage approach: it first extracts the structural and semantic information from legacy XML layouts, then systematically reformulates that information using the idioms and component abstractions of modern declarative frameworks. This separation of semantic interpretation from platform-specific implementation allows the system to handle multiple target frameworks consistently.
The transpiler generates compilable code that maintains visual fidelity and functional equivalence without requiring extensive manual rework. By avoiding purely generative (AI-based) approaches, GUIMigrator delivers deterministic, reproducible migrations while remaining extensible for future framework updates.
Evaluation Results#
The researchers tested GUIMigrator on 31 open-source applications spanning ten different domains. Key findings include:
- Visual similarity: 81.9% structural similarity (SSIM) on Jetpack Compose; 78.2% on SwiftUI on average
- Semantic coherence: substantially higher project-wide semantic consistency than large language model baselines
- Effort reduction: over 90% decrease in manual development work required for migration
Why It Matters#
UI development accounts for more than half of the effort in typical mobile projects. By automating migration to declarative frameworks, GUIMigrator enables teams to modernize legacy codebases at scale, improving maintainability and enabling cross-platform code sharing—all while minimizing the human effort and error risk that manual conversion entails.