Android installs multiple apk on the same phone for easy debugging

Source: Internet
Author: User

Android Studio installs many of the same 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 not every time. One of the stupidest ways is to change the package name of the project. But obviously this is a dubious thing. Starting with Android Studio last year, I finally found out how to install the same apk on one phone. This also thanks 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. This is how good, you do not have to fear can not give the test personnel to install a number of APK, these apk can be used normally, to show you the effect, see below I have installed several:

Attached here is an authoritative gradle-plugin Tutorial link: Link Address

Android installs multiple 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.