Pages

星期四, 10月 01, 2015

[android] 複製Android Studio project的簡易方法

The easiest way to copy a project in Android Studio is,

  1. First save or run your current project.(Think you are currently running a app called "ClientAppOne").When you are running your app it will automatically saves the changes you made to it.
  2. Then go to the folder where the file is in.(Assume you have saved it in the Documents folder."ClientAppOne" will show as another sub folder inside the Document Folder)
  3. Copy it and paste in your desired folder(Assume again you want to save new application in Document folder).
  4. It will show another folder as "ClientAppOnecopy" so,rename it as "ClientAppTwo"(rename as your desired name)
  5. From Android Studio,go to File->Open->then select the Document and select ClientAppTwo folder.
  6. Then project will load on the Android Studio screen.
  7. Select the "com.example.clientappone" under the Java folder.
  8. Right click and select Refactor->Rename->Rename package->then add "ClientAppTwo" ->If you want you can do the preview by clicking "Do Prieview" -> click "Do Refactor"
  9. Then when you are running it,it won't create another application file as ClientAppTwo.This app also running as the same app called ClientAppOne.So for that you have to change the gradle file of ClientAppTwo As -changing Gradle
here we have to select the build.gradle(Module.app).Then in here we have to change the applicationId as: applicationId "org.sliit.clientapptwo"
"org.sliit.clientapptwo" is my package name.
(note:here I used "ClientAppOne" and "ClientAppTwo"used for demonstrations only)

沒有留言:

張貼留言