Giter Site home page Giter Site logo

cordovaboilerplate's Introduction

Cordova Mobile App

Setup

Before you can run/build the application, you'll need to take a few steps yourself.

Installing Dependencies

You need to install the latest node.js, which we use for server-side devops tools.

Once node (and, by extension, npm) is installed, go into the application directory and run:

npm install;
sudo npm install -g bower grunt-cli ios-sim;
bower install;

You will also need to make sure to have the latest JRE and JDK for Java.

Platforms

If you want to be able to build the mobile app, you will also need the Android SDK and iOS SDK installed.

Assuming you have brew in your system, the easiest way to go about this is to make sure you have XCode installed, and:

brew install android-sdk ant

You need to make sure ANDROID_HOME is set appropriately. If you installed using brew, something like this in your ~/.bash_profile or ~/.zshrc (or wherever you manage things) should be good enough:

# ~/.bash_profile
export ANDROID_HOME=/usr/local/opt/android-sdk

Once that's done, you need to launch $ android and install the SDK for Android 4.4 (API 21) through that interface, then run $ android avd and create a single virtual device for emulation.

See the Cordova Platform Guides and the respective SDK platform docs for more details.

Running the App in a browser for development

To start the server:

grunt serve

Working with the mobile app

Before any building, emulating, or releasing can happen, you must do one-time setup of the cordova directory:

grunt init

You should only even have to do this once, or after the build/ directory has been cleaned (and occasionally to recover from strange states). Occasionally, if you get errors from bower, like Cannot find http://path/to/some/file you may also need to update your bower, by doing:

bower up

Builds

To build a release the compiled versions of the application:

grunt build [{android,ios,web}]

This will build the webapp and both mobile applications. The following files will be available under dist/ in the project root:

  • myCordova-PLATFORM-(un)signed.{app,apk} - Signed or unsigned mobile packages.
  • myCordova.tgz - A compressed version of the built webapp.

Additionally, the following will be available under build/ in the root:

  • cordova/ - The cordova working directory with its entire structure and the built webapp in www/.
  • release/ - An uncompressed, browsable version of the webapp.

Both of the above are accessible through a symlink in www/build, so you can go to http://localhost:8125/build/release/production.html to try out the built application.

Running on a device or emulator

Once a build is complete, you can run the mobile app through the command line on your desired platform with the following:

grunt {android|ios} [--force-emulator]

The android command will try to run on a device connected for USB debugging, and if no device is found, will run the application in the android emulator instead. Use --force-emulator to skip the device checking step and go straight to running an emulator.

Debugging in the Android browser

You can use Remote Debugging on Chrome to debug the app on both the android emulator and your phone.

To access the remote debugger, simply visit chrome://inspect in your Chrome browser. If you want to access your phone, you'll also need to tick the USB checkmark, and make sure your phone has USB debugging turned on. See the link above for instructions on how to do all this.

You can also use adb to see console messages from the mobile app, whether running through the emulator or on a phone:

adb logcat -s chromium

cordovaboilerplate's People

Contributors

moschel avatar hurgleburgler avatar nlundquist avatar

Stargazers

Wil avatar Riccardo Bartoli avatar  avatar Marshall Thompson avatar

Watchers

 avatar Justin Meyer avatar Cherif Bouchelaghem avatar  Matthew Phillips avatar Jamie McCue avatar Jan Jorgensen avatar Joseph Khoury avatar Manuel Mujica avatar Alfredo Delgado avatar James Cloos avatar Joel Kuzmarski avatar Mick McGrath avatar Ben avatar John Gardner avatar Mark Repka avatar Nick Charbonneau avatar Rich McNeary avatar Denison Luz avatar Alexander (AJ) avatar Jennifer Wadella avatar Will Drach avatar  avatar Luke Whyte avatar  avatar Wade H. avatar Skyler avatar Kyle Gifford avatar Matt Chaffe avatar Hanna Kutcher avatar  avatar  avatar Adam Groom avatar Ryan Spencer avatar Paula avatar Austin Sanders avatar Justin Lawrence avatar Idris Shedu avatar Mark Thompson avatar  avatar Chasen Le Hara avatar Slava Knyazev avatar Jarett Martin avatar Ivan avatar Mike 'mitch' Mitchel avatar BenS avatar Youssef A avatar Kyle Nazario avatar  avatar Michael Haynie avatar Weston Vincze avatar Phil Henning avatar Srivats avatar Brad Momberger avatar  avatar  avatar

Forkers

icodehome-node

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.