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.
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