UNPKG

3.98 kBMarkdownView Raw
1<!--
2#
3# Licensed to the Apache Software Foundation (ASF) under one
4# or more contributor license agreements. See the NOTICE file
5# distributed with this work for additional information
6# regarding copyright ownership. The ASF licenses this file
7# to you under the Apache License, Version 2.0 (the
8# "License"); you may not use this file except in compliance
9# with the License. You may obtain a copy of the License at
10#
11# http://www.apache.org/licenses/LICENSE-2.0
12#
13# Unless required by applicable law or agreed to in writing,
14# software distributed under the License is distributed on an
15# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16# KIND, either express or implied. See the License for the
17# specific language governing permissions and limitations
18# under the License.
19#
20-->
21Cordova OSX
22=============================================================
23CordovaLib is a framework that enables users to include Cordova in their OS X application projects easily,
24and also create new Cordova based OS X application projects.
25
26Note that the current focus of this cordova platform is to provide kiosk-like applications for OSX, that usually run fullscreen and have little desktop interaction. So there is no direct support for menus, dock integration, finder integration, documents, etc. Think of it as a mobile app running on a very big screen.
27
28Pre-requisites
29-------------------------------------------------------------
30Make sure you have installed the latest released OS X SDK which comes with Xcode 6 or later.
31Download it at [http://developer.apple.com/downloads](http://developer.apple.com/downloads)
32or the [Mac App Store](http://itunes.apple.com/us/app/xcode/id497799835?mt=12).
33
34
35Create your project
36-------------------------------------------------------------
37
381. (Optionally) Follow the instructions in the [**Command-Line Usage**](http://cordova.apache.org/docs/en/latest/guide/cli/index.html) section of the [Cordova Docs](http://cordova.apache.org/docs/en/latest/guide/cli/index.html) to create a new project. For example
39
40 ````
41 $ cordova create hello com.example.hello HelloWorld
42 ````
43
442. add the osx platform:
45
46 ````
47 $ cordova platform add osx
48 $ cordova run osx
49 ````
50
513. You can also open the project in XCode:
52
53 ````
54 $ open platforms/osx/<yourproject>.xcodeproj
55 ````
56
57
58### Add plugins
59
601. for example, if you need the file-plugin do:
61
62 ````
63 $ cordova plugin add cordova-plugin-file
64 ````
65
66
67Create a Cordova OSX Standalone project
68-------------------------------------------------------------
69
701. Download the source
712. execute the `create` command to setup an empty project:
72
73 ````
74 $ bin/create <path_to_new_project> <package_name> <project_name>
75 ````
76
77 for example
78
79 ````
80 $ bin/create ../Foo org.apache.foo FooBar
81 ````
82
83### Add plugins
84
851. for example, if you need the file-plugin do:
86
87 ````
88 $ cordova plugin add cordova-plugin-file
89 ````
90
91
92Updating a CordovaLib subproject reference in your project
93-------------------------------------------------------------
94
95When you update to a new Cordova version, you may need to update the CordovaLib reference in an existing project.
96Cordova comes with a script that will help you to do this.
97
981. Launch **Terminal.app**
992. Go to the location where you installed Cordova, in the `bin` sub-folder
1003. Run `update /path/to/your/project`
101
102
103
104FAQ
105---
106### How do debug the webview?
107You need to enable the `WebDeveloperExtras` for your bundle:
108
109```
110defaults write com.yourcompany.yourbundleid WebKitDeveloperExtras -bool true
111```
112After you changed the defatuls, start the application and right-click inside the webview and select _Inspect Element_. This opens the Safari Developer Tools.
113
114> **Note**: The _bundleid_ is usually the same as your _widget id_ you define in your `config.xml` unless overridden by the `ios-CFBundleVersion` argument.
115
116
117
118MORE INFO
119----------
120* [http://cordova.apache.org/](http://cordova.apache.org/)
121
122
\No newline at end of file