Return-Path: X-Original-To: apmail-cordova-dev-archive@www.apache.org Delivered-To: apmail-cordova-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 22C6518387 for ; Wed, 17 Feb 2016 22:00:33 +0000 (UTC) Received: (qmail 43382 invoked by uid 500); 17 Feb 2016 22:00:32 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 43339 invoked by uid 500); 17 Feb 2016 22:00:32 -0000 Mailing-List: contact dev-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list dev@cordova.apache.org Received: (qmail 43328 invoked by uid 99); 17 Feb 2016 22:00:32 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Feb 2016 22:00:32 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 6E84DE020D; Wed, 17 Feb 2016 22:00:32 +0000 (UTC) From: jcesarmobile To: dev@cordova.apache.org Reply-To: dev@cordova.apache.org References: In-Reply-To: Subject: [GitHub] cordova-docs pull request: CB-10526: iOS Guide Improvements Content-Type: text/plain Message-Id: <20160217220032.6E84DE020D@git1-us-west.apache.org> Date: Wed, 17 Feb 2016 22:00:32 +0000 (UTC) Github user jcesarmobile commented on a diff in the pull request: https://github.com/apache/cordova-docs/pull/505#discussion_r53238166 --- Diff: www/docs/en/dev/guide/platforms/ios/index.md --- @@ -74,190 +67,123 @@ There are two ways to download Xcode: Once Xcode is installed, several command-line tools need to be enabled for Cordova to run. From the __Xcode__ menu, select __Preferences__, then the __Downloads__ tab. From the __Components__ panel, press the -__Install__ button next to the __Command Line Tools__ listing. +__Install__ button next to the __Command Line Tools__ listing. -## Install Deploy Tools +### Deployment Tools -Run from comman-line terminal: +The [ios-sim](https://www.npmjs.org/package/ios-sim) and +[ios-deploy](https://www.npmjs.org/package/ios-deploy) tools - allows you +to launch iOS apps into the iOS Simulator and iOS Device from the command-line. + +To install them, run the following from command-line terminal: $ npm install -g ios-sim $ npm install -g ios-deploy -## Create a New Project - -Use the `cordova` utility to set up a new project, as described in The -Cordova [The Command-Line Interface](../../cli/index.html). For example, in a source-code directory: +## Project Configuration - $ cordova create hello com.example.hello "HelloWorld" - $ cd hello - $ cordova platform add ios - $ cordova prepare # or "cordova build" +Installing Xcode will mostly set everything needed to get started. -## Deploy the app - -To deploy the app on a connected iOS device: - - $ cordova run ios --device -To deploy the app on a default iOS emulator: - - $ cordova emulate ios - -You can use __cordova run ios --list__ to see all available targets and -__cordova run ios --target=target_name__ to run application on a specific -device or emulator (for example, `cordova run ios --target="iPhone-6"`). - -You can also use __cordova run --help__ to see additional build and run -options. - -## Open a Project in the SDK - -Once ios platform is added to your project, you can open it from -within Xcode. Double-click to open the `hello/platforms/ios/hello.xcodeproj` -file. The screen should look like this: - -![]({{ site.baseurl }}/static/img/guide/platforms/ios/helloworld_project.png) +## Signing an App -## Deploy to Emulator +First, you should read through the [Code Signing Support Page](https://developer.apple.com/support/code-signing/) +and the [App Distribution Workflows](https://developer.apple.com/library/prerelease/ios/documentation/IDEs/Conceptual/AppDistributionGuide/Introduction/Introduction.html). -To preview the app in the iOS emulator: +### Using Flags -1. Make sure the _.xcodeproj_ file is selected in the left panel. +To sign an app, you need the following parameters: -2. Select the __hello__ app in the panel immediately to the right. +| Parameter | Flag | Description +|--------------------------|--------------------------|----------------------------------- +| Code Sign Identity | `--codeSignIdentity` | Code signing identity to use for signing. It can be created with Xcode and added to your keychain. +| Provisioning Profile | `--provisioningProfile` | GUID of the provisioning profile to be used for signing. It is copied here on your Mac: ~/Library/MobileDevice/Provisioning\ Profiles/. Opening it in a text editor, you can find the GUID which needs to be specified here. +| Code Sign Resource Rules | `--codesignResourceRules`| (Optional) Used to control which files in a bundle should be sealed by a code signature. For more details, read [The OS X Code Signing In Depth article](https://developer.apple.com/library/mac/technotes/tn2206/_index.html#//apple_ref/doc/uid/DTS40007919-CH1-TNTAG206) -3. Select the intended device from the toolbar's __Scheme__ menu, such - as the iPhone 6.0 Simulator as highlighted here: +### Using build.json - ![]({{ site.baseurl }}/static/img/guide/platforms/ios/select_xcode_scheme.png) +Alternatively, you could specify them in a build configuration file (`build.json`) +using the `--buildConfig` argument to the same commands. Here's a sample of a +build configuration file: -4. Press the __Run__ button that appears in the same toolbar to the - left of the __Scheme__. That builds, deploys and runs the - application in the emulator. A separate emulator application opens - to display the app: + { + "ios": { + "debug": { + "codeSignIdentitiy": "iPhone Development", + "provisioningProfile": "926c2bd6-8de9-4c2f-8407-1016d2d12954", + }, + "release": { + "codeSignIdentitiy": "iPhone Distribution" + "provisioningProfile": "70f699ad-faf1-4adE-8fea-9d84738fb306", + } + } + } + +### Using xcrun - ![]({{ site.baseurl }}/static/img/guide/platforms/ios/HelloWorldStandard.png) +You can also sign from the command line using the following command: - Only one emulator may run at a time, so if you want to test the app - in a different emulator, you need to quit the emulator application - and run a different target within Xcode. +``` + xcrun -sdk iphoneos PackageApplication -v /home/user/app/build/device/MyApp.app -o /home/user/app/build/device/MyApp.ipa --sign "iPhone Development" --embed "7151ab45-6085-4ea1-9bcd-022b5cebe44b" +``` -Xcode comes bundled with emulators for the latest versions of iPhone -and iPad. Older versions may be available from the __Xcode → -Preferences → Downloads → Components__ panel. +## Debugging -## Deploy to Device +For details on the debugging tools that come with Xcode, see this [article](https://developer.apple.com/support/debugging) +and this [video](https://developer.apple.com/videos/play/wwdc2014-413/). -For details about various requirements to deploy to a device, refer -to the _Launch Your App On Devices_ section of -Apple's -[About App Distribution Workflows](https://developer.apple.com/library/prerelease/ios/documentation/IDEs/Conceptual/AppDistributionGuide/Introduction/Introduction.html). -Briefly, you need to do the following before deploying: +### Open a Project within Xcode -1. Join the Apple iOS Developer Program. +Cordova for iOS projects can be opened in Xcode. This can be useful if +you wish to use Xcode built in debugging/profiling tools or if you are +developing iOS plugins. Please note that when opening your project in Xcode, +it is recommended that you do NOT edit your code in the IDE. This will edit the code --- End diff -- You can edit the root www folder from Xcode. But doing this makes o effect when you run the app. You have to do a 'cordova prepare ios' to copy the changes. I use a xcode build script that run 'cordova prepare ios' before running. The files you should change are the ones on "Staging" folder, those are the ```platforms``` ones --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org For additional commands, e-mail: dev-help@cordova.apache.org