问题
How do I export a project in ZIP format in Android Studio?
I have always worked with Eclipse that has this feature.
回答1:
Starting with Android Studio 3.0, you can use File | Export to Zip File... to export your project. If you're using an older version, you can use the file manager of your operating system to pack the directory of your project into a .zip file.
回答2:
You can first push the project to Github and then download the project as zip. Only the necessary code will be pushed to Github, hence making it easier for others to go through the code.
Steps to push to Github:
1. In the Project Window, select Android. Only the app folder and necessary code can be seen.
2. Click on VCS
-> Import from Version Control
-> Share Project on Github
.
3. Enter project name and description.
4. Enter a commit message. You can select/deselect files to be pushed.
Note: You will have to setup Github first in Android Studio.
After this you will see a notification on top right of the IDE saying 'Project pushed to Github' and a hyperlink to the Github repository.
You can then download the repository as zip. This might seem to be a long process but it would help in the long run as your code can be easily managed using VCS within Android Studio itself.
回答3:
- right click on app folder
- then send to
- then compressed via zip
回答4:
If you want to export your project to a .zip you'll need to upgrade your version of Android Studio to version 3.0
回答5:
Following worked for me, Android Studio 2.0, assuming there are no libs.
A. From the source project
1. Copy /app/build.gradle
2. Copy /app/src/* including subdirectories (only contains manifest, java and resources)
B. Create new project with the same package name, minSDK etc.
1. Replace /app/build.gradle
2. Replace /app/src/* including subdirectories
C. Synchronize
D. Clean Project
回答6:
Windows:
First Open Command Window and set location of your android studio project folder like:
D:\MyApplication>
then type below command in it:
gradlew clean
then wait for complete clean process. after complete it now zip your project like below:
- right click on your project folder
- then select send to option
- now select compressed via zip
回答7:
- Go to File
- Choose option Export to Zip File
回答8:
It's easy, if you use git:
git archive -o latest.zip HEAD
回答9:
Setup Git if you haven't already in Android Studio. Its free. From the terminal provided in the Android Studio go to a new fresh directory. Run this command: git clone <app directory path>
This will copy all the required file to load the project and also the commit history to the current new directory.
来源:https://stackoverflow.com/questions/28030784/how-to-export-an-android-studio-project-as-a-zip-file