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: http://mxcl.github.com/homebrew/
i even tried copying the above ios-sim folder into my path. still getting an error.
Best Solution:
Make sure you have XCode and its command line tools installed and accepted the license agreements
Download and install Homebrew by executing following command in terminal:
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)"
Install ios-sim via Homebrew by executing:
brew install ios-sim
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
To run on simulator we need to install ios-sim and ios-deploy.
Following are steps to run on iOS emulator
Install ios-sim using npm by executing:
sudo npm install ios-sim -g
Install ios-deploy using npm by executing:
sudo npm install ios-deploy -g
Make sure your simulator is running
Final Command:
phonegap run ios --emulator
If need to run on particular simulator then following are steps:
Find out list of available simulators and their exact name
cordova emulate ios --list
now run on particular simulator using:
cordova emulate ios --target="XXXXXX"
来源:https://stackoverflow.com/questions/18859966/how-to-launch-ios-simulator-from-phonegap