Emulated Android Device shows wrong date (Windows 10)

杀马特。学长 韩版系。学妹 提交于 2020-05-17 07:46:11

问题


I created an app with Android Studio on my PC with Windows 10. A wrong date (PC-Date minus 2 hours) is shown in the emulation device 'Pixel_2_API_28 [emulator-5554] and I try to correct this adb date in the app with Java:

            final long jetzt = System.currentTimeMillis() / 1000L;
            final ProcessBuilder builder = new ProcessBuilder("adb",  "date",
                    Long.toString(jetzt));
            builder.redirectErrorStream(true);
            builder.redirectOutput(ProcessBuilder.Redirect.INHERIT);
            final Process process = builder.start();
            process.waitFor();

I get the error while starting the app: W/System.err: java.io.IOException:

Cannot run program "adb": error=13, Permission denied

Can anyone give me a hint? Thank you

来源:https://stackoverflow.com/questions/61834015/emulated-android-device-shows-wrong-date-windows-10

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!