adb – 设置系统时间

app中添加系统定时重启功能,但是等待时间过久,故通过 adb 直接设置系统时间,方便验证功能。记录过程如下:

1、adb shell

        进入终端

2、su  

        获取 root 权限

3、settings put global auto_time 0

        关掉自动时间同步

4、 settings put global auto_time_zone 

        关掉自动时区同步

5、date -s 20231113.165955

        日期格式为 yyyymmdd.hhmmss

adb - 设置系统时间

adb - 设置系统时间

通过 “date” 命令查看当前时间

adb - 设置系统时间

本文来自网络,不代表协通编程立场,如若转载,请注明出处:https://net2asp.com/093759d8fc.html