Trending:

Android Emulator gains command-line control for adaptive app development

Screenshot of Android emulator folding and resizing a Pixel Fold device
TechStaged-owned

Summary

  • There is a faster, more streamlined way to control form factors directly from the terminal using adb emu shortcuts.
  • If multiple emulators are running, you can target a specific virtual device by passing the serial.
  • Foldable-specific journeys can be tested by programmatically folding and unfolding the emulator.

Android developers can now control form factors directly from the terminal using adb emu shortcuts, complementing the Resizable Emulator bundled with Android Studio. The approach aims to speed up testing across multiple devices and configurations by returning control to the invoking shell immediately.

  • Target a specific emulator when multiple instances are running by supplying the device’s serial.
  • Test foldable-specific journeys by programmatically folding and unfolding the emulator.
  • Verify state preservation and layout consistency across display sizes.

HOW THE COMMANDS WORK IN PRACTICE

Developers can leverage fire-and-forget console commands to drive the emulator from the command line, enabling rapid iteration without starting additional emulators. When several emulators are active, a serial argument can be used to select the intended virtual device. TechStaged has also covered Pixel 11 Debuts Real-Time Sign-to-Text Translation for ASL Users.

TESTING FOLDABLE FORM FACTORS PROGRAMMATICALLY

The emulator supports folding and unfolding actions to simulate different physical postures. For example, if a foldable emulator is unfolded, it can be folded to reveal a smaller external display. This capability helps validate how apps adapt to changing screen real estate during user journeys.

Note: not all postures are available for every virtual device; Pixel Fold and the Resizable AVD templates support only certain postures.

  • Postures 1, 2, and 3 are supported on standard templates like Pixel Fold and Resizable AVD.
  • Attempting to set higher postures (e.g., 4 or 5) can return a KO: Failed to set posture error.

ORIENTATION CHANGES, ROTATIONS, AND STATE RESTORATION

Programmatic device rotations are supported to test how apps handle configuration changes and state restoration. The ability to trigger these changes via the command line helps ensure layouts adapt correctly when orientation shifts occur.

  • Rotate the device to test landscape vs portrait layouts.
  • Verify that app state remains consistent after rotations.

WHAT THIS MEANS FOR ANDROID DEVELOPERS

The new CLI controls provide a faster workflow for adaptive app development by reducing the need to run multiple emulators in parallel. Developers can focus on verifying layout behavior and feature compatibility across form factors using fewer resources.

Reporting by Ivy Whitmore; editing by TechStaged editors

Editorial disclosure: This article was prepared with AI assistance from a source-limited research package and passed TechStaged's automated factual, originality, licensing, and publication checks.

Our Standards: The TechStaged Editorial Principles.

Suggested Topics: Software Business Software
f in

Ivy Whitmore

Ivy Whitmore

Business Software Guide

Ivy writes practical guides for choosing, implementing, and comparing core business software.