GithubHelp home page GithubHelp logo

mohammedta / steal-cordova Goto Github PK

View Code? Open in Web Editor NEW

This project forked from stealjs/steal-cordova

0.0 1.0 0.0 133 KB

Easily make Cordova projects with Steal

Home Page: https://www.npmjs.com/package/steal-cordova

License: MIT License

JavaScript 98.67% HTML 1.33%

steal-cordova's Introduction

npm version

steal-cordova

Develop your project as a web application and then simply use steal-cordova to create Android and iOS Cordova apps.

Install

npm install steal-cordova --save-dev

If you are developing for android you also need to install the Android SDK and Ant. You have a lot of options on how to do this. If using OSX the easiest way is with Homebrew:

brew install android-sdk ant

After installing set the ANDROID_HOME environmental variable:

export ANDROID_HOME=/usr/local/opt/android-sdk

To make this permanent set it in your .bashrc or .zshrc or whatever shell you use.

Example

steal-cordova needs a BuildResult object which you get from running StealTools multi-build:

var stealTools = require("steal-tools");

var cordovaOptions = {
  buildDir: "./build/cordova",
  id: "com.hello.world",
  name: "HelloWorld",
  platforms: ["ios", "android"],
  index: __dirname + "/index.html"
};

var stealCordova = require("steal-cordova")(cordovaOptions);

var buildPromise = stealTools.build({
  config: __dirname + "/package.json!npm"
});

buildPromise.then(stealCordova.build);

API

Pass in your Cordova options to steal-cordova to create a stealCordova object that can be used to run builds, start emulators and run on Android devices.

stealCordova

var stealCordova = require("steal-cordova")(cordovaOptions);

stealCordova.build

stealCordova.build(buildResult) -> Promise

Pass a BuildResult object from StealTools' multi build. Returns a Promise that will resolve when the Cordova application has built.

stealCordova.android.emulate

stealCordova.android.emulate() -> Promise

Call to start an Android emulator with your project. Returns a promise that will resolve when the application has booted.

stealCordova.android.run

stealCordova.android.run() -> Promise

Run your application on an Android device. Device must be connected prior to running this command.

stealCordova.ios.emulate

stealCordova.ios.emulate() -> Promise

Call to start an iOS emulator running your application. Promise will resolve after the application has booted.

Configuration

CordovaOptions

Supports same options as node-webkit-builder, but at minimum needs:

buildDir

id

name

platforms

License

MIT

steal-cordova's People

Contributors

alfredo-delgado avatar chasenlehara avatar greenkeeper[bot] avatar matthewp avatar phillipskevin avatar

Watchers

 avatar

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.