how to launch ios simulator from phonegap

和自甴很熟 提交于 2019-11-30 00:59:16

问题


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.


回答1:


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



回答2:


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"



来源:https://stackoverflow.com/questions/18859966/how-to-launch-ios-simulator-from-phonegap

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