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

vun picture vun · Aug 14, 2016 · Viewed 16.5k times · Source

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 adb shell "date `date +%m%d%H%M%Y.%S`" on your debugger machine

But when I run the command as suggested above, I get and operation not permitted error:

date: cannot set date: Operation not permitted

I already tried with sudo, still got same result:

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

Answer

atinder picture atinder · Sep 3, 2016

Inside the emulator goto Settings > Date & Time

  1. Deselect Automatic timezone.
  2. Adjust your timezone manually.
  3. Deselect automatic date & time and set correct time