Skip to content

Cordova overview

Introduction

Cordova cli

The Cordova cli is a command line tool that is used to create, build and run Cordova apps. It is also used to add and remove plugins. It is a node package that can be installed globally on your machine.

bash
npm install -g cordova

Cordova project structure

.
├── config.xml
├── hooks
├── platforms
├── plugins
├── www
└── package.json

config.xml

The config.xml file is the main configuration file for the Cordova app. It contains information about the app, such as the name, description, version, etc. It also contains information about the plugins that are installed, and the platforms that are installed. It is also used to configure the app for release, such as signing certificates, etc.

hooks(we currently don't use hooks)

Hooks are scripts that are run at certain points in the Cordova lifecycle. For example, you can run a script before the app is built, or before the app is run. This is useful for automating tasks, such as copying files, or running tests.

platforms

The platforms folder contains the native code for each platform that is installed. For example, if you have installed the iOS platform, it will contain the iOS project. If you have installed the Android platform, it will contain the Android project.

Running cordova platform add ios will create the iOS project in the platforms folder. Running cordova platform add android will create the Android project in the platforms folder.

plugins

See Plugins for more information.

www

The www folder contains the web assets for the app. This is where the html, css and javascript for the app is stored. This is the code that is run inside the webview. This is where our main app code is stored.