将 Android/Eclipse 项目移至新 PC

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4167335/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 15:19:49  来源:igfitidea点击:

Moving Android/Eclipse project to new PC

androideclipse

提问by gordonwd

Well, I hosed up my Android development PC, but didn't care all that much since I really needed a newer, much faster PC for this work. And here I am now with a high-end Windows 7 64-bit box.

好吧,我把我的 Android 开发 PC 弄脏了,但我并没有太在意,因为我真的需要一台更新、更快的 PC 来完成这项工作。我现在使用的是高端 Windows 7 64 位盒子。

Eclipse and all the Android components are up and running, but the one thing I'm having trouble with is how to get my previous project into the new workspace. I copied over my entire old workspace directory from the old disk and made that my Eclipse workspace, but it doesn't automatically see the projects that are there. I tried creating a new Android project "from existing source", but it complained about having "overlapping projects" or some such.

Eclipse 和所有 Android 组件都已启动并正在运行,但我遇到的一件事是如何将我以前的项目放入新工作区。我从旧磁盘复制了整个旧工作区目录并将其设为我的 Eclipse 工作区,但它不会自动看到那里的项目。我尝试“从现有源”创建一个新的 Android 项目,但它抱怨有“重叠项目”或类似的问题。

Is there a way to have it recognize the existing project files, or should I move them somewhere else, create the project from scratch, and then copy the old files back into the project tree? Or any other solutions?

有没有办法让它识别现有的项目文件,或者我应该将它们移到其他地方,从头开始创建项目,然后将旧文件复制回项目树?或者有其他解决方案吗?

采纳答案by gordonwd

There was one other complication. On my "old" PC I had been using Eclipse Helios, which apparently has some minor compatibility issues with ADT, so on my new PC I went with Galileo instead, and there might be some differences in existing files in the project directory.

还有另外一种并发症。在我的“旧”PC 上,我一直在使用 Eclipse Helios,它显然与 ADT 存在一些小的兼容性问题,因此在我的新 PC 上,我使用了 Galileo,并且项目目录中的现有文件可能存在一些差异。

In any case, what I did was to move my old project directory to a temp location, create a new project in Eclipse with the same name and basic settings, close Eclipse, copy my whole directory tree back into the new project directories, and then restart Eclipse. Eclipse bitched a bit about something, then went ahead and rebuilt everything.

无论如何,我所做的是将旧项目目录移动到临时位置,在 Eclipse 中创建一个具有相同名称和基本设置的新项目,关闭 Eclipse,将我的整个目录树复制回新项目目录,然后重新启动 Eclipse。Eclipse 对某事抱怨了一下,然后继续重建了一切。

I'm back in business! Thanks for all the responses.

我回来做生意了!感谢所有的回应。

BTW, the entire install process took a long time since I wasn't sure whether to install 64-bit Java or 32-bit (32-bit was required), etc. But it's nice to be running on a clean, fast PC instead of one that's been accumulating general crud for several years.

顺便说一句,整个安装过程花费了很长时间,因为我不确定是安装 64 位 Java 还是 32 位(需要 32 位)等等。但是在干净、快速的 PC 上运行还是很好的多年来一直在积累一般crud的一个。

回答by user432209

A super easy way is by just doing an Import.

一个超级简单的方法是做一个导入。

  1. Select File Import.
  2. Select Existing Projects Into Workspace and click next.
  3. Select the directory of the project file.
  4. Click Finish.
  1. 选择文件导入。
  2. 选择 Existing Projects Into Workspace 并单击下一步。
  3. 选择项目文件的目录。
  4. 单击完成。

You will have to do this for each project. Note, that you may need to remove the project folder that you copied into the workspace manually, because this procedure will automatically copy the folder and hierarchy for you.

您必须为每个项目执行此操作。请注意,您可能需要手动删除复制到工作区中的项目文件夹,因为此过程会自动为您复制文件夹和层次结构。

回答by Zoot

I used this method to code on my home machine as well as a development environment running from a live CD while attending classes in the computer lab.

我使用这种方法在我的家用机器上以及在计算机实验室上课时从 Live CD 运行的开发环境上进行编码。

  1. Get Dropbox.
  2. Put your workspace in a Dropbox folder.
  3. Point the new machine's Eclipse install to your Dropbox workspace folder after it has updated itself.
  4. Get back to coding.
  1. 获取Dropbox
  2. 将您的工作区放在 Dropbox 文件夹中。
  3. 新机器的 Eclipse 安装完成后,将其指向您的 Dropbox 工作区文件夹。
  4. 回到编码。

Hope this works for you. It did for me.

希望这对你有用。它对我有用。

回答by Daisy

I know that this is old question but it is a issue I ran into when moving my project over from my home theater PC to my new laptop so I can leave my HTPC to doing HTPC things. Anyways what I did was I imported my project from over the computer over the network to my new laptop using new android project from existing code. The files where populated but it changed my root folder name. Being OCD I wanted to change the name of the root folder back to what I had on the other machine. I found if I right clicked the item in the project tree and selected refactor I could rename it back to what it was on my HTPC. This then resulted in my laptop having a exact working copy of the code so I can program from here.

我知道这是个老问题,但这是我在将项目从家庭影院 PC 转移到新笔记本电脑时遇到的问题,这样我就可以让 HTPC 去做 HTPC 的事情。无论如何,我所做的是使用现有代码中的新 android 项目将我的项目通过网络从计算机导入到我的新笔记本电脑。填充的文件但它更改了我的根文件夹名称。作为强迫症,我想将根文件夹的名称改回我在另一台机器上的名称。我发现如果我右键单击项目树中的项目并选择重构,我可以将它重命名回我的 HTPC 上的名称。这导致我的笔记本电脑拥有代码的精确工作副本,因此我可以从这里进行编程。

回答by kaushik kyada

You can copy whole Workspace just through import>General>Existing Projects into Workspace>Select root Directory>finish

您只需通过导入>常规>现有项目到工作区>选择根目录>完成即可复制整个工作区

回答by HymanAW

Have you checked if the export/import eclipse mechanim works fine with 2 linked projects: android and app engine?

您是否检查过导出/导入 eclipse 机制是否适用于 2 个链接项目:android 和应用程序引擎?

回答by ggomeze

Move each of the projects in your hard disk to the new PC's workspace, or wherever you want to have them. Do not copy the metadata folder!. Then create new projects from existing sources (yes, you'll have to manually do this for each of the projects)

将硬盘中的每个项目移动到新 PC 的工作区,或任何您想要拥有它们的地方。不要复制元数据文件夹!。然后从现有源创建新项目(是的,您必须为每个项目手动执行此操作)

Ger

格尔