How to Have a Debug and a Production Version of an App Installed on a Single Phone

Reason

For my client, the need to copy a Android Project comes from the fact that the client wants to be able to install both a dev version and a production version of the mobile app on the same phone.

Old School Way

  1. Make a copy of the whole android project folder using file manager.
  2. Rename the folder.
  3. Open Android Studio, import an existing project, and select the renamed folder.
  4. Clean Project
  5. Right click on the java module and refactor –> rename.  https://www.youtube.com/watch?v=D6o9RvWw4wk
  6. Rebuild Project
  7. Do a Find in Path and try to replace the package name and application id  with the new one.

New Way

  1. Use flavors and build Types to either specify different applicationId or applicationIdSuffix in the app/build.gradle.

http://tools.android.com/tech-docs/new-build-system/applicationid-vs-packagename

Reference:

http://stackoverflow.com/questions/18324555/android-copy-existing-project-with-new-name-in-android-studio

http://www.reddit.com/r/androiddev/comments/2t5f01/android_studio_102_how_to_copyrename_a_project/

http://stackoverflow.com/questions/8791829/install-dev-build-of-android-app-along-side-market-version

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s