azv
azv

Reputation: 1593

Change android time zone on emulator via adb shell

I'm running tests for my app, and I want to validate that it works in various time zones. I'm trying solutions suggested here running adb shell setprop persist.sys.timezone "Pacific/Honolulu", but the timezone (and time) on emulator is not changing- can this work without restarting the device?

Upvotes: 4

Views: 2779

Answers (1)

Dmitriy Biloshytskiy
Dmitriy Biloshytskiy

Reputation: 11

If you mean UI tests, I can not change android Date & Time settings on emulator via adb shell.

The only solution I found is to set the timezone during the creation of the emulator with -timezone option.

For example, you can create android emulator with a command like $ emulator @Nexus_5X_API_23 -timezone Europe/Paris.

See more emulator command line options here

Upvotes: 1

Related Questions