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

孤街浪徒 提交于 2019-12-03 10:51:11
atinder

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

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).

I had this problem in real android device, I had a time difference between the pc and the mobile higher than 60 second. I solve the issue just by putting them on same time

I had this problem and solved it by enabling 'set time automatically' in windows 10 Time and Language settings. also I enabled automatic date & time in my android phone.

If your phone can run adb as root you can use the following commands:

>>> adb root
restarting adbd as root

>>> adb shell "date `date +%m%d%H%M%Y.%S`"       
Mon Aug 26 21:04:24 +0430 201
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!