289

I just installed Phonegap for the first time and just browsed through the docs. What confuses me is the fact that some docs are using the command "phonegap" and some "cordova".

Android platform guide:

$ cordova create hello com.example.hello "HelloWorld"

Command Line Interface guide tells:

$ phonegap create hello com.example.hello HelloWorld

Is there a difference between those two commands (resulting in different files and folder structures) or are they just aliases for the same thing?

3
  • possible duplicate of How do Adobe PhoneGap and Apache Cordova differ?
    – givanse
    Feb 5, 2014 at 16:37
  • Refer to this Devgeeks article form 2014: TL;DR: If you don’t need to use the cloud build service at PhoneGap Build, just use the Cordova CLI tools, not the PhoneGap ones. May 28, 2015 at 6:16
  • No difference in the cmd if you refer to the quoted argument. Only reason to quote an arg on the cmd line is if it contains spaces or certain characters which have meaning to the terminal language. You can also escape said characters (incl space) with a backslash.
    – ekerner
    Aug 26, 2017 at 6:56

10 Answers 10

188

http://phonegap.com/blog/2012/03/19/phonegap-cordova-and-whate28099s-in-a-name/

I think this url explains what you need. Phonegap is built on Apache Cordova nothing else. You can think of Apache Cordova as the engine that powers PhoneGap. Over time, the PhoneGap distribution may contain additional tools and thats why they differ in command But they do same thing.

EDIT: Extra info added as its about command difference and what phonegap can do while apache cordova can't or viceversa

First of command line option of PhoneGap

http://docs.phonegap.com/en/edge/guide_cli_index.md.html

Apache Cordova Options http://cordova.apache.org/docs/en/3.0.0/guide_cli_index.md.html#The%20Command-line%20Interface

  1. As almost most of commands are similar. There are few differences (Note: No difference in Codebase)

  2. Adobe can add additional features to PhoneGap so that will not be in Cordova ,Eg: Building applications remotely for that you need to have account on https://build.phonegap.com

  3. Though For local builds phonegap cli uses cordova cli (Link to check: https://github.com/phonegap/phonegap-cli/blob/master/lib/phonegap/util/platform.js)

    Platform Environment Names. Mapping:

    'local' => cordova-cli

    'remote' => PhoneGap/Build

Also from following repository: Modules which requires cordova are:

build
create
install
local install
local plugin add , list , remove
run
mode
platform update
run

Which dont include cordova:

remote build
remote install
remote login,logout
remote run
serve
8
  • 2
    Good to know but this is the question about the difference between the cli commands (if any).
    – Hexodus
    Aug 11, 2013 at 17:45
  • @Hexodus You can think of Apache Cordova as the engine that powers PhoneGap. Over time, the PhoneGap distribution may contain additional tools and thats why they differ in command But they do same thing.
    – Abhishek
    Aug 11, 2013 at 18:03
  • 2
    Thanx Abhishek - this answered my question. I thought that there might be something more with phonegap vs cordova commands which are still confusing...
    – Hexodus
    Aug 13, 2013 at 10:30
  • 6
    So Why is the doc so confusing about it? I can read $ sudo npm install -g phonegap here, where I download phone gap, and then in the associated documentation here, in the CLI section where you set up a new app, they are using cordova like so: $ cordova create hello com.example.hello HelloWorld I can't find any relation between the code given in the dl page and the ones given in the docs of phonegap that exclusively uses cordova command line (at least for the CLI section where you are supposed to get started)
    – Miles M.
    Jan 13, 2014 at 20:51
  • 1
    The docs are really confusing to some extend like highlighted by Miles. M. They asked you to install phonegap using npm, but in the following docs, nearly all commands use cordova instead of phonegap.
    – wmfairuz
    Jun 29, 2014 at 21:49
80

Late answer but I think this might be useful.

There are differences between the two cli, phonegapis a command that encapsulates cordova. In the create case the only difference is an overriden default app

In some other cases the difference is much more significant. For instance phonegap build comes with a remote build functionality while cordova build only supports local builds.

A big limitation I found to PhoneGap is that, AFAIK, you can only build a release APK using the PhoneGap Build service. On Cordova you can build with cordova build android --release.

6
  • 1
    But what about "phonegap local build" ? Oct 31, 2013 at 15:32
  • 1
    Even with that I don't think you can build a release apk. phonegap local build android and phonegap build android are the same commands.
    – htulipe
    Nov 4, 2013 at 11:50
  • 2
    It seems that it is possible to perform a local build for a release APK: chris-allen-lane.com/2012/12/…
    – donturner
    Nov 10, 2013 at 7:07
  • 7
    Adobe® PhoneGap™ Build is a web service that compiles PhoneGap apps for you remotely, making downloadable packages available in a simple web interface at build.phonegap.com. If you use PhoneGap Build, you don't need to install and maintain local SDK tools for several mobile platforms, and can expect to update projects smoothly. That said, if you want to build your own APK locally without using Adobe's build, then, follow your target platform guide here: docs.phonegap.com/en/edge/…
    – numediaweb
    Dec 10, 2013 at 10:07
  • yeah I was worried I'd have to pay using the phonegap command. It sounds better to use cordova Feb 26, 2014 at 5:04
23

From what I've read (and please correct me if Im wrong):

Phonegap claim that they started trying to make this but couldn't, so they passed it to the Apache Software Foundation.

Apache in their awesomeness (Long live Apache) fixed it, developed it, and made it supremely awesome.

Now Phonegap are trying to maintain and enhance a copy they took back, but keep stuffing it up.

So, by my thinking, I want a solid and trustworthy dev platform made by seasoned professionals that I can trust, rather than a patched upon sub-version of said. Therefore Id say I am a Cordova developer NOT a Phonegap developer.

Iv also read that in a second desperate attempt to gain popularity and control over the great works of Apache, Phonegap has now been sold under the Adobe flag. You know Adobe, they are the guys who do nothing for free and are so bad at maintaining software life-cycles that their apps need to perform updates every time you blink, and for some reason each of their apps are about 100 times the size you would expect.

I guess that is the summary of my research if I didn't read it wrongly.

And if true, then lets all drop this whole Phonegap nonsense and just stick with Cordova.

4
  • 2
    Don't be to hard to Adobe - they do a really amazing job in maintaining their software. Think on Photoshop - it's out there since 24 years and still the best in the field. Phonegap is more the cloud build service then anything else. The code seems to be pretty much the same as Cordova - otherwise they counldn't adopt new cordova version so quickly. The cloud service makes the build process really easy. For me as Creative Cloud user it's all inculsive.
    – Hexodus
    Sep 7, 2014 at 9:19
  • 2
    :) OK. However Adobe are renowned for their bloated and overly updated apps, for which developers have been griping at them for most of those 24 years, hence the site: dearadobe.com Its extremely easy to compile/build Cordova apps using the designed methods, so to me the only thing that the cloud adds is cost. However I know how some developers are reluctant to learn command line interfaces and so I can understand the profitability and therefore existence of the cloud. I guess young and/or green players will enjoy its convenience.
    – ekerner
    Sep 7, 2014 at 20:04
  • 1
    Those CLI reluctant devs can breathe easy then as Cordova is now VS 2013 Update 3 compatible :) visualstudio.com/explore/cordova-vs
    – rism
    Sep 22, 2014 at 13:25
  • 2
    Wow rism that is extremely interesting. MS (the mother platform specific focus) finally seem to be joining the rest of us. Kudos to them for not only employing Cordova and crediting Apache, but also supporting non MS platforms iOS and android. I am completely taken aback by this. I may have to stop boycotting them if they keep this attitude up.
    – ekerner
    Sep 22, 2014 at 15:57
13

Here are differences that I have discovered:

I am comparing the phonegap 3.3.0-0.18.0 CLI to the functionality described in the cordova 3.3.0 documentation for that CLI.

  1. "ls" is an option for "cordova plugin" but not for "phonegap plugin". You must use "list" instead. e.g.: "phonegap plugin list"

  2. "serve" is not documented in "phonegap -help" but it does exist and it does work. It will not find and load phonegap.js so the pages never fully load but it still does provide some value. I'm not sure if this is different than the behavior cordova.

  3. "phonegap platform add " does not work in phonegap. You must do a "phonegap build " to add support for a platform.

Note that you may also experience some confusing error messages in phonegap where the suggested solution refers to using the cordova command.

6

I have also noticed that cordova has a "serve" command that Phonegap doesn't. This command launches a local server on port 8000. This is handy for running your app in Chrome and using the Ripple emulator.

4
  • 2
    It's worth noting that the Ripple emulator chrome extension is broken, and is now a Node.js command line tool under the Apache Incubator. npm install -g ripple-emulator, then from within your project dir: ripple emulate --path platforms/android/assets/www
    – razorbeard
    Dec 10, 2013 at 14:44
  • Can you expound upon "broken", @Synaptix? It seems to be working for me.
    – zkent
    Dec 11, 2013 at 5:27
  • 2
    Have a read of this: raymondcamden.com/index.cfm/2013/11/5/Ripple-is-Reborn
    – razorbeard
    Dec 11, 2013 at 10:34
  • Phonegap has desktop GUI that let's you do that "serve". By downloading Phonegap application for Android or iOS you can also directly test application on the device quickly, without running the long starting emulator. Mobile Phonegap application connects via wifi to your local server on port 3000 and displays your app on your device, giving you view and performance feeling.
    – Astrowie
    Jan 6, 2017 at 1:32
5

they re both identical, except that phonegap cli can help you build your application on PhoneGap Build. My suggestion is to use the cordova CLI if you don't use the PhoneGap build service.

4

This first choice might be a confusing one but it’s really very simple. PhoneGap is a product owned by Adobe which currently includes additional build services, and it may or may not eventually offer additional services and/or charge payments for use in the future. Cordova is owned and maintained by Apache, and will always be maintained as an open source project. Currently they both have a very similar API. I would recommend going with Cordova, unless you require the additional PhoneGap build services.

0
1

Above, Abhishek mentions the command line differences specified in two URLS:

  1. PhoneGap: http://docs.phonegap.com/en/edge/guide_cli_index.md.html

  2. Cordova: http://cordova.apache.org/docs/en/3.0.0/guide_cli_index.md.html#The%20Command-line%20Interface

One thing to point out is that, as of this post, the phonegap one looks to be almost the same as the cordova one, and is probably not an accurate image of the command line option differences. As such, I installed both on my system so I could look at the differences.

These are just a few of them. Hopefully they are brought more in sync sometime. If anyone has better information, please tell me.

  1. Adding platforms seems to be done differently between the two commands ( phonegap uses "install" command, cordova uses "platform add" command )
  2. Adding/creating projects seems to be the same between the two commands ( same command line options supported )
  3. Obviously, as has been stated, phonegap can use PhoneGap Build, so it has the corresponding options to trigger that or local builds
  4. Quite a few other significant command line differences, simply by running "cordova help" and "phonegap help" and comparing the two.

I guess my point is that the phonegap CLI documention mentioned quite often is not really for the phonegap CLI, but for the cordova CLI, at this time. Please tell me if I am missing something. Thanks.

1

I found this difference which forced me to use a mixed bag of phonegap and cordova cli commands when building my app:

'phonegap plugin add' couldn't handle command line parameters correctly, whereas 'cordova platform add' works flawlessly

The command I use is:

'cordova plugin add https://github.com/crittercism/PhoneGap.git --variable IOS_APP_ID="[my_license_key]"

Note I am using phonegap 3.5

0

Now a days phonegap and cordova is owned by Adobe. Only name conversation was different. For install plugin functionality , we should use same command for phonegap and cordova too.

Command : cordova plugin add cordova-plugin-photo-library

Here,

  • cordova - keyword for initiator
  • plugin - initialize a plugin
  • cordova plugin photo library - plugin name.

You can also find more plugin from https://cordova.apache.org/docs/en/latest/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.