---
title: "phonegap faq"
author: "fanfq"
date: "2014-06-19T09:52:14Z"
tags: []
categories: ["移动开发"]
slug: "phonegap-faq"
draft: false
lastmod: "2014-06-25T22:02:20Z"
id: 2082410
url: "https://fanfq.iteye.com/blog/2082410"
---

\[b]phonegap building faq \[/b] 1.xcode-select fanfq-macbook:hello fanfangqing$ cordova -d platform add ios cordova library for "ios" already exists. No need to download. Continuing. Checking if platform "ios" passes minimum requirements... Creating ios project... Running command: /Users/fanfangqing/.cordova/lib/ios/cordova/3.5.0/bin/create --arc --cli /Users/fanfangqing/MyCode/fanfq-html54mobile/phonegap/hello/platforms/ios com.example.hello HelloWorld \[color=red]xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance Cordova can only run in Xcode version 4.6 or greater.\[/color] Command finished with error code 2: /Users/fanfangqing/.cordova/lib/ios/cordova/3.5.0/bin/create --arc,--cli,/Users/fanfangqing/MyCode/fanfq-html54mobile/phonegap/hello/platforms/ios,com.example.hello,HelloWorld \[color=red]Error: /Users/fanfangqing/.cordova/lib/ios/cordova/3.5.0/bin/create: Command failed with exit code 2 at ChildProcess.whenDone (/usr/local/lib/node\_modules/cordova/node\_modules/cordova-lib/src/cordova/superspawn.js:131:23) at ChildProcess.emit (events.js:98:17) at maybeClose (child\_process.js:755:16) at Process.ChildProcess.\_handle.onexit (child\_process.js:822:5)\[/color] fanfq-macbook:hello fanfangqing$ cordova platform ls \*由于最近新出了个swift的东东所以xcode4跟新到了xcode6beta；macos也从Lion直接跟新到Mavericks，跳过了Mountain Lion由于之前跟新到Mountain Lion要收费，作为很扣的我当然不愿意支付那笔费用，不过这次跟新到Mavericks是免费的，哈哈，窃喜一小下。 \[color=blue]fanfq-macbook:Applications fanfangqing$ sudo xcode-select --switch /Applications/Xcode6-Beta.app/Contents/Developer\[/color] 喵哩个咪的问题解决了，在google group中发邮件问题，有专家指出当前phonegap支持xcode最大的版本号是5.1，所以我之前安装的xcode6beta想尝鲜swift所以不得不换成老版本。 /////////////////////////////////////////////////// for android fanfq-macbook:hello fanfangqing$ cordova platform add android Creating android project... /Users/fanfangqing/.cordova/lib/android/cordova/3.5.0/bin/node\_modules/q/q.js:126 throw e; ^ Error: ERROR : executing command 'ant', make sure you have ant installed and added to your path. at /Users/fanfangqing/.cordova/lib/android/cordova/3.5.0/bin/lib/check\_reqs.js:47:27 at ChildProcess.exithandler (child\_process.js:651:7) at ChildProcess.emit (events.js:98:17) at maybeClose (child\_process.js:755:16) at Socket. (child\_process.js:968:11) at Socket.emit (events.js:95:17) at Pipe.close (net.js:465:12) Error: /Users/fanfangqing/.cordova/lib/android/cordova/3.5.0/bin/create: Command failed with exit code 8 at ChildProcess.whenDone (/usr/local/lib/node\_modules/cordova/node\_modules/cordova-lib/src/cordova/superspawn.js:131:23) at ChildProcess.emit (events.js:98:17) at maybeClose (child\_process.js:755:16) at Process.ChildProcess.\_handle.onexit (child\_process.js:822:5) fanfq-macbook:hello fanfangqing$