Set date/time using ADB shell

后端 未结 11 2453
野趣味
野趣味 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条回答
  •  广开言路
    2020-12-04 16:31

    For Android 6+, To change DateTime on Emulator:

    Step 1

    adb root
    

    Step 2

    adb shell date MMDDhhmm[[CC]YY][.ss]
    

    For Example to set date to Oct[10] 29 02:01:55 2020 - simply 10/29/2020 02:01:55AM

    adb shell date 102902012020.55
    

    If you don't understand date format, just look at this:

    MM = 10
    DD = 29
    hh = 02
    mm = 01
    [[CC]YY] = 2020 (or can be 20)
    [.ss] = 55
    

    *Year and Second are optional.

提交回复
热议问题