关于添加平台的Phonegap问题

时间:2014-03-28 09:20:22

标签: ios cordova

我是Phonegap的新手。 我在我的mac上安装了phonegap。我也安装了最新的xcode。 我正在遵循指示 http://docs.phonegap.com/en/3.4.0/guide_platforms_ios_index.md.html#iOS%20Platform%20Guide

我成功运行

 $ cordova create hello com.example.hello "HelloWorld"
 $ cd hello

但是在我运行cordova platform add ios之后,它会出现以下错误。

    Krishnak:my-app krishnak$ cordova platform add ios
    Creating ios project...
    Unknown option: n
    Usage: head [-options] <url>...
        -m <method>   use method for the request (default is 'HEAD')
        -f            make request even if head believes method is illegal
        -b <base>     Use the specified URL as base
        -t <timeout>  Set timeout value
        -i <time>     Set the If-Modified-Since header on the request
        -c <conttype> use this content-type for POST, PUT, CHECKIN
        -a            Use text mode for content I/O
        -p <proxyurl> use this as a proxy
        -P            don't load proxy settings from environment
        -H <header>   send this HTTP header (you can specify several)

        -u            Display method and URL before any response
        -U            Display request headers (implies -u)
        -s            Display response status code
        -S            Display response status chain
        -e            Display response headers
        -d            Do not display content
        -o <format>   Process HTML content in various ways

        -v            Show program version
        -h            Print this message

        -x            Extra debugging output
    Cordova can only run in Xcode version 4.6 or greater.

Error: /Users/krishnak/.cordova/lib/ios/cordova/3.4.0/bin/create: Command failed with exit code 2
    at ChildProcess.whenDone (/usr/lib/node_modules/cordova/src/superspawn.js:112:23)
    at ChildProcess.EventEmitter.emit (events.js:98:17)
    at maybeClose (child_process.js:743:16)
    at Process.ChildProcess._handle.onexit (child_process.js:810:5)
Krishnak:my-app krishnak$ 

我已经在我的计算机上安装了xampp服务器。我不确定xampp是不是问题。 请建议我如何解决这个问题。

3 个答案:

答案 0 :(得分:4)

问题可能与xampp有关。可能由于路径环境,请考虑编辑 .profile 并放置xampp二进制路径。

或尝试评论bin,如 #export / PATH = / Applications / XAMPP / bin:$ PATH -

希望这对你有所帮助。

答案 1 :(得分:3)

只需执行以下命令,以便/usr/bin/中的头二进制文件优先于XAMMP安装的脚本:

export PATH=/usr/bin/:$PATH

答案 2 :(得分:0)

在xcode 5中更新iOS SDK。 Xcode &gt; 偏好设置

enter image description here