Skip to content

Instantly share code, notes, and snippets.

@peteygao
Last active December 12, 2024 04:42

Revisions

  1. peteygao revised this gist Mar 28, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Cordova for iOS
    Original file line number Diff line number Diff line change
    @@ -41,7 +41,7 @@

    7. Create a Cordova project and add iOS as a platform
    ```bash
    cordova create DirectoryName com.orgname.appname AppName
    cordova create DirectoryName com.company.appname AppName
    cd DirectoryName
    cordova platform add ios
    ```
  2. peteygao revised this gist Mar 28, 2014. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions Cordova for iOS
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,8 @@
    1. Install Xcode, if you haven't already.

    * Once installed, run Xcode and accept the license agreement.
    a. Once installed, run Xcode and accept the license agreement.

    * Go into Xcode Prefs (Cmd + ,), go to Downloads, and install "Command Line Tools for Xcode" (or something named similarily)
    b. Go into Xcode Prefs (Cmd + ,), go to Downloads, and install "Command Line Tools for Xcode" (or something named similarily)

    2. Install Homebrew (copy and paste the following into your terminal):

    @@ -17,9 +17,9 @@
    brew doctor
    ```

    * If you haven't yet installed "Command Line Tools for Xcode", you will be told by brew doctor to install it. See step 1.b.
    a. If you haven't yet installed "Command Line Tools for Xcode", you will be told by brew doctor to install it. See step 1.b.

    * If necessary, fix any other issues that brew doctor reports.
    b. If necessary, fix any other issues that brew doctor reports.

    4. Install Node.js using Brew:

  3. peteygao created this gist Mar 28, 2014.
    56 changes: 56 additions & 0 deletions Cordova for iOS
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,56 @@
    1. Install Xcode, if you haven't already.

    * Once installed, run Xcode and accept the license agreement.

    * Go into Xcode Prefs (Cmd + ,), go to Downloads, and install "Command Line Tools for Xcode" (or something named similarily)

    2. Install Homebrew (copy and paste the following into your terminal):

    ```bash
    ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
    ```

    3. While still in terminal, run:

    ```bash
    brew update
    brew doctor
    ```

    * If you haven't yet installed "Command Line Tools for Xcode", you will be told by brew doctor to install it. See step 1.b.

    * If necessary, fix any other issues that brew doctor reports.

    4. Install Node.js using Brew:

    ```bash
    brew install node
    ```

    5. Install Cordova (formerly "PhoneGap") usind NPM (Node Package Manager):

    ```bash
    sudo npm install -g cordova
    ```

    6. Install ios-sim plugin for Cordova (so you can launch iOS simulator directly):

    ```bash
    sudo npm install -g ios-sim
    ```

    7. Create a Cordova project and add iOS as a platform
    ```bash
    cordova create DirectoryName com.orgname.appname AppName
    cd DirectoryName
    cordova platform add ios
    ```

    8. Great, you're done! You should be able to run this repo by simply running:

    ```bash
    cordova build ios
    cordova simulate ios
    ```

    Give it a few seconds and your iOS simulator with your Cordova app should appear right in front of you. Hooray!