Set date/time using ADB shell

后端 未结 11 2445
野趣味
野趣味 2020-12-04 15:59

I´m trying to set the date/time using the ADB shell but the shell only returns the current time.

I´ve tried:

adb shell date -s YYYYMMDD.HHmmss
         


        
11条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-04 16:33

    You have to put date value if you want to change it. "-s" changes SET format. Default SET format is "MMDDhhmm[[CC]YY][.ss]".

    I successfully tested the following commands:

    adb root
    adb shell "date `date +%m%d%H%M%Y.%S`"
    

提交回复
热议问题