Last active
December 12, 2024 04:42
-
-
Save peteygao/9842159 to your computer and use it in GitHub Desktop.
Step by Step guide to installing Cordova for iOS development
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Install Xcode, if you haven't already. | |
a. Once installed, run Xcode and accept the license agreement. | |
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): | |
```bash | |
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" | |
``` | |
3. While still in terminal, run: | |
```bash | |
brew update | |
brew doctor | |
``` | |
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. | |
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.company.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! |
cordova simulate ios
--> cordova emulate ios
Url for install script is now at https://raw.githubusercontent.com/Homebrew/install/master/install
Also, you if you are having to use sudo something may have gone wrong. Ideally npm -g never requires sudo for global packages.
Update the name of the file to *.md
and it'll work!
I don't understand, when I run the emulator the app doesn't appear on the emulated device.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Gist's don't seem to get automatically Markdown'd, so here it is with proper markdown formatting:
Install Xcode, if you haven't already.
a. Once installed, run Xcode and accept the license agreement.
b. Go into Xcode Prefs (Cmd + ,), go to Downloads, and install "Command Line Tools for Xcode" (or something named similarily)
Install Homebrew (copy and paste the following into your terminal):
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
While still in terminal, run:
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.
b. If necessary, fix any other issues that brew doctor reports.
Install Node.js using Brew:
Install Cordova (formerly "PhoneGap") usind NPM (Node Package Manager):
Install ios-sim plugin for Cordova (so you can launch iOS simulator directly):
Create a Cordova project and add iOS as a platform
cordova create DirectoryName com.company.appname AppName cd DirectoryName cordova platform add ios
Great, you're done! You should be able to run this repo by simply running:
Give it a few seconds and your iOS simulator with your Cordova app should appear right in front of you. Hooray!