How to run android app in release not in debug?

Test a release build

enter image description here

  1. open Build Variants

enter image description here

  1. set debug to release

  2. Build and Run

For gray screen Once you have got the release SHA set in dev console

  • This is main reason that I forget most of the time

You have two google_maps_api.xml files

One in this folder:

app/src/debug/res/values

Other in this folder:

app/src/release/res/values

But only the debug one contains your API key probably.

enter image description here


You can use gradle tasks to run a release build on emulator.

Default task name is installRelease

just start emulator and fire below command from terminal

./gradlew installRelease

this will install release build into emulator.