ADB test doze and app Standby mode

Source: Internet
Author: User
  • Test doze Mode

1. First make sure that your hardware or virtual device is a Android6.0 or higher version of the system;

2. Connect the device to the development machine and install your app;

3. Run the app and let it run the activity;

4. Turn off the device's screen;

5. Run the following ADB command to bring the system into Doze mode:

$ adb shell Dumpsys Battery Unplug

$ adb shell Dumpsys deviceidle step

6. See if your app behaves in a place that needs to be optimized for improvement.

  • Test app Standby mode

Step 1-3 with Test doze mode

4. Run the following ADB command to force the system into app Standby mode:

$ adb shell Dumpsys Battery Unplug

$ adb shell am set-inactive <packageName> True

5. Simulate waking your application using the following command:

$ adb shell am set-inactive <packageName> false

$ adb shell am get-inactive <packageName>

6. Watch your app and make sure the app is back to normal from standby mode, the app notification and its back activity can achieve the desired results.

ADB test doze and app Standby mode

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.