简体   繁体   中英

How can I share an Android Studio project

I found that Android Studio has no exporting functionality for projects (other than .apk export ofcourse). I would like to share a copy of my project online, and I found that simply sharing a copy of my Workspace project isn't ideal as it contains temporary build files and configurations specific to my project's location.

How to optimize & prepare my project for sharing it?

First off all you need to make a copy of your project (you don't want to be modifying your own current workspace copy) to share.

Remove redundant files
Ensure that you can view hidden files and remove the following directories (where applicable) from your copy:

  • /.gradle
  • /build
  • /captures
  • /projectFilesBackup
  • /app/build
  • /.git (if applicable)

Change project directory
If you won't be sharing the project inside a directory that has the same name as the directory name of your project in the workspace.

  1. Rename the project directory
  2. Rename the .iml file inside the project directory to match the project directory's name
  3. In /.idea/modules point to your new .iml file

Remove any local properties
Your project might refer to any local SDK's. For example in local.properties clear any references to your SDK directory.

If you have removed version control from your project, also remove .idea/vcs.xml

These are just my own findings, and I'm sure this list can be improved so feel free to make any edits!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM