Setting up PhoneGap on Ubuntu for Android app development
This is just some notes I made, mostly taken from http://docs.phonegap.com/en/3.0.0/guide_overview_index.md.html.
I was installing PhoneGap 3.0.0 on Ubuntu 12.04.
I use Sublime Text 3 for development, so didn’t want any of the Eclipse-based tools.
Environment
First, upgrade npm, and get the latest nodejs (by installing ‘n’ and running that):
npm update npm -g
sudo npm install n -g
sudo n stable
Now install phonegap itself
sudo npm install -g phonegap
Download the Android sdk from http://developer.android.com/sdk/index.html, put it somewhere sensible and unpack it:
sudo mv ~/Downloads/adt-bundle-linux-x86-20130917.zip /opt/
cd /opt
sudo unzip adt-bundle-linux-x86-20130917.zip
sudo chmod -R 777 /opt/adt-bundle-linux-x86-20130917
Update PATH in ~/.bashrc to include the phonegap tools:
# Add android sdk
PATH=$PATH:/opt/adt-bundle-linux-x86-20130917/sdk/platform-tools:/opt/adt-bundle-linux-x86-20130917/sdk/tools
and then ‘source ~/.bashrc’ to make sure you’ve got the new path setup.
Create an app
Create a phonegap app:
phonegap create my-app
cd my-app
Run the app
Run the app:
phonegap local run android
When I did this the first time, I got an error message:
[phonegap] adding the Android platform...
[error] Please install Android target 17 (the Android 4.2 SDK). Make sure you have the latest Android tools installed as well.
So, run ‘android’, select a target (e.g. “Android 4.2.2 (API 17)”), and click the “Install 8 packages..” button
May have to repeat the “Install..” stage – different licences to be accepted on each pass for system images etc?
The run again
phonegap local run android
Nope, still didn’t work – needed an emulator to be set up.
In the ‘android’ util, go to Tools -> Manage AVDs, use the “New” button to create a new AVD, then “Start..” the AVD.
First time, it failed with messages about not finding libGL.so. Second time, it started up the emulator..
Kill that one, run it again from the command line
phonegap local build android
phonegap install android
Fires up the emulator, installs the app (you have to find it on the Home screen, probably called “Hello World”..
Deploy to the phone
The emulator seems to run very slowly, and not give much sense of what the app will actually be like on the phone.
So, deploy the app – plug in Android phone via USB, select “USB debugging” in the Developer section of the settings on the phone, and the app will be installed on the phone when you next do “phonegap install…”
Add some plugins to the project
Once you get going, add some plugins to the project:
phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git
phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-media.git
参考文章:http://julianhigman.com/blog/2013/10/17/notes-on-setting-up-phonegap-on-ubuntu-for-android-app-development/
Setting up PhoneGap on Ubuntu for Android app development的更多相关文章
- Top 6 Programming Languages for Mobile App Development
Mobile application development industry in the last five years have multiplied in leaps and bounds, ...
- 使用PhoneGap搭建一个山寨京东APP
为什么要写一个App 首先解释下写出来的这个App,其实无任何功能,只是用HTML和CSS模仿JD移动端界面写的一个适配移动端的Web界面.本篇主要内容是介绍如何使用PhoneGap把开发出来的mob ...
- phoneGap开发环境搭建(android)
1. 首先安装nodejs (http://nodejs.org/) 2. 然后在命令行输入 npm 回车 假设出现下图: 则表示成功安装 3. 安装 npm install -g cordov ...
- 【Android 应用开发】Ubuntu 下 Android Studio 开发工具使用详解 (旧版本 | 仅作参考)
. 基本上可以导入项目开始使用了 ... . 作者 : 万境绝尘 转载请注明出处 : http://blog.csdn.net/shulianghan/article/details/21035637 ...
- 【Android 应用开发】 Ubuntu 安装 Android Studio (旧版本|仅作参考)
. 果断换Ubuntu了, Ubuntu的截图效果不好, 不能设置阴影 ... 作者 : 万境绝尘 转载请注明出处 : http://blog.csdn.net/shulianghan/article ...
- 使用PhoneGap搭建一个山寨京东APP(转)
为什么要写一个App 首先解释下写出来的这个App,其实无任何功能,只是用HTML和CSS模仿JD移动端界面写的一个适配移动端的Web界面.本篇主要内容是介绍如何使用PhoneGap把开发出来的m ...
- android app性能优化大汇总
这里根据网络上各位大神已经总结的知识内容做一个大汇总,作为记录,方便后续“温故知新”. 性能指标: (1)使用流畅度: 图片处理器每秒刷新的帧数(FPS),可用来指示页面是否平滑的渲染.高的帧率可以 ...
- 【Android 应用开发】Ubuntu 下 Android Studio 开发工具使用详解
. 基本上可以导入项目开始使用了 ... . 作者 : 万境绝尘 转载请注明出处 : http://blog.csdn.net/shulianghan/article/details/21035637 ...
- Ubuntu 配置 Android 开发 环境
. 果断换Ubuntu了, Ubuntu的截图效果不好, 不能设置阴影 ... 作者 : 万境绝尘 转载请注明出处 : http://blog.csdn.net/shulianghan/article ...
随机推荐
- iOS中 最新微信支付/最全的微信支付教程具体解释 韩俊强的博客
亲们, 首先让我们来看一下微信支付的流程吧. 1. 注冊微信开放平台,创建应用获取appid,appSecret,申请支付功能,申请成功之后会返回一些參数. 2. 下载微信支付sdk 3. clien ...
- ASP.NET MVC源码分析系列
Controller下的JsonResult的ExecuteResult方法 public override void ExecuteResult(ControllerContext context) ...
- Lr_debug_message,Lr_output_message,Lr_error_message,Lrd_stmt,Lrd_fetch
今天在群里,问了 Lr_debug_message,Lr_output_message,Lr_error_message,Lrd_stmt,Lrd_fetch.下 面我整理了下Lr_debug_mes ...
- HBase ProcedureV2 分析
Procedure V2, 是hbase1.1版本引入的一套fault-tolerant的执行multi-steps-job的框架, 目前主要用在Master中, 比如创建表,删除表等操作 新旧比较 ...
- Azure 服务监控API调用
概述 在使用Azure的过程中,很多用户希望通过code的方式获取服务在管理门户中显示的监视信息,如虚拟机的CPU.服务总线的总消息出入数等.目前Azure的大部分服务都已经支持通过监控器的API查询 ...
- HTTP协议—— 简单认识TCP/IP协议(转载)
原文地址(http://www.cnblogs.com/roverliang/p/5176456.html) 1.什么是TCP/IP 如果要了解一个人,可以从他归属的集体聊起来.我们的HTTP协议就 ...
- STL 容器(vector 和 list )
1.这个容器的知识点比较杂 迭代器的理解: 1.erase()函数的返回值,它的迭代器在循环遍历中的奇特之处: #define _CRT_SECURE_NO_WARNINGS #include < ...
- RJ45接口定义
RJ45接口定义 常见的RJ45接口有两类:用于以太网网卡.路由器以太网接口等的DTE类型,还有用于交换机等的DCE类型. DTE我们可以称做“数据终端设备”,DCE我们可以称做“数据通信设备”.从某 ...
- Unity3D_NGUI_性能优化实践_CPU卡顿
http://gad.qq.com/college/articledetail/7083468 博尔特以9.58秒创造了百米世界纪录,假设他是跑酷游戏的角色,卡顿一帧就足以把冠军拱手让人. Unity ...
- layui进度条bug
对于动态及生成的进度条,在渲染时候要使用element.init();element.init();element.progress('demo', percent+'%');