Orientation Testing with ADB Notes By ShariqSP

Orientation Testing with ADB

Orientation testing ensures that an application behaves consistently and as expected when the device orientation changes. Using ADB commands, you can simulate portrait, landscape modes, and toggle auto-rotation to validate app functionality.

Example: Orientation Testing with Candy Crush APK

Download the Candy Crush APK from shariqsp.com/apk/candycrush.apk. Once installed, use the following commands to test orientation-related scenarios.

1. Setting Orientation Modes

These commands test the app's behavior in portrait and landscape orientations:

  1. Switch to Portrait Mode:
    adb shell settings put system user_rotation 0
    This command sets the device to portrait orientation.
  2. Switch to Landscape Mode:
    adb shell settings put system user_rotation 1
    This command sets the device to landscape orientation.

2. Enabling and Disabling Auto-Rotation

Auto-rotation can impact app usability and layout responsiveness. Use the following commands to test its effects:

  1. Enable Auto-Rotation:
    adb shell settings put system accelerometer_rotation 1
    This enables automatic rotation based on the device's orientation.
  2. Disable Auto-Rotation:
    adb shell settings put system accelerometer_rotation 0
    This disables automatic rotation, locking the current orientation.

3. Examples for Orientation Testing

Below are orientation-specific scenarios for Candy Crush APK or similar applications:

  • Test Gameplay in Portrait Mode: Launch the app in portrait mode and verify that all UI elements are visible and functional:
    adb shell am start -n com.king.candycrushsaga/.MainActivity
    Followed by:
    adb shell settings put system user_rotation 0
  • Test Gameplay in Landscape Mode: Switch to landscape mode and verify screen elements' proper alignment:
    adb shell settings put system user_rotation 1
  • Enable Auto-Rotation: Test how the app reacts when the device is physically rotated during gameplay:
    adb shell settings put system accelerometer_rotation 1
  • Disable Auto-Rotation: Lock orientation and verify the app's layout remains stable:
    adb shell settings put system accelerometer_rotation 0
  • Simulate Screen Rotation During Gameplay: Start gameplay, rotate the screen, and verify that the app resumes seamlessly in the new orientation:
                  adb shell settings put system user_rotation 0
                  adb shell settings put system user_rotation 1
                        

4. Additional Orientation Testing Scenarios

Test the app's behavior with these orientation scenarios:

  • Verify app responsiveness during orientation changes on a splash screen.
  • Check for consistent UI alignment in both modes.
  • Ensure no data loss occurs when orientation changes mid-gameplay.
  • Validate animations and transitions during orientation changes.
  • Test app stability with rapid orientation changes (e.g., toggling back and forth quickly).