Evgenii
Evgenii

Reputation: 37339

How to test an android app with non-existing or outdated Google Play Services?

I am building an Android app that uses maps through Google Play Services.

In the app I am checking that Google Plays Services are installed with following function: GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable. If Google Play Services are not available I am displaying a message: "Please install Google play services to continue."

How can I test it in the emulator or on device? How can I emulate the case when Google Play Services are not available or are not correct version? On my device Google Play Services are installed, so my app always goes the happy path. Same on emulator. I would like to check that my app does not crash on devices without Google Play Services but shows an instruction.

Upvotes: 4

Views: 2099

Answers (2)

Tako
Tako

Reputation: 3444

You can also use Android studio to emulate a device without Google Play Services: create a new virtual device and when choosing the system image choose one without Google APIs.

Upvotes: 4

gerardnimo
gerardnimo

Reputation: 1454

You may want to do "Uninstall Updates" of the Google Play Services by going to Settings > Apps > Google Play Services > Uninstall Updates.

Upvotes: 4

Related Questions