Home > English, Uncategorized > Quick PhoneGap setup on Ubuntu

Quick PhoneGap setup on Ubuntu

(tested on Ubuntu 14.04)

Install NodeJS

Go to https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager to get the following instructions updated:

curl -sL https://deb.nodesource.com/setup | sudo bash -
sudo apt-get install nodejs

Install PhoneGap

sudo npm install -g phonegap
sudo npm install -g cordova

If some part of the output of this (xcode, etc) gives error messages, I recommend uninstalling (sudo npm uninstall phonegap) and trying again, to avoid weird dependency issues later on.

The Cordova installation seems not to be mandatory, although you will need it if you start installing Cordova plugins.

Create a PhoneGap app

phonegap create my-app
cd my-app
phonegap run android

This last line is to run it as an Android app (but you can also do that in other environments).

If, for some reason (libraries dependencies, etc) the last line doesn’t work, you can still test your app launching the PhoneGap local server in what I understand is a special independent web mode, by typing

phonegap serve

This will give you the IP that you need to give in the next step.

Test your PhoneGap app

Since recently, PhoneGap offers a PhoneGap “app” that will allow you to run a locally-developed app on your device.

See instructions here http://app.phonegap.com/ (or basically download the “PhoneGap Developer” app).

Installing the Android SDK

Remember the failing “phonegap run android” command above? Well, this was due to the missing Android SDK. To get it, you need to do something like this:

wget http://dl.google.com/android/android-sdk_r23.0.2-linux.tgz

And then uncompress the file

tar zxvf android-sdk_r23.0.2-linux.tgz

Finally, you’ll have to add the path to some of the subfolders of this uncompressed archive to your PATH system variable:


export PATH

If you only do this, you’ll have to repeat this action after each reboot (at least when you want to “phonegap run android”).

Categories: English, Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: