Android installs multiple identical apk on the same phone for easy debugging

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.