Reputation: 355
I started learning how to build mobile apps using the ionic framework.
I do see people using ionic build and others use cordova build.
I will like to know the difference between the two and when to use them.
Upvotes: 5
Views: 2633
Reputation: 2672
Looking at the code https://github.com/driftyco/ionic-cli/blob/master/lib/ionic/cordova.js ionic build and cordova build seems to be the same. No conditionals set for 'build' command there. Building command requires platform so it sets isPlatformCmd within the code, but it is used only with 'add' or 'remove' commands.
So the only difference for the 'build' seems to be returning success return code no matter how internally executed cordova ends.
.then(function() {
return self.runCordova(cmdName, argv);
})
.then(function(runCode) {
//We dont want to do anything if the cordova command failed
if(runCode !== 0 || argv.nosave) {
return
}
...
}
Upvotes: 3
Reputation: 191728
They are the same. (emphasis added)
The
build
command builds an app for a specific platform. Pass in eitherios
orandroid
to generate platform specific code in the platforms subdirectory.The
build
command is a proxy for Cordova’sbuild
command.
Upvotes: 4
Reputation: 69
Apache Cordova is community project, letting you build mobile apps for various mobile platforms with one unique code base, as you develop your app with web technologies (HTML5, Javascript and CSS3) instead of relying on platform-specific APIs like those in Android, iOS, or Windows Phone.
Ionic Framework is a set of css classes and a library of Javascript directives and modules, built on top of Cordova, with AngularJS.
Upvotes: -2