Android Studio installs multiple identical apk on the same phone
Original address: Http://yj.itrydo.com/posts/iKJryXL9zkfSGRTZk
First look at the effect:
1. While I was using ecslipse, I've been working on the issue of "Android Studio installs multiple identical apk on the same phone", but one of the stupidest ways to change a project's package name every time is not to do what it wants, but obviously it's an unreliable thing, From last year's contact with Android studio, finally found how to install a number of the same apk on a phone, this also thanks to gradle-plugin this plugin, is very powerful, nonsense not much to say directly on the code:
Here's a build of mine
Apply plugin:' Com.android.application 'Android {Compilesdkversion ABuildtoolsversion"22.0.1"Defaultconfig {ApplicationID"Com.guoyoujin.gz.gz"Minsdkversion -Targetsdkversion AVersioncode1Versionname"1.0"} buildtypes {debug {Applicationidsuffix"Debug"} release {minifyenabledfalseProguardfiles Getdefaultproguardfile (' Proguard-android.txt '),' Proguard-rules.pro '}}}repositories {maven {URL"https://oss.sonatype.org/content/repositories/snapshots/"}}dependencies {Compile Filetree (include: [' *.jar '], dir:' Libs ') Compile' com.android.support:appcompat-v7:22.2.0 'Compile' com.android.support:support-v4:22.2.0 'Compile' com.nineoldandroids:library:2.4.0 'Compile' com.ogaclejapan.smarttablayout:library:[email protected] 'Compile' com.ogaclejapan.smarttablayout:utils-v4:[email protected] 'Compile' com.android.support:recyclerview-v7:22.2.0 'Compile' com.android.support:support-v13:22.2.0 'Compile' com.google.code.gson:gson:2.2.4 'Compile' com.facebook.fresco:fresco:0.5.0 'Compile' com.orhanobut:logger:1.10 'Compile' org.lucasr.twowayview:core:[email protected] 'Compile' org.lucasr.twowayview:layouts:[email protected] 'CompileFiles(' Libs/universal-image-loader-1.9.1-with-sources.jar ') CompileFiles(' Libs/com.hck.book.jar ') CompileFiles(' Libs/msc.jar ') CompileFiles(' Libs/pinyin4j-2.5.0.jar ')}
Here's the point:
buildTypes { debug { "debug" } release { false proguardFiles getDefaultProguardFile(‘proguard-android.txt‘‘proguard-rules.pro‘ } }
This debug applicationidsuffix can be easily changed to generate the test apk you want to ApplicationID, understand the Android must know what the concept of
This means that you can install a different app at will, it is very good, you do not have to be afraid of the tester can not install a number of APK, these apk can be used normally, for everyone to see the effect, see below I have installed several:
Attached here is an authoritative gradle-plugin Tutorial link: Link Address
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Android installs multiple identical apk on the same phone for easy debugging