Book Image

Learning Android Application Testing

Book Image

Learning Android Application Testing

Overview of this book

Table of Contents (16 chapters)
Learning Android Application Testing
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Additional emulator configurations


Sometimes, what we need to test is outside the reach of the options that can be set when the AVD is created or configured.

One of the cases could be the need to test our application under different locales. Let's say we want to test our application on a Japanese phone—an emulator, with the language and country set to Japanese and Japan respectively.

We have the ability to pass these properties in the emulator command line. The -prop command line option allows us to set any of the properties we could set:

$ emulator -avd testdevice -no-window -no-audio -no-boot-anim -port 5580   -prop persist.sys.language=ja -prop persist.sys.country=JP

To verify that our settings were successful, we can use the getprop command to verify them, for example:

$ adb –s emulator-5580 shell "getprop persist.sys.language"
ja
$ adb –s emulator-5580 shell "getprop persist.sys.country"
JP

If you want to clear all the user data after playing with the persistent settings, you can use...