Giter VIP home page Giter VIP logo

cordova-osx's Introduction

This is a fork of the official cordova-osx platform

This fork includes many fixes and small improvemts. Hopefully it will be merged with the official version one day.

It is may also by necessary for forks of related plugins.

Cordova OSX

CordovaLib is a framework that enables users to include Cordova in their OS X application projects easily, and also create new Cordova based OS X application projects.

Pre-requisites

Make sure you have installed the latest released OS X SDK which comes with Xcode 5. Download it at http://developer.apple.com/downloads or the Mac App Store.

You will also need to install the nodejs.

Register OSX platform in the cordova

1 Install cordova itself

$ sudo npm install -g cordova

2 Clone this repository

$ git clone https://github.com/onflapp/cordova-osx.git

3 Patch the cordova

You can use patches in the patches directory or if you are lazy, do the following:

$ sudo cp patched-files/src/cordova/platform.js /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova
$ sudo cp patched-files/src/cordova/platforms.js /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova

$ sudo cp patched-files/src/plugman/platforms.js /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman
$ sudo cp patched-files/src/plugman/platforms/osx.js /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/platforms

NOTE: you will be executing these commads as root, you should backup the original files first.

4 Verify the patch worked

$ cordova platform ls

Use this fork intead of the official cordova-osx

Patching cordova as described above will get you the official OSX platform support. This may or may not be what you want. If you are interested in this fork, you'll need to take additional steps.

Copy the content of the entire project (cordova-osx) to ~/.cordova/lib/osx/cordova/master

$ mkdir -p ~/.cordova/lib/osx/cordova/master
$ cp -R ./cordova-osx/* ~/.cordova/lib/osx/cordova/master

If this directory exists already, you may have to remove it.

NOTE: you should be able to find '~/.cordova/lib/osx/cordova/master/package.json' in there. If you see ~/.cordova/lib/osx/cordova/master/cordova-osx, this is wrong. It must be the content of the cordova-osx that is copied into the master

There is probably a better way to use a fork then this, I just didn't find a simpler way.

Add OS X platform to your project

1 Create a project

$ cordova create hello com.example.hello HelloWorld

2 Add platform

$ cd ./hello
$ cordova platform add osx

Useful options

In the config.xml you can use following configuration parameters

<preference name="EnableDebugMode" value="false" />

The debug modes enables WebKit's Inspector. The inspector is accessible via right-click.

<preference name="HideCursor" value="false" />

Hides the cursor. This option is very usefull for touchscreens using mouse emulation.

<preference name="KioskMode" value="false" />

Kiosk Mode will make the app run in full screen mode and disables application switching.

Loading resources (JS/CSS) directly from your project's source directory. $ defaults write com.xxx.yyy write SourceBaseDir /Users/blah/myproject

This option is very usefull for rapid JS/CSS development because you do do not have to rebuild the entire application, just reload the page - EnableDebugMode may have to be enabled. SourceBaseDir should point to where your www folder is.

More Info

cordova-osx's People

Contributors

shazron avatar oflorian avatar tripodsan avatar randymcmillan avatar onflapp avatar agrieve avatar purplecabbage avatar cmarcelk avatar stevengill avatar asgeo1 avatar filmaj avatar

Watchers

James Cloos avatar Martin Reinhardt avatar  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.