Is there a difference between PhoneGap and Cordova commands?
Asked Answered
B

10

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?

Birt answered 11/8, 2013 at 17:10 Comment(3)
possible duplicate of How do Adobe PhoneGap and Apache Cordova differ?Goldfilled
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.Wend
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.Compton
S
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
Seedtime answered 11/8, 2013 at 17:26 Comment(8)
Good to know but this is the question about the difference between the cli commands (if any).Birt
@Birt 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.Seedtime
Thanx Abhishek - this answered my question. I thought that there might be something more with phonegap vs cordova commands which are still confusing...Birt
For example, within the same installation phonegap platform add android is not a valid command, while cordova platform add android is.Cocktail
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)Metaphase
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.Goiter
Never answered the OP question - what is the difference (if any) between the two commands OP gave? Is the phone gap one just a pass through to the cordova variant? Why does the phone gap download page have you install phone gap and do the phone gap build command while their getting started guide gives the exact same procedure but swaps out phone gap for cordova?Incompliant
Article link appears broken, updated link is phonegap.com/blog/2012/03/19/…Bedfellow
K
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.

Keffiyeh answered 27/9, 2013 at 9:30 Comment(6)
But what about "phonegap local build" ?Derrick
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.Keffiyeh
It seems that it is possible to perform a local build for a release APK: chris-allen-lane.com/2012/12/…Bartholomeus
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/…Chanell
yeah I was worried I'd have to pay using the phonegap command. It sounds better to use cordovaBridesmaid
There are ways to build a release APK from a Phonegap project, but through Cordova at the end: https://mcmap.net/q/109821/-build-android-release-apk-on-phonegap-3-x-cli/806975Microphone
C
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.

Compton answered 13/7, 2014 at 15:11 Comment(4)
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.Birt
:) 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.Compton
Those CLI reluctant devs can breathe easy then as Cordova is now VS 2013 Update 3 compatible :) visualstudio.com/explore/cordova-vsCombustion
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.Compton
R
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.

Rana answered 19/1, 2014 at 7:36 Comment(0)
W
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.

Would answered 3/12, 2013 at 3:32 Comment(4)
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/wwwKopeisk
Can you expound upon "broken", @Synaptix? It seems to be working for me.Would
Have a read of this: raymondcamden.com/index.cfm/2013/11/5/Ripple-is-RebornKopeisk
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.Nephology
E
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.

Entoblast answered 6/9, 2014 at 12:17 Comment(0)
B
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.

Buie answered 6/2, 2016 at 17:43 Comment(0)
I
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.

Isauraisbel answered 23/5, 2014 at 16:55 Comment(0)
L
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

Louielouis answered 14/1, 2015 at 19:46 Comment(0)
L
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/

Liminal answered 1/8, 2018 at 10:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.