Phonegap 3:phonegap install ios - 错误:没有平台添加到此项目中

时间:2013-09-27 07:47:02

标签: ios cordova ios-simulator

我创建了一个新的phonegap 3项目

  

phonegap创建我的应用

     

cd my-app

然后我试图安装到ios

  

phonegap install ios

[phonegap] detecting iOS SDK environment...
[phonegap] using the local environment
[phonegap] trying to install app onto device
[phonegap] no device was found
[phonegap] trying to install app onto emulator
 [warning] missing ios-sim
 [warning] install ios-sim from http://github.com/phonegap/ios-sim
   [error] No platforms added to this project. Please use `cordova platform add <platform>`.

1 个答案:

答案 0 :(得分:5)

1)从警告中可以看出,您需要安装ios-sim。

按照github.com/phonegap/ios-sim

中的说明操作

Brew安装对我不起作用,所以我从源根构建并安装了ios-sim

git clone git://github.com/phonegap/ios-sim.git
cd ios-sim
rake install prefix=/usr/local/

2)在安装之前,您需要为专用平台构建项目。

首先

phonegap build ios

其次

phonegap install ios