In order to create our Mega App's initial files from the Cordova CLI, we run the cordova create
command as follows:
> cordova create megaapp com.jsmobile.megaapp MegaApp
Then, we will add the following Cordova plugins to our project using the cordova plugin add
command:
> cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-camera.git
> cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-media.git
> cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-file.git
> cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git
> cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs.git
As we support three platforms (iOS, Android, and Windows Phone 8), we run the following cordova platform add
command from the app
directory to add the platforms that we want to support:
> cd megaapp > cordova platform add ios > cordova platform add android > cordova platform add wp8
Finally, we can build our app on all the platforms using the following cordova build
command:
> cordova build
Do not forget to apply the general Cordova 3.4 app fixes for iOS 7 and Windows Phone 8, which were illustrated in detail in Chapter 3, Apache Cordova Development Tools.
18.117.186.46