Reputation: 4565
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
Reputation: 1
Upvotes: 0
Reputation: 57672
I would make the original app a library project and create a new project which uses the library project.
Advantage:
Disadvantage:
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
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
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
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