Cooper.Wu
Cooper.Wu

Reputation: 4565

how to install two instances by one apk?

I developed an app for android, but I need to install two instances of it, one for my daily use, another for debug/development, I don't have too many phones for debug, just have one phone, and don't want to debug on emulator, because it's too slow compare to real phone.

Or is there any thing we can change on APK file, then we can install it as another app, e.g. change it's package name ?

Currently, I changed the package name in code then make them to two apps, which can be installed on the same phone, but this way is not convenient. seek for simple way.

Update: is there any tool to modify package name in androidmanifest.xml directly after packaged(apk file)? then we just need unzip the apk, modify the androidmanifest.xml, zip the apk again.

Upvotes: 2

Views: 6529

Answers (5)

Neeloor Palai
Neeloor Palai

Reputation: 1

  1. Install WhatsApp from the Google PlayStore on your device.
  2. Open the Settings app, scroll down, tap Utilities, and tap Parallel Apps. If you are using a Samsung device, it is called "Dual Messenger." Install WhatsApp.
  3. If you are using a Samsung device, you can go to Settings and search for "Secure Folder." Enable it and install WhatsApp.
  4. Using free BYOD by Tabnova, go to https://b2b.novaemm.com/, register and login, scan the QR code, search and install WhatsApp.

Upvotes: 0

WarrenFaith
WarrenFaith

Reputation: 57672

I would make the original app a library project and create a new project which uses the library project.

Advantage:

  • you can have both running as your new project should have a different package name
  • easily identification by overriding the app name in your new project (just add "beta" to it)
  • both versions can be installed on one device/emulator parallel
  • pretty good setup if you try to verify the update process of your app
  • no confusion with a version control system - renaming packages results in awful non-real changes on your development branches

Disadvantage:

  • you need to "uncheck" the library setting before you can release the original project
  • you might need to change some stuff in both manifest files which will increase the maintainability in a small manner

If you really need a market version of your app on your device, this method is the easiest one as a package rename will very probably result in worse maintainability.

edit:

You can mark a project as a library project in project preferences -> Android. After that you can link add that library project to another normal android project at the same spot, just click on the add button.

Upvotes: 0

Jorge B.
Jorge B.

Reputation: 1213

You can copy your project and change the package name in the copy. You can use the same SVN path to apply the changes on the two projects.

Or you could automate the different builds using an ANT build.xml file with parameters. There are several examples on how to do this for Android in Google. ref: One android application, one startup view, two icons

Upvotes: 0

Ryan sams
Ryan sams

Reputation: 359

Try changing the the name of the app in strings.xml from resource folder @string/app_name to have multiple instances of the same app. And package name must be changed so that the existing app is not overridden.

Upvotes: 0

vRallev
vRallev

Reputation: 5040

You've answered the question yourself. You have to change the package name in the manifest, otherwise Android will override the old app (or can't install it, if the certificate differs).

Upvotes: 5

Related Questions