cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marc...@apache.org
Subject svn commit: r1527865 [20/25] - in /cordova/site/public/docs/en/3.1.0: ./ img/ img/guide/ img/guide/cli/ img/guide/platforms/ img/guide/platforms/android/ img/guide/platforms/bada/ img/guide/platforms/blackberry10/ img/guide/platforms/ios/ img/guide/pla...
Date Tue, 01 Oct 2013 03:56:01 GMT
Added: cordova/site/public/docs/en/3.1.0/guide_platforms_ios_plugin.md.html
URL: http://svn.apache.org/viewvc/cordova/site/public/docs/en/3.1.0/guide_platforms_ios_plugin.md.html?rev=1527865&view=auto
==============================================================================
--- cordova/site/public/docs/en/3.1.0/guide_platforms_ios_plugin.md.html (added)
+++ cordova/site/public/docs/en/3.1.0/guide_platforms_ios_plugin.md.html Tue Oct  1 03:55:57
2013
@@ -0,0 +1,365 @@
+<!DOCTYPE html>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+--><html lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no,
width=device-width">
+<meta name="generator" content="joDoc">
+<title>Apache Cordova API Documentation</title>
+<link rel="stylesheet" type="text/css" href="index.css">
+<link rel="stylesheet" type="text/css" href="mobile.css" media="only screen and (max-device-width:
1024px)">
+<link rel="stylesheet" type="text/css" href="prettify/prettify.css">
+</head>
+<body>
+        <div id="header">
+            <h1><a href="index.html">Apache <strong>Cordova</strong>
Documentation</a></h1>
+            <small>
+                <select><optgroup label="Chinese" value="zh"><option value="edge">edge</option></optgroup>
+<optgroup label="English" value="en">
+<option value="edge">edge</option>
+<option selected value="3.1.0">3.1.0</option>
+<option value="3.0.0">3.0.0</option>
+<option value="2.9.0">2.9.0</option>
+<option value="2.8.0">2.8.0</option>
+<option value="2.7.0">2.7.0</option>
+<option value="2.6.0">2.6.0</option>
+<option value="2.5.0">2.5.0</option>
+<option value="2.4.0">2.4.0</option>
+<option value="2.3.0">2.3.0</option>
+<option value="2.2.0">2.2.0</option>
+<option value="2.1.0">2.1.0</option>
+<option value="2.0.0">2.0.0</option>
+<option value="1.9.0">1.9.0</option>
+<option value="1.8.1">1.8.1</option>
+<option value="1.8.0">1.8.0</option>
+<option value="1.7.0">1.7.0</option>
+<option value="1.6.1">1.6.1</option>
+<option value="1.6.0">1.6.0</option>
+<option value="1.5.0">1.5.0</option>
+</optgroup>
+<optgroup label="French" value="fr"><option value="edge">edge</option></optgroup>
+<optgroup label="German" value="de"><option value="edge">edge</option></optgroup>
+<optgroup label="Italian" value="it"><option value="edge">edge</option></optgroup>
+<optgroup label="Japanese" value="ja">
+<option value="edge">edge</option>
+<option value="2.2.0">2.2.0</option>
+<option value="2.1.0">2.1.0</option>
+<option value="2.0.0">2.0.0</option>
+<option value="1.9.0">1.9.0</option>
+<option value="1.8.1">1.8.1</option>
+<option value="1.7.0">1.7.0</option>
+</optgroup>
+<optgroup label="Korean" value="ko">
+<option value="edge">edge</option>
+<option value="2.0.0">2.0.0</option>
+</optgroup>
+<optgroup label="Russian" value="ru"><option value="edge">edge</option></optgroup>
+<optgroup label="Spanish" value="es"><option value="edge">edge</option></optgroup></select></small>
+        </div>
+        <div id="subheader">
+            <h1>iOS Plugins</h1>
+            <small><select><option value="iOS%2520Plugins">iOS Plugins</option>
+<option value="iOS%20Plugins_plugin_class_mapping">      - Plugin
Class Mapping</option>
+<option value="iOS%20Plugins_plugin_initialization_and_lifetime">      -
Plugin Initialization and Lifetime</option>
+<option value="iOS%20Plugins_writing_an_ios_cordova_plugin">      -
Writing an iOS Cordova Plugin</option>
+<option value="iOS%20Plugins_ios_cdvpluginresult_message_types">      -
iOS CDVPluginResult message types</option>
+<option value="iOS%20Plugins_echo_plugin_ios_plugin">      - Echo
Plugin iOS Plugin</option>
+<option value="iOS%20Plugins_threading">      - Threading</option>
+<option value="iOS%20Plugins_advanced_plugin_functionality">      -
Advanced Plugin Functionality</option>
+<option value="iOS%20Plugins_debugging_plugins">      - Debugging
Plugins</option>
+<option value="iOS%20Plugins_common_pitfalls">      - Common Pitfalls</option></select></small>
+        </div>
+
+        <div id="sidebar">
+            <div class="vertical_divider"></div>
+        <h1>Guides</h1>
+<ul>
+<li><a href="guide_overview_index.md.html#Overview">Overview</a></li>
+<li><a href="guide_cli_index.md.html#The%20Command-line%20Interface">The Command-line
Interface</a></li>
+<li><a href="guide_platforms_index.md.html#Platform%20Guides">Platform Guides</a></li>
+<li><a href="config_ref_index.md.html#The%20config.xml%20File">The config.xml
File</a></li>
+<li><a href="guide_hybrid_webviews_index.md.html#Embedding%20WebViews">Embedding
WebViews</a></li>
+<li><a href="guide_hybrid_plugins_index.md.html#Plugin%20Development%20Guide">Plugin
Development Guide</a></li>
+<li><a href="guide_appdev_privacy_index.md.html#Privacy%20Guide">Privacy Guide</a></li>
+<li><a href="guide_appdev_whitelist_index.md.html#Domain%20Whitelist%20Guide">Domain
Whitelist Guide</a></li>
+<li><a href="_index.html">Keyword Index</a></li>
+</ul>
+<h1>API Reference</h1>
+<ul>
+<li><a href="cordova_accelerometer_accelerometer.md.html#Accelerometer">Accelerometer</a></li>
+<li><a href="cordova_camera_camera.md.html#Camera">Camera</a></li>
+<li><a href="cordova_media_capture_capture.md.html#Capture">Capture</a></li>
+<li><a href="cordova_compass_compass.md.html#Compass">Compass</a></li>
+<li><a href="cordova_connection_connection.md.html#Connection">Connection</a></li>
+<li><a href="cordova_contacts_contacts.md.html#Contacts">Contacts</a></li>
+<li><a href="cordova_device_device.md.html#Device">Device</a></li>
+<li><a href="cordova_events_events.md.html#Events">Events</a></li>
+<li><a href="cordova_file_file.md.html#File">File</a></li>
+<li><a href="cordova_geolocation_geolocation.md.html#Geolocation">Geolocation</a></li>
+<li><a href="cordova_globalization_globalization.md.html#Globalization">Globalization</a></li>
+<li><a href="cordova_inappbrowser_inappbrowser.md.html#InAppBrowser">InAppBrowser</a></li>
+<li><a href="cordova_media_media.md.html#Media">Media</a></li>
+<li><a href="cordova_notification_notification.md.html#Notification">Notification</a></li>
+<li><a href="cordova_splashscreen_splashscreen.md.html#Splashscreen">Splashscreen</a></li>
+<li><a href="cordova_storage_storage.md.html#Storage">Storage</a></li>
+</ul>
+</div>
+
+        <div id="scrollable">
+            <div id="content">
+                <h1><a name="iOS%20Plugins">iOS Plugins</a></h1>
+
+<p>A plugin is an Objective-C class that extends the <code>CDVPlugin</code>
class.</p>
+
+<p>Each plugin class must be registered as a <code>&lt;feature&gt;</code>
tag in the
+<code>config.xml</code> file. It is through this mechanism that JavaScript's
<code>exec</code>
+method's <code>service</code> parameter maps to an Objective-C class.</p>
+
+<h2>
+<a name="iOS%20Plugins_plugin_class_mapping">Plugin Class Mapping</a>
+</h2>
+
+<p>The JavaScript portion of a plugin always uses the <code>cordova.exec</code>
method as follows:</p>
+
+<pre class="prettyprint"><code>exec(&lt;successFunction&gt;, &lt;failFunction&gt;,
&lt;service&gt;, &lt;action&gt;, [&lt;args&gt;]);
+</code></pre>
+
+<p>This marshals a request from the <code>UIWebView</code> to the iOS native
side,
+more or less boiling down to calling the <code>action</code> method on the
+<code>service</code> class, with the arguments passed in the <code>args</code>
array.</p>
+
+<p>Specifiy the plugin as a <code>&lt;feature&gt;</code> tag in
your Cordova-iOS
+application's project's <code>config.xml</code> file.</p>
+
+<pre class="prettyprint"><code>&lt;feature name="LocalStorage"&gt;
+    &lt;param name="ios-package" value="CDVLocalStorage" /&gt;
+&lt;/feature&gt;
+</code></pre>
+
+<p>The feature <code>name</code> attribute should match what you use in
the JavaScript
+<code>exec</code> call's <code>service</code> parameter, and the
<code>value</code> attribute should match the name of the plugin's
+Objective-C class. <code>&lt;param name&gt;</code> should always be i<code>"ios-package"</code>.
+If you do not follow this setup, the plugin may compile but will not be
+reachable by Cordova.</p>
+
+<h2>
+<a name="iOS%20Plugins_plugin_initialization_and_lifetime">Plugin Initialization and
Lifetime</a>
+</h2>
+
+<p>One instance of a plugin object is created for the life of each
+<code>UIWebView</code>. Plugins are not instantiated until they are first
+referenced by a call from JavaScript, unless <code>&lt;param&gt;</code>
with an <code>onload</code>
+<code>name</code> attribute is set to <code>"true"</code> in <code>config.xml</code>.
E.g.:</p>
+
+<pre class="prettyprint"><code>&lt;feature name="Echo"&gt;
+    &lt;param name="ios-package" value="Echo" /&gt;
+    &lt;param name="onload" value="true" /&gt;
+&lt;/feature&gt;
+</code></pre>
+
+<p>There is <em>no</em> designated initializer for plugins. Instead, plugins
+should use the <code>pluginInitialize</code> method for their start-up logic.</p>
+
+<p>Plugins with long-running requests, background activity (e.g., playing
+media), listeners or internal state should implement the <code>onReset</code>
+method and stop or clean up those activities. This method is run when
+the <code>UIWebView</code> navigates to a new page or refreshes, which reloads
+the JavaScript.</p>
+
+<h2>
+<a name="iOS%20Plugins_writing_an_ios_cordova_plugin">Writing an iOS Cordova Plugin</a>
+</h2>
+
+<p>We have JavaScript fire off a plugin request to the native side. We have the iOS
Objective-C plugin mapped properly via the <code>config.xml</code> file. So what
does the final iOS Objective-C Plugin class look like?</p>
+
+<p>What gets dispatched to the plugin via JavaScript's <code>exec</code>
function gets passed into the corresponding Plugin class's <code>action</code>
method. A plugin method has this signature:</p>
+
+<pre class="prettyprint"><code>- (void)myMethod:(CDVInvokedUrlCommand*)command
+{
+    CDVPluginResult* pluginResult = nil;
+    NSString* myarg = [command.arguments objectAtIndex:0];
+
+    if (myarg != nil) {
+        pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
+    } else {
+        pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"Arg
was null"];
+    }
+    [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+}
+</code></pre>
+
+<ol>
+<li><p><a class="external" href="https://github.com/apache/cordova-ios/blob/master/CordovaLib/Classes/CDVInvokedUrlCommand.h">CDVInvokedUrlCommand.h</a></p></li>
+<li><p><a class="external" href="https://github.com/apache/cordova-ios/blob/master/CordovaLib/Classes/CDVPluginResult.h">CDVPluginResult.h</a></p></li>
+<li><p><a class="external" href="https://github.com/apache/cordova-ios/blob/master/CordovaLib/Classes/CDVCommandDelegate.h">CDVCommandDelegate.h</a></p></li>
+</ol>
+<h2>
+<a name="iOS%20Plugins_ios_cdvpluginresult_message_types">iOS CDVPluginResult message
types</a>
+</h2>
+
+<p>Using CDVPluginResult you can return a variety of result types back to your JavaScript
callbacks, using class methods that look like:</p>
+
+<pre class="prettyprint"><code>+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal
messageAs...
+</code></pre>
+
+<p>You can create <code>String</code>, <code>Int</code>, <code>Double</code>,
<code>Bool</code>, <code>Array</code>,
+<code>Dictionary</code>, <code>ArrayBuffer</code>, and <code>Multipart</code>
types.  Or, don't attach
+any arguments (just send a status).  Or, return an Error.  You can
+even choose to not send any plugin result at all, in which case the
+callback does not fire.</p>
+
+<h3>Notes</h3>
+
+<ul>
+<li>
+<code>messageAsArrayBuffer</code> expects <code>NSData*</code> and
converts to an <code>ArrayBuffer</code> for your JavaScript callback (and <code>ArrayBuffers</code>
sent to a plugin from JavaScript are converted to <code>NSData*</code>).</li>
+<li>
+<code>messageAsMultipart</code> expects an <code>NSArray*</code>
containing any of the other supported types, and sends the whole array as the <code>arguments</code>
to your JavaScript callback.
+<ul>
+<li>Quirk: this is not just syntactic sugar (though it is sweet).  This way, all of
the arguments are serialized or deserialized as necessary.  E.g., it is safe to return <code>NSData*</code>
as multipart, but not as <code>Array</code>/<code>Dictionary</code>.</li>
+</ul>
+</li>
+</ul>
+<h2>
+<a name="iOS%20Plugins_echo_plugin_ios_plugin">Echo Plugin iOS Plugin</a>
+</h2>
+
+<p>We would add the following to the project's <code>config.xml</code>
file:</p>
+
+<pre class="prettyprint"><code>&lt;feature name="Echo"&gt;
+    &lt;param name="ios-package" value="Echo" /&gt;
+&lt;/feature&gt;
+</code></pre>
+
+<p>Then we would add the following files (<code>Echo.h</code> and <code>Echo.m</code>)
to the Plugins directory inside our Cordova-iOS
+application directory:</p>
+
+<pre class="prettyprint"><code>/********* Echo.h Cordova Plugin Header *******/
+
+#import &lt;Cordova/CDV.h&gt;
+
+@interface Echo : CDVPlugin
+
+- (void)echo:(CDVInvokedUrlCommand*)command;
+
+@end
+
+/********* Echo.m Cordova Plugin Implementation *******/
+
+#import "Echo.h"
+#import &lt;Cordova/CDV.h&gt;
+
+@implementation Echo
+
+- (void)echo:(CDVInvokedUrlCommand*)command
+{
+    CDVPluginResult* pluginResult = nil;
+    NSString* echo = [command.arguments objectAtIndex:0];
+
+    if (echo != nil &amp;&amp; [echo length] &gt; 0) {
+        pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:echo];
+    } else {
+        pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR];
+    }
+
+    [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+}
+
+@end
+</code></pre>
+
+<p>Let's take a look at the code. At the top we have all of the necessary
+Cordova imports. Our class extends from <code>CDVPlugin</code> (very important).</p>
+
+<p>This plugin only supports one action, the <code>echo</code> action.
First, we
+grab the echo string using the <code>objectAtIndex</code> method on our <code>args</code>,
+telling it we want to get the 0th parameter in the arguments array. We
+do a bit of parameter checking: make sure it is not <code>nil</code>, and make
+sure it is not a zero-length string.</p>
+
+<p>If it is, we return a <code>PluginResult</code> with an <code>ERROR</code>
status. If all of
+those checks pass, then we return a <code>PluginResult</code> with an <code>OK</code>
+status, and pass in the <code>echo</code> string we received in the first place
+as a parameter.</p>
+
+<p>Finally, we send the result to <code>self.commandDelegate</code>, which
executes
+the <code>exec</code> method's success or failure callbacks on the JavaScript
+side. If the success callback is called, it passes in the <code>echo</code>
+parameter.</p>
+
+<h2>
+<a name="iOS%20Plugins_threading">Threading</a>
+</h2>
+
+<p>Plugin methods are executed in the same thread as the UI. If your
+plugin requires a great deal of processing or requires a blocking
+call, you should use a background thread. For example:</p>
+
+<pre class="prettyprint"><code>- (void)myPluginMethod:(CDVInvokedUrlCommand*)command
+{
+    // Check command.arguments here.
+    [self.commandDelegate runInBackground:^{
+        NSString* payload = nil;
+        // Some blocking logic...
+        CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK
messageAsString:payload];
+        // The sendPluginResult method is thread-safe.
+        [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+    }];
+}
+</code></pre>
+
+<h2>
+<a name="iOS%20Plugins_advanced_plugin_functionality">Advanced Plugin Functionality</a>
+</h2>
+
+<p>See other methods that you can override in:</p>
+
+<ul>
+<li><p><a class="external" href="https://github.com/apache/cordova-ios/blob/master/CordovaLib/Classes/CDVPlugin.h">CDVPlugin.h</a></p></li>
+<li><p><a class="external" href="https://github.com/apache/cordova-ios/blob/master/CordovaLib/Classes/CDVPlugin.m">CDVPlugin.m</a></p></li>
+</ul>
+<p>For example, you can hook into the <code><a href="cordova_events_events.md.html#pause">pause</a></code>,
<code><a href="cordova_events_events.md.html#resume">resume</a></code>,
app terminate and <code>handleOpenURL</code> events.</p>
+
+<h2>
+<a name="iOS%20Plugins_debugging_plugins">Debugging Plugins</a>
+</h2>
+
+<p>To debug the Objective-C side, you would use Xcode's built-in debugger.
+For JavaScript, on iOS 5.0 you can use
+<a class="external" href="https://github.com/apache/cordova-weinre">Weinre, an Apache
Cordova Project</a> or
+<a class="external" href="http://www.iwebinspector.com/">iWebInspector, a third-party
utility</a></p>
+
+<p>For iOS 6, you would use Safari 6.0 to simply attach to your app
+running in the iOS 6 Simulator.</p>
+
+<h2>
+<a name="iOS%20Plugins_common_pitfalls">Common Pitfalls</a>
+</h2>
+
+<ul>
+<li><p>Don't forget to add your plugin's mapping to config.xml. If you forget,
an error is logged in the Xcode console.</p></li>
+<li><p>Don't forget to add any hosts you connect to in the whitelist, as described
in <a href="guide_appdev_whitelist_index.md.html#Domain%20Whitelist%20Guide">Domain
Whitelist Guide</a>. If you forget, an error is logged in the Xcode console.</p></li>
+</ul>
+</div>
+        </div>
+
+        <!-- Functionality and Syntax Highlighting -->
+        <script type="text/javascript" src="index.js"></script><script type="text/javascript"
src="prettify/prettify.js"></script>
+</body>
+</html>

Added: cordova/site/public/docs/en/3.1.0/guide_platforms_ios_tools.md.html
URL: http://svn.apache.org/viewvc/cordova/site/public/docs/en/3.1.0/guide_platforms_ios_tools.md.html?rev=1527865&view=auto
==============================================================================
--- cordova/site/public/docs/en/3.1.0/guide_platforms_ios_tools.md.html (added)
+++ cordova/site/public/docs/en/3.1.0/guide_platforms_ios_tools.md.html Tue Oct  1 03:55:57
2013
@@ -0,0 +1,183 @@
+<!DOCTYPE html>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+--><html lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no,
width=device-width">
+<meta name="generator" content="joDoc">
+<title>Apache Cordova API Documentation</title>
+<link rel="stylesheet" type="text/css" href="index.css">
+<link rel="stylesheet" type="text/css" href="mobile.css" media="only screen and (max-device-width:
1024px)">
+<link rel="stylesheet" type="text/css" href="prettify/prettify.css">
+</head>
+<body>
+        <div id="header">
+            <h1><a href="index.html">Apache <strong>Cordova</strong>
Documentation</a></h1>
+            <small>
+                <select><optgroup label="Chinese" value="zh"><option value="edge">edge</option></optgroup>
+<optgroup label="English" value="en">
+<option value="edge">edge</option>
+<option selected value="3.1.0">3.1.0</option>
+<option value="3.0.0">3.0.0</option>
+<option value="2.9.0">2.9.0</option>
+<option value="2.8.0">2.8.0</option>
+<option value="2.7.0">2.7.0</option>
+<option value="2.6.0">2.6.0</option>
+<option value="2.5.0">2.5.0</option>
+<option value="2.4.0">2.4.0</option>
+<option value="2.3.0">2.3.0</option>
+<option value="2.2.0">2.2.0</option>
+<option value="2.1.0">2.1.0</option>
+<option value="2.0.0">2.0.0</option>
+<option value="1.9.0">1.9.0</option>
+<option value="1.8.1">1.8.1</option>
+<option value="1.8.0">1.8.0</option>
+<option value="1.7.0">1.7.0</option>
+<option value="1.6.1">1.6.1</option>
+<option value="1.6.0">1.6.0</option>
+<option value="1.5.0">1.5.0</option>
+</optgroup>
+<optgroup label="French" value="fr"><option value="edge">edge</option></optgroup>
+<optgroup label="German" value="de"><option value="edge">edge</option></optgroup>
+<optgroup label="Italian" value="it"><option value="edge">edge</option></optgroup>
+<optgroup label="Japanese" value="ja">
+<option value="edge">edge</option>
+<option value="2.2.0">2.2.0</option>
+<option value="2.1.0">2.1.0</option>
+<option value="2.0.0">2.0.0</option>
+<option value="1.9.0">1.9.0</option>
+<option value="1.8.1">1.8.1</option>
+<option value="1.7.0">1.7.0</option>
+</optgroup>
+<optgroup label="Korean" value="ko">
+<option value="edge">edge</option>
+<option value="2.0.0">2.0.0</option>
+</optgroup>
+<optgroup label="Russian" value="ru"><option value="edge">edge</option></optgroup>
+<optgroup label="Spanish" value="es"><option value="edge">edge</option></optgroup></select></small>
+        </div>
+        <div id="subheader">
+            <h1>iOS Command-line Tools</h1>
+            <small><select><option value="iOS%2520Command-line%2520Tools">iOS
Command-line Tools</option>
+<option value="iOS%20Command-line%20Tools_create_a_project">      -
Create a project</option>
+<option value="iOS%20Command-line%20Tools_build_a_project">      -
Build a project</option>
+<option value="iOS%20Command-line%20Tools_run_app_on_emulator">      -
Run app on emulator</option>
+<option value="iOS%20Command-line%20Tools_releasing">      - Releasing</option>
+<option value="iOS%20Command-line%20Tools_logging">      - Logging</option></select></small>
+        </div>
+
+        <div id="sidebar">
+            <div class="vertical_divider"></div>
+        <h1>Guides</h1>
+<ul>
+<li><a href="guide_overview_index.md.html#Overview">Overview</a></li>
+<li><a href="guide_cli_index.md.html#The%20Command-line%20Interface">The Command-line
Interface</a></li>
+<li><a href="guide_platforms_index.md.html#Platform%20Guides">Platform Guides</a></li>
+<li><a href="config_ref_index.md.html#The%20config.xml%20File">The config.xml
File</a></li>
+<li><a href="guide_hybrid_webviews_index.md.html#Embedding%20WebViews">Embedding
WebViews</a></li>
+<li><a href="guide_hybrid_plugins_index.md.html#Plugin%20Development%20Guide">Plugin
Development Guide</a></li>
+<li><a href="guide_appdev_privacy_index.md.html#Privacy%20Guide">Privacy Guide</a></li>
+<li><a href="guide_appdev_whitelist_index.md.html#Domain%20Whitelist%20Guide">Domain
Whitelist Guide</a></li>
+<li><a href="_index.html">Keyword Index</a></li>
+</ul>
+<h1>API Reference</h1>
+<ul>
+<li><a href="cordova_accelerometer_accelerometer.md.html#Accelerometer">Accelerometer</a></li>
+<li><a href="cordova_camera_camera.md.html#Camera">Camera</a></li>
+<li><a href="cordova_media_capture_capture.md.html#Capture">Capture</a></li>
+<li><a href="cordova_compass_compass.md.html#Compass">Compass</a></li>
+<li><a href="cordova_connection_connection.md.html#Connection">Connection</a></li>
+<li><a href="cordova_contacts_contacts.md.html#Contacts">Contacts</a></li>
+<li><a href="cordova_device_device.md.html#Device">Device</a></li>
+<li><a href="cordova_events_events.md.html#Events">Events</a></li>
+<li><a href="cordova_file_file.md.html#File">File</a></li>
+<li><a href="cordova_geolocation_geolocation.md.html#Geolocation">Geolocation</a></li>
+<li><a href="cordova_globalization_globalization.md.html#Globalization">Globalization</a></li>
+<li><a href="cordova_inappbrowser_inappbrowser.md.html#InAppBrowser">InAppBrowser</a></li>
+<li><a href="cordova_media_media.md.html#Media">Media</a></li>
+<li><a href="cordova_notification_notification.md.html#Notification">Notification</a></li>
+<li><a href="cordova_splashscreen_splashscreen.md.html#Splashscreen">Splashscreen</a></li>
+<li><a href="cordova_storage_storage.md.html#Storage">Storage</a></li>
+</ul>
+</div>
+
+        <div id="scrollable">
+            <div id="content">
+                <h1><a name="iOS%20Command-line%20Tools">iOS Command-line Tools</a></h1>
+
+<p>The <code>cordova</code> command-line utility is a high-level tool that
allows
+you to build applications across several platforms at once. An older
+version of the Cordova framework provides sets of command-line tools
+specific to each platform. To use them as an alternative to the CLI,
+you need to download this version of Cordova from
+<a class="external" href="http://cordova.apache.org">cordova.apache.org</a>.
The download contains
+separate archives for each platform. Expand the platform you wish to
+target. The tools described here are typically available in the
+top-level <code>bin</code> directory, otherwise consult the <strong>README</strong>
file for
+more detailed directions.</p>
+
+<p>The iOS command-line tools are built upon shell scripts and rely on
+Xcode command-line tools such as <code>xcode-select</code> and <code>xcodebuild</code>.</p>
+
+<h2>
+<a name="iOS%20Command-line%20Tools_create_a_project">Create a project</a>
+</h2>
+
+<p>Run the <code>create</code> command, specifying the existing path to
the project,
+the reverse-domain-style package identifier, and the app's display
+name.</p>
+
+<pre class="prettyprint"><code>$ ./path/to/cordova-ios/bin/create /path/to/my_new_project
com.example.project_name ProjectName
+</code></pre>
+
+<h2>
+<a name="iOS%20Command-line%20Tools_build_a_project">Build a project</a>
+</h2>
+
+<pre class="prettyprint"><code>$ /path/to/my_new_project/cordova/build
+</code></pre>
+
+<h2>
+<a name="iOS%20Command-line%20Tools_run_app_on_emulator">Run app on emulator</a>
+</h2>
+
+<pre class="prettyprint"><code>$ /path/to/my_new_project/cordova/run
+</code></pre>
+
+<h2>
+<a name="iOS%20Command-line%20Tools_releasing">Releasing</a>
+</h2>
+
+<pre class="prettyprint"><code>$ /path/to/my_new_project/cordova/release
+</code></pre>
+
+<h2>
+<a name="iOS%20Command-line%20Tools_logging">Logging</a>
+</h2>
+
+<pre class="prettyprint"><code>$ /path/to/my_new_project/cordova/log
+</code></pre>
+
+            </div>
+        </div>
+
+        <!-- Functionality and Syntax Highlighting -->
+        <script type="text/javascript" src="index.js"></script><script type="text/javascript"
src="prettify/prettify.js"></script>
+</body>
+</html>



Mime
View raw message