Eclipse项目中的Android项目可以在windows和linux下运行
我当前的 Android 开发环境由位于 Windows 共享(实际上是 Samba/CIFS)上的 Eclipse 项目组成。
这使我可以从一个工作站切换到另一个工作站,而无需同步或签出文件。
只要所有机器都只有 Windows(XP、7),这个设置就很好用,但现在我也想在 Ubuntu 10.04 机器上进行开发。
我设法使用最新的 Eclipse Indigo (3.7.1) 设置我的 Ubuntu 10.04 系统,访问共享 Samba 卷上的工作区。
它运行良好,但这迫使我更改 Android Preferences
中的 SDK Location
字段(Window > Preferences > Android)。这是因为 Windows 系统上的 Android SDK 路径(通常是 C:\android-sdk-windows
)与 Linux 系统上的路径(例如 /usr/local/bin/ android-sdk-linux
)。
有什么想法如何“完善”这个设置,这样我就不必改变它?
例如,一种可能性是将 Android SDK 也放在 Windows 共享上,但是:
- 即使如此,路径符号也是不同的(反斜杠与正斜杠) 斜线等)
- 构建将变得比当前更慢。
另一种可能性是看看环境变量%ANDROID_HOME%是否可以创造性地用于此目的。
更新:尝试在 Windows 端使用 %ANDROID_HOME% 会导致值必须是现有目录
错误,甚至无法启用确定
按钮保存此内容。看起来我想要完成的事情是不可能的。
My current Android development environment is comprised of Eclipse projects that are located on a Windows share (Samba/CIFS actually).
This allows me to switch from one workstation to another without having to sync or check-out files.
As long as all machines were Windows only (XP, 7) this setup works great, but now I would like to develop from an Ubuntu 10.04 machines as well.
I managed to setup my Ubuntu 10.04 system with the latest Eclipse Indigo (3.7.1), accessing the workspace on the shared Samba volume.
It works well, but this forces me to change the SDK Location
field in Android Preferences
(Window > Preferences > Android). This is because the Android SDK path is different on a Windows system (usually C:\android-sdk-windows
) from the one on a Linux system (e.g. /usr/local/bin/android-sdk-linux
).
Any ideas how to "perfect-ize" this setup so that I don't have to change even that?
For example, one possibility would be to put the Android SDK on the Windows share, too, but:
- The path notations are different even then (backslash vs. forward
slash, etc.) - Build would become even slower than what it is currently.
Another possibility is to see whether the environment variable %ANDROID_HOME% can be creatively used for this purpose.
UPDATE: Attempting to use %ANDROID_HOME% on the Windows side, results in Value must be an existing directory
error and won't even enable the OK
button to save this. It looks like what I am trying to accomplish isn't possible.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论