how to launch ios simulator from phonegap

孤人 提交于 2019-11-30 17:54:31

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

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"

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!