Skip to content

Building applications

oliver-moran edited this page Oct 4, 2014 · 5 revisions

Savvy applications are built using a command-line interface (CLI) running under Node.js. This CLI allows you to create and build Savvy applications with various options.

You must have Node.js installed before you can build a Savvy application. After installing Node.js, install Savvy from the command line by typing:

$ npm install savvy -g

On Mac and Linux, you may need to do this as the superuser by typing: sudo npm install savvy -g.

After installing the CLI, a full list of help options is available by typing:

# savvy --help

### Building Savvy apps ###

To create an empty Savvy project (in a preferably empty directory), type:

$ savvy --create <src_dir>

To then build the application, type:

$ savvy --src <src_dir> --out <output_dir>

This will create a build of your application (in <src_dir>) in the output directory (<output_dir>).

This build can be deployed to a HTTP server and is suitable to be visited by on mobile, tablet and smart TV. Additionally, Savvy builds include features specially suited for saving to the home screens of iOS and Android devices.

Other build options

Savvy applications can also be built and served over HTTP server using:

$ savvy --src <src_dir> --port <http_port>

Or as zip files, using:

$ savvy --src <src_dir> --zip <output_file>

Or as a combination of all, for example as follows:

$ savvy --src ~/Desktop/src --out ~/Desktop/app --zip ~/Desktop/app.zip --port 8080

Note that the build process strips all console.log() statements from code. If you want to keep them, you will need to build a debug build, using the --debug flag. For example, as follows:

$ savvy --src ~/Desktop/src --port 8080 --debug

Building hybrid applications

If you want to build an hybrid for iOS, Android, Windows or Firefox OS, you will need to additionally package your application using Apache Corova or Adobe PhoneGap. Hybrid app allow you to use native features of the devices and to deploy your application on the iOS App Store, Google Play store, Windows app store or Firefox OS Marketplace

For instructions on how to build hybrid apps using Savvy, see [Building hybrid apps with Savvy](Building hybrid apps with Savvy).