如何配置 Eclipse 以在 Ubuntu 上使用 Phonegap?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10872059/
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
How to configure Eclipse to use Phonegap on Ubuntu?
提问by hhh
Definition
Phonegap = tool to make things such as HTML5/Javascript games into phones. It is pretty cool because desktop versions should work in phones without extensive redoing things for other platforms.
定义
Phonegap = 将 HTML5/Javascript 游戏之类的东西制作成手机的工具。这非常酷,因为桌面版本应该可以在手机中运行,而无需为其他平台进行大量重做。
I can find the general instructions but everything about Eclipse and things like that. I cannot find a word about Ubuntu such as hereunless a lot of google -spam with a massive amount of confusing threads about different platforms where people are more-or-less bullying one another like herewith red-herrings such as google
. I wish there was some nice make -files to do things but no, the README is instruction to read the more-or-less ambiguous Get-Started. So:
我可以找到一般说明,但可以找到有关 Eclipse 之类的所有内容。我找不到像这里这样的关于 Ubuntu 的词,除非有很多谷歌垃圾邮件,其中包含大量关于不同平台的令人困惑的线索,在这些平台上,人们或多或少地像这里那样用诸如google
. 我希望有一些不错的 make 文件来做事,但不,自述文件是阅读或多或少模棱两可的入门指南。所以:
Problems
问题
Where can I find step-by-step instructions on Ubuntu to set up Phonegap?
I hope some outlining over different platforms.
ADT Plugin is not getting installed in Eclipse. Why?
我在哪里可以找到有关 Ubuntu 的分步说明来设置 Phonegap?
我希望在不同的平台上有一些概述。
Eclipse 中未安装 ADT 插件。为什么?
Android Eclipse ADT -problem
I can find herethe instructions but cannot move forward for some odd reason, no instructions or help -text to proceed. You can see in the photo that it does not allow me to click OK although I am following the instructions. I wish I could do this on console!
Android Eclipse ADT - 问题
我可以在这里找到说明,但由于某些奇怪的原因无法继续前进,没有说明或帮助文本可以继续。您可以在照片中看到,尽管我按照说明操作,但它不允许我单击“确定”。我希望我能在控制台上做到这一点!
回答by hhh
Definitions
AVP = Android virtual phone (you do not need all phones to test your code, use emulator)
ADB = application to push application from command-line to the phone
ADT -plugin in Eclipse = adding some buttons to Eclipse for things such as to add AVPs
ADT = Android Development Tools (not sure what they are actually, perhaps emulation-related things containing things such as linux kernels, APIs etc)
定义
AVP = Android 虚拟手机(不需要所有手机都测试你的代码,使用模拟器)
ADB = 将应用程序从命令行推送到手机的应用程序
Eclipse 中的 ADT -plugin = 向 Eclipse 添加一些按钮,例如添加 AVP
ADT = Android 开发工具(不确定它们实际上是什么,可能与仿真相关的东西包含诸如 linux 内核、API 等)
I am trying to provide instructions for console -power-users, hopefully helping to get things fast set-up instead of wasting time a lot with the cumbersome instructions.
我正在尝试为控制台高级用户提供说明,希望有助于快速设置,而不是在繁琐的说明上浪费大量时间。
1. set up the development environment such as the Android SDK here.
$ wget http://dl.google.com/android/android-sdk_r18-linux.tgz $ tar -xvzf *.tgz $ ...follow README or some tutorial there...
I. Now go back to the Android SDK site where you can find the ADT Plugin for Eclipse here. The unclikable button becomes clickable if you search now with the search-bar for Android something. The ADT stands for Android Development Tools so install everything you get there under something tools or related.
II. Fix the @override -problem (shortly requires 1.6 compiler -compliance-level), more here.
III. Test your Android installation work by loading an Android Sample -file and then plugging in your phone (with USB -debugging enabled: Settings > Development > click) or use Android Virtual Phone (=AVP)
$ adb devices # Shows your physics devices such # as phones with USB -debugging enabled. $ adb install ~/workspace/yourChosenSampleDemo/bin/*.apk # Your first Android -app emerges to your phone, have FuN!
2. Set up the Phonegap with the below:
1.建立开发环境,如在Android SDK这里。
$ wget http://dl.google.com/android/android-sdk_r18-linux.tgz $ tar -xvzf *.tgz $ ...follow README or some tutorial there...
I. 现在返回 Android SDK 站点,您可以在此处找到适用于 Eclipse 的 ADT 插件 。如果您现在使用 Android 的搜索栏进行搜索,则不可点击的按钮将变为可点击的。ADT 代表 Android 开发工具,因此请安装您在工具或相关工具下获得的所有内容。
二、修复@override -problem(很快需要 1.6 编译器 -compliance-level),更多在这里。
三、通过加载 Android 示例文件然后插入手机(启用 USB 调试:设置 > 开发 > 单击)或使用 Android 虚拟电话 (=AVP) 来测试您的 Android 安装工作
$ adb devices # Shows your physics devices such # as phones with USB -debugging enabled. $ adb install ~/workspace/yourChosenSampleDemo/bin/*.apk # Your first Android -app emerges to your phone, have FuN!
2.使用以下设置Phonegap:
The instructions are extremely inaccesible with Eclipse's click-click-something, poor! After wasting time with Eclipse's symlinks, I swiched to the console:
使用 Eclipse 的单击-单击-某事,这些说明非常难以访问,太差了!在 Eclipse 的符号链接上浪费时间后,我切换到控制台:
$ tree|less
$ search for the files needed, mark them done or use find -command directly ^C
$ copy the files to some dir such as ~/Android/Public so easier to do ^C
$ things at once ^C
$ pwd
/home/xyz/workspace/HelloCordova/res
$ cp ~/Android/phonegap-phonegap-475bfd2/lib/android/xml/* .
$ cp ~/Android/Public/cordova-1.7.0.js assets/www/
$ cp ~/Android/Public/cordova-1.7.0.jar libs/