Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to have both Debug and Release apk on same device?

While continuing to develop my application and test it on a real phone, I need to have the release version of it on the same phone, for demonstration purposes (the release version is much more responsive, thanks to no-logs).

The problem is that the only way to make two applications co-exist on the same device in Android is by having different package names.

But package names require re-factoring and lots of propagating manual fixes... not to mention that this confuses version control...

Ideally, Eclipse+ADT would allow appending a modifier variable that would automatically generate a different package name for debug/release and would allow such co-existence, but I couldn't find any mechanism that allows doing that.

Do you know of any way to workaround this?

Creative solutions and ideas are welcome.

like image 953
an00b Avatar asked Sep 06 '25 03:09

an00b


1 Answers

Use Android Studio because gradle make your life a lot easier - just use applicationIdSuffix

android {  
   ...  
   buildTypes {  
     release {...}  
     debug {  
       applicationIdSuffix '.debug' 
     }  
   }  
}

For more go here.

like image 157
Marian Paździoch Avatar answered Sep 07 '25 19:09

Marian Paździoch