Android同时安装Release和Debug版本

发布时间:2019-06-27 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了Android同时安装Release和Debug版本脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。

1.找到build.gradle(Module: app)

找到BuildTyPEs中添加如下代码

buildTypes {
        release {
            applicationIdSuffix ".release"
            resValue "string", "app_name", "@string/app_name_release"
//            minifyEnabled false
//            PRoGuardFiles getDefaultProguarDFile('proguard-andROId.txt'), 'proguard-rules.pro'
        }

        debug {
            applicationIdSuffix ".debug"
            resValue "string", "app_name", "@string/app_name_debug"
        }
}   

2.找到strings.XMl

添加代码

  <string name="app_name_release">Release版本</string>
  <string name="app_name_debug">Debug版本</string>

3.找到AndroidManifest.xML

<application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

 </application>
  

脚本宝典总结

以上是脚本宝典为你收集整理的Android同时安装Release和Debug版本全部内容,希望文章能够帮你解决Android同时安装Release和Debug版本所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。