MacBook-Pro:myApps naveenkumar$ ionic run ios
Adding in default Ionic hooks
Running command: /Users/naveenkumar/Documents/ionic_work/myApps/hooks/after_prepare/010_add_platform_class.js /Users/naveenkumar/Documents/ionic_work/myApps
add to body class: platform-ios
Running command: /Users/naveenkumar/Documents/ionic_work/myApps/hooks/after_prepare/020_remove_sass_from_platforms.js /Users/naveenkumar/Documents/ionic_work/myApps
Running command: /Users/naveenkumar/Documents/ionic_work/myApps/platforms/ios/cordova/run
Cordova needs ios-sim version 3.0.0 or greater, you have version 1.9.0
.
ERROR running one or more of the platforms: Error: /Users/naveenkumar/Documents/ionic_work/myApps/platforms/ios/cordova/run: Command failed with exit code 2
You may not have the required environment or OS to run this project
MacBook-Pro:myApps naveenkumar$
您好, 我正试图从终端运行我的项目。我收到了上述错误。但是当我从给定的iOS目录运行我的项目 Xcode 时,它运行正常。这意味着,当我从Xcode运行时,我能够运行模拟器/模拟器并检查我的输出。但是当我从终端运行时,我无法运行我的应用程序。你能告诉我如何从终端运行我的应用程序吗?
由于
答案 0 :(得分:5)
这就是问题所在:
Cordova needs ios-sim version 3.0.0 or greater, you have version 1.9.0
以下是解决方案:
npm update -g ios-sim
答案 1 :(得分:1)
问题是您没有安装ios-sim。 从ionic framework website,您可以看到以下声明:
注意:iOS开发需要Mac OS X.通过Ionic CLI 的iOS模拟器需要ios-sim npm软件包,可以使用命令 sudo npm -g install ios-安装SIM 强>
您只需运行此命令即可安装ios-sim:
答案 2 :(得分:0)