Cannot run adb shell “date `date +%m%d%H%M%Y.%S`”

后端 未结 5 1626
余生分开走
余生分开走 2021-02-03 22:58

I have a warning when running React Native on an Android device:

Debugger and device times had drifted by more than 60s. Please correct this by running

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-03 23:37

    Deselecting automatic time and time zone did not work for me. Instead, I did adb shell su root date $(date +%m%d%H%M%Y.%S).

    Adding "su root" is the solution to the "Operation not permitted" error.

    Note that this is not equivalent to executing adb shell first and then su root date $(date +%m%d%H%M%Y.%S) (in this case $(date +%m%d%H%M%Y.%S) returns the emulator time, which is not correct, so even though the command succeeds, it does not fix the problem).

提交回复
热议问题