When.com Web Search

Search results

  1. Results From The WOW.Com Content Network
  2. 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 and unix time like: adb shell date 1318349236 any id...

  3. You will always get this security exception because, even though you requested android.permission.SET_TIME in your manifest, the system will not grant your app this permission unless it is a system app. Basically, in short, unless you have a rooted phone or your own custom ROM you cannot set the time on the device. Period. End of story. –

  4. How to set mobile system time and date in android?

    stackoverflow.com/questions/1332269

    Short Answer. It's possible and has been done. You need android.permission.SET_TIME. Afterward use the AlarmManager via Context.getSystemService(Context.ALARM_SERVICE) and its method setTime(). Snippet for setting the time to 2010/1/1 12:00:00 from an Activity or Service: Calendar c = Calendar.getInstance();

  5. How-to set Android device date/time programmatically

    stackoverflow.com/questions/7094772

    1. Use the shell's 'date' command. With an argument of unix epoch time (i.e. seconds since 1/1/70) it sets the device's clock, e.g. 'adb shell date 1318349236'. You can get the current timestamp in seconds with 'adb shell date +%s'. If you have busybox, the date command is more capable, and you can get your arbitrary desired date in seconds ...

  6. If you are targeting devices api 28+ (android 9 and higher) you can set it with setTime (ComponentName admin, long millis) function. For lower android versions I had to rely on a device manufacturer api to set device time. Manifest.permission.SET_TIME is proteced/system permission, sadly deviceOwner cannot grant any protected permissions with ...

  7. The app must set the date/time automatically without user input, so using the following code to make a user set it will not help; startActivity(new Intent(android.provider.Settings.ACTION_DATE_SETTINGS)); I added the set time permission to the manifest in two ways, on their own and then together.

  8. Renaming your Device and Setting the Date and Time. 1.To change the computer name, use the setcomputername utility. In PowerShell, type the following command. setcomputername . 2.The date and time on the Pi must be correct for the security tokens used to publish to Azure later in the lab to be valid. To check the current time zone setting on ...

  9. You can set a variable device to cuda if it's available, else it will be set to cpu, and then transfer data and model to device: import torch device = 'cuda' if torch.cuda.is_available() else 'cpu' model.to(device) data = data.to(device)

  10. Appium set Android time based on current device time

    stackoverflow.com/questions/66466379

    You are right, Appium API exposes only the end point to get time. You can change device time via adb: adb shell date -s "yyyymmdd.[[[hh]mm]ss]" or in your test code: Runtime.getRuntime().exec("adb shell date -s \"yyyymmdd.[[[hh]mm]ss]\"); If you want to do it in test code via driver instance, I suggest reading how to execute adb commands with ...

  11. 5. There is no Android API to get you such a time. The user can always change the device time, nothing you can do about that. Your best bet would be to run a server with a webservice, from which you can get the time. Since you control the server, you can try to ensure it returns the correct time.