使用多台计算机开发 Android 程序
我正在工作中开发一个项目,但希望能够将该项目带回家并继续进行。我不能只是“打开”一个项目,那么将其保存在一台计算机上,然后从家里打开它,然后再次保存以在家中处理它的设置是什么?
I am developing a project from work, but would like to be able to take the project home and continue it. I can't just "open" a project, so what are the settings to save it on one computer, then open it from home, then save it again to work on it from home?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我使用 Dropbox。我的 Eclipse 工作区位于我的 Dropbox 文件夹内,因此每当我在任何计算机上加载 Eclipse 时,我总是可以轻松获得文件的最新版本。
这还为您带来了额外的好处,即不必担心硬盘故障并且能够回滚文件。
I use Dropbox. My Eclipse workspace is inside my Dropbox folder, so whenever I load up Eclipse on any of my computers, I always have the most updated versions of my files without any hassle.
This also gives you the added benefit of not having to worry about a harddisk failure and being able to rollback files.
要么按照 Glendon 所说的去做,要么设置一个 subversion 或 git 存储库。
我通常两者都做。
Either do as Glendon said or setup a subversion or git repository.
I usually do both.
如果您不使用 Dropbox 或 github,我假设您正在通过电子邮件发送代码或使用 USB 驱动器。将项目解压到另一台计算机的主目录后,运行 Eclipse 并执行
“文件”、“新建”、“Android 项目”
输入项目名称
在内容中,选择从现有源创建项目
在位置中,浏览到您刚刚在主目录中创建的目录
选择构建目标
并单击完成(假设其他设置已为您填写)。
If you're not using Dropbox or github, I assume you're emailing the code or using a USB drive. After you've unzipped your project to your other computer's home directory, run Eclipse and do
File, New, Android Project
enter the Project Name
in Contents, select Create project from existing source
in Location, browse to the directory you just created in your home directory
choose a Build Target
and click Finish assuming the other settings have been filled in for you.
我也做了同样的事情,将一个裸露的 git 存储库放在记忆棒上,并将其克隆到所有开发机器上。
由于开发机器上的存储库是从记忆棒上的存储库克隆的,因此它们的“起源”将指向记忆棒。因此,当我从一台开发机器跳到另一台开发机器时,我所要做的就是
完成。
这样做的好处是,即使您忘记了操作棒,或者忘记同步并最终在过时的目录上工作,您也可以利用 git 的所有功能轻松地解决它。
I do the same thing by putting a bare git repository on a memory stick and cloning it onto all development machines.
As the repositories on the development machines are cloned from the one on the stick, their "origin" will point back to the memory stick. So all I have to do when bouncing from one development machine to the other is
and I am done.
What is nice about this is that even if you forget the stick, or forget to synchronize and end up working on an outdated directory, you can untangle it easily with all the power of git.