Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to launch ios simulator from phonegap

when i try to launch ios simulator from command line by using $ phonegap run ios i get the below error

Error: ios-sim was not found. Please download, build and install version 1.5 or greater from https://github.com/phonegap/ios-sim into your path. Or 'brew install ios-sim' using homebrew: Link

i even tried copying the above ios-sim folder into my path. still getting an error.

like image 314
Abilash Avatar asked Sep 17 '13 21:09

Abilash


People also ask

How can I launch the iOS simulator from terminal?

Just type this command in Terminal: open -a Simulator. app to launch the most recent simulator. Type this command in Terminal to run the Simulator rigth from the its folder.


2 Answers

Best Solution:

  1. Make sure you have XCode and its command line tools installed and accepted the license agreements

  2. Download and install Homebrew by executing following command in terminal:

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

  3. Install ios-sim via Homebrew by executing:

    brew install ios-sim

  4. Watch for error messages or upon successfull installation, you should be able to run the iOS Simulator:

    phonegap run ios


Alternative Solution:

You could try installing ios-sim via npm:

  • Head over to http://nodejs.org/ and install node.js (npm will be automatically installed as node's package manager).
  • Install ios-sim via npm by executing

    sudo npm install ios-sim -g

  • if you're on a Windows machine, open the command prompt as administrator and execute npm install ios-sim instead
like image 110
Mobiletainment Avatar answered Oct 17 '22 06:10

Mobiletainment


To run on simulator we need to install ios-sim and ios-deploy.

Following are steps to run on iOS emulator

  1. Install ios-sim using npm by executing:

    sudo npm install ios-sim -g

  2. Install ios-deploy using npm by executing:

    sudo npm install ios-deploy -g

  3. Make sure your simulator is running

  4. Final Command:

    phonegap run ios --emulator

If need to run on particular simulator then following are steps:

  1. Find out list of available simulators and their exact name

    cordova emulate ios --list

  2. now run on particular simulator using:

    cordova emulate ios --target="XXXXXX"

like image 44
lincolnerson Avatar answered Oct 17 '22 05:10

lincolnerson