如何在Android上不受干扰地两次安装应用程序? [英] How to Install the app twice without interference in android?
问题描述
我有一个Android应用程序(我们称为X),我想创建另一个应用程序X2,但要基于另一个应用程序.因此,我将清单应用程序名称属性更改为X2,也更改了程序包名称...但是仍然在安装X2时,应用程序X被删除了!
I have an Android app (let's called X), I want to create a second app X2 but based on the other app. So I changed the manifest application name property to X2 also I changed the package name...but still when I install X2, app X is erased!
我应该更改哪些属性,以便可以在一个设备上独立安装两个应用程序.我正在做eclispe.
What properties should I change so I can install the two app independently on one devices. I'm working on eclispe.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.company.app1"
android:versionCode="1"
android:versionName="1.0" >
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name1"
android:theme="@style/AppTheme" >
更改后.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.company.app2"
android:versionCode="1"
android:versionName="1.0" >
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name2"
android:theme="@style/AppTheme" >
推荐答案
它可以在具有最新平台的其他设备上运行!无论如何,正确的响应是您只需要更改应用程序的名称和程序包即可.
Well it worked on other device with more recent platform ! Anyway the proper response will be you just have to change the name and the package of the application.
现在,如果您使用的是Android Studio,请使用applicationIdSuffix为每种口味创建一个应用.
EDIT 1: Now if you are using Android Studio use applicationIdSuffix to have one app for each flavor.
debug {
applicationIdSuffix ".debug"
}
在此处了解更多信息 developer.android.com
这篇关于如何在Android上不受干扰地两次安装应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!