1、下载安装node.js
/usr/local/bin/node
/usr/local/bin/npm
2、安装phonegap 要从根目录安装,如果是安装在用户下会报错(cannot find module 'bplist-parser')等等
cd /
sudo npm install -g phonegap
3、创建项目
phonegap create ~/work/igo_ios com.huilin.igo.ios igo
4、定位到目录下
cd work/igo_ios/
5、安装插件(参考http://docs.phonegap.com/en/3.1.0/guide_cli_index.md.html#The%20Command-line%20Interface)
phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git
6、编译
phonegap build ios
localhost:bin zhangxh$ cd /
localhost:/ zhangxh$ ls
Applicationsbinopt
Developercoresprivate
Librarydevsbin
Networketctmp
Systemhomeusr
Usersmach_kernelvar
Volumesnet用户手册和信息
localhost:/ zhangxh$ sudo npm install -g cordova
npm WARN deprecated npmconf@2.1.2: this package has been reintegrated into npm and is now out of date with respect to npm
/usr/local/bin/cordova -> /usr/local/lib/node_modules/cordova/bin/cordova
/usr/local/lib
└─┬ cordova@5.4.1
├── ansi@0.3.0
├─┬ cordova-lib@5.4.1
│ ├─┬ aliasify@1.8.1
│ │ └─┬ browserify-transform-tools@1.3.3
│ │ ├─┬ falafel@1.0.1
│ │ │ └── acorn@0.11.0
│ │ └── through@2.3.8
│ ├── cordova-app-hello-world@3.10.0
│ ├─┬ cordova-common@1.0.0
│ │ ├─┬ bplist-parser@0.1.1
│ │ │ └── big-integer@1.6.10
│ │ ├─┬ glob@5.0.15
│ │ │ ├── inflight@1.0.4
│ │ │ ├─┬ minimatch@3.0.0
│ │ │ │ └─┬ brace-expansion@1.1.2
│ │ │ │ ├── balanced-match@0.3.0
│ │ │ │ └── concat-map@0.0.1
│ │ │ └── path-is-absolute@1.0.0
│ │ ├─┬ osenv@0.1.3
│ │ │ └── os-homedir@1.0.1
│ │ └── q@1.4.1
│ ├─┬ cordova-js@4.1.2
│ │ └─┬ browserify@10.1.3
│ │ ├── assert@1.3.0
│ │ ├─┬ browser-pack@4.0.4
│ │ │ ├─┬ combine-source-map@0.3.0
│ │ │ │ ├── convert-source-map@0.3.5
│ │ │ │ ├─┬ inline-source-map@0.3.1
│ │ │ │ │ └── source-map@0.3.0
│ │ │ │ └─┬ source-map@0.1.43
│ │ │ │ └── amdefine@1.0.0
│ │ │ ├─┬ through2@0.5.1
│ │ │ │ ├── readable-stream@1.0.33
│ │ │ │ └── xtend@3.0.0
│ │ │ └── umd@3.0.1
│ │ ├── browser-resolve@1.11.0
│ │ ├─┬ browserify-zlib@0.1.4
│ │ │ └── pako@0.2.8
│ │ ├─┬ buffer@3.6.0
│ │ │ ├── ieee754@1.1.6
│ │ │ └── isarray@1.0.0
│ │ ├── builtins@0.0.7
│ │ ├── commondir@0.0.1
│ │ ├─┬ concat-stream@1.4.10
│ │ │ └── typedarray@0.0.6
│ │ ├─┬ console-browserify@1.1.0
│ │ │ └── date-now@0.1.4
│ │ ├── constants-browserify@0.0.1
│ │ ├─┬ crypto-browserify@3.11.0
│ │ │ ├─┬ browserify-cipher@1.0.0
│ │ │ │ ├─┬ browserify-aes@1.0.5
│ │ │ │ │ └── buffer-xor@1.0.3
│ │ │ │ ├─┬ browserify-des@1.0.0
│ │ │ │ │ └─┬ des.js@1.0.0
│ │ │ │ │ └── minimalistic-assert@1.0.0
│ │ │ │ └── evp_bytestokey@1.0.0
│ │ │ ├─┬ browserify-sign@4.0.0
│ │ │ │ ├── bn.js@4.6.2
│ │ │ │ ├── browserify-rsa@4.0.0
│ │ │ │ ├─┬ elliptic@6.0.2
│ │ │ │ │ ├── brorand@1.0.5
│ │ │ │ │ └── hash.js@1.0.3
│ │ │ │ └─┬ parse-asn1@5.0.0
│ │ │ │ └── asn1.js@4.3.0
│ │ │ ├── create-ecdh@4.0.0
│ │ │ ├─┬ create-hash@1.1.2
│ │ │ │ ├── cipher-base@1.0.2
│ │ │ │ └── ripemd160@1.0.1
│ │ │ ├── create-hmac@1.1.4
│ │ │ ├─┬ diffie-hellman@5.0.0
│ │ │ │ └── miller-rabin@4.0.0
│ │ │ ├── pbkdf2@3.0.4
│ │ │ ├── public-encrypt@4.0.0
│ │ │ └── randombytes@2.0.1
│ │ ├── deep-equal@1.0.1
│ │ ├── defined@1.0.0
│ │ ├── deps-sort@1.3.9
│ │ ├── domain-browser@1.1.7
│ │ ├── duplexer2@0.0.2
│ │ ├── events@1.0.2
│ │ ├─┬ has@1.0.1
│ │ │ └── function-bind@1.0.2
│ │ ├── htmlescape@1.1.0
│ │ ├─┬ http-browserify@1.7.0
│ │ │ └── Base64@0.2.1
│ │ ├── https-browserify@0.0.1
│ │ ├─┬ insert-module-globals@6.6.3
│ │ │ ├─┬ combine-source-map@0.6.1
│ │ │ │ ├── convert-source-map@1.1.3
│ │ │ │ ├── inline-source-map@0.5.0
│ │ │ │ ├── lodash.memoize@3.0.4
│ │ │ │ └── source-map@0.4.4
│ │ │ ├── is-buffer@1.1.1
│ │ │ └─┬ lexical-scope@1.2.0
│ │ │ └─┬ astw@2.0.0
│ │ │ └── acorn@1.2.2
│ │ ├── isarray@0.0.1
│ │ ├─┬ JSONStream@1.0.7
│ │ │ └── jsonparse@1.2.0
│ │ ├─┬ labeled-stream-splicer@1.0.2
│ │ │ └── stream-splicer@1.3.2
│ │ ├─┬ module-deps@3.9.1
│ │ │ ├─┬ detective@4.3.1
│ │ │ │ └── acorn@1.2.2
│ │ │ └─┬ stream-combiner2@1.0.2
│ │ │ └─┬ through2@0.5.1
│ │ │ ├── readable-stream@1.0.33
│ │ │ └── xtend@3.0.0
│ │ ├── os-browserify@0.1.2
│ │ ├─┬ parents@1.0.1
│ │ │ └── path-platform@0.11.15
│ │ ├── path-browserify@0.0.0
│ │ ├── process@0.11.2
│ │ ├── punycode@1.4.0
│ │ ├── querystring-es3@0.2.1
│ │ ├─┬ read-only-stream@1.1.1
│ │ │ └── readable-wrap@1.0.0
│ │ ├─┬ readable-stream@1.1.13
│ │ │ └── core-util-is@1.0.2
│ │ ├── resolve@1.1.6
│ │ ├── shallow-copy@0.0.1
│ │ ├─┬ shasum@1.0.2
│ │ │ ├─┬ json-stable-stringify@0.0.1
│ │ │ │ └── jsonify@0.0.0
│ │ │ └── sha.js@2.4.4
│ │ ├── shell-quote@0.0.1
│ │ ├── stream-browserify@1.0.0
│ │ ├── string_decoder@0.10.31
│ │ ├─┬ subarg@1.0.0
│ │ │ └── minimist@1.2.0
│ │ ├─┬ syntax-error@1.1.4
│ │ │ └── acorn@1.2.2
│ │ ├── through2@1.1.1
│ │ ├── timers-browserify@1.4.2
│ │ ├── tty-browserify@0.0.0
│ │ ├─┬ url@0.10.3
│ │ │ ├── punycode@1.3.2
│ │ │ └── querystring@0.2.0
│ │ ├── util@0.10.3
│ │ ├─┬ vm-browserify@0.0.4
│ │ │ └── indexof@0.0.1
│ │ └── xtend@4.0.1
│ ├── cordova-registry-mapper@1.1.14
│ ├─┬ cordova-serve@1.0.0
│ │ ├─┬ compression@1.6.0
│ │ │ ├─┬ accepts@1.3.0
│ │ │ │ ├── mime-types@2.1.9
│ │ │ │ └── negotiator@0.6.0
│ │ │ ├── bytes@2.1.0
│ │ │ ├─┬ compressible@2.0.6
│ │ │ │ └── mime-db@1.21.0
│ │ │ ├─┬ debug@2.2.0
│ │ │ │ └── ms@0.7.1
│ │ │ ├── on-headers@1.0.1
│ │ │ └── vary@1.1.0
│ │ ├─┬ express@4.13.3
│ │ │ ├─┬ accepts@1.2.13
│ │ │ │ └── negotiator@0.5.3
│ │ │ ├── array-flatten@1.1.1
│ │ │ ├── content-disposition@0.5.0
│ │ │ ├── content-type@1.0.1
│ │ │ ├── cookie@0.1.3
│ │ │ ├── cookie-signature@1.0.6
│ │ │ ├── depd@1.0.1
│ │ │ ├── escape-html@1.0.2
│ │ │ ├── etag@1.7.0
│ │ │ ├─┬ finalhandler@0.4.0
│ │ │ │ └── unpipe@1.0.0
│ │ │ ├── fresh@0.3.0
│ │ │ ├── merge-descriptors@1.0.0
│ │ │ ├── methods@1.1.1
│ │ │ ├─┬ on-finished@2.3.0
│ │ │ │ └── ee-first@1.1.1
│ │ │ ├── parseurl@1.3.0
│ │ │ ├── path-to-regexp@0.1.7
│ │ │ ├─┬ proxy-addr@1.0.10
│ │ │ │ ├── forwarded@0.1.0
│ │ │ │ └── ipaddr.js@1.0.5
│ │ │ ├── qs@4.0.0
│ │ │ ├── range-parser@1.0.3
│ │ │ ├─┬ send@0.13.0
│ │ │ │ ├── destroy@1.0.3
│ │ │ │ ├── http-errors@1.3.1
│ │ │ │ ├── mime@1.3.4
│ │ │ │ └── statuses@1.2.1
│ │ │ ├── serve-static@1.10.0
│ │ │ ├─┬ type-is@1.6.10
│ │ │ │ └── media-typer@0.3.0
│ │ │ ├── utils-merge@1.0.0
│ │ │ └── vary@1.0.1
│ │ └── q@1.4.1
│ ├─┬ dep-graph@1.1.0
│ │ └── underscore@1.2.1
│ ├─┬ elementtree@0.1.6
│ │ └── sax@0.3.5
│ ├─┬ glob@4.0.6
│ │ ├── graceful-fs@3.0.8
│ │ ├── inherits@2.0.1
│ │ ├─┬ minimatch@1.0.0
│ │ │ ├── lru-cache@2.7.3
│ │ │ └── sigmund@1.0.1
│ │ └─┬ once@1.3.3
│ │ └── wrappy@1.0.1
│ ├─┬ init-package-json@1.9.1
│ │ ├── glob@5.0.15
│ │ ├─┬ npm-package-arg@4.1.0
│ │ │ └── hosted-git-info@2.1.4
│ │ ├── promzard@0.3.0
│ │ ├─┬ read@1.0.7
│ │ │ └── mute-stream@0.0.5
│ │ ├─┬ read-package-json@2.0.2
│ │ │ ├── glob@5.0.15
│ │ │ ├── graceful-fs@4.1.2
│ │ │ ├─┬ json-parse-helpfulerror@1.0.3
│ │ │ │ └── jju@1.2.1
│ │ │ └─┬ normalize-package-data@2.3.5
│ │ │ └─┬ is-builtin-module@1.0.0
│ │ │ └── builtin-modules@1.1.1
│ │ ├─┬ validate-npm-package-license@3.0.1
│ │ │ ├─┬ spdx-correct@1.0.2
│ │ │ │ └── spdx-license-ids@1.1.0
│ │ │ └─┬ spdx-expression-parse@1.0.2
│ │ │ └── spdx-exceptions@1.0.4
│ │ └── validate-npm-package-name@2.2.2
│ ├── nopt@3.0.6
│ ├─┬ npm@2.14.15
│ │ ├── abbrev@1.0.7
│ │ ├── ansi@0.3.0
│ │ ├── ansi-regex@2.0.0
│ │ ├── block-stream@0.0.8
│ │ ├─┬ cmd-shim@2.0.1
│ │ │ └── graceful-fs@3.0.8
│ │ ├─┬ config-chain@1.1.9
│ │ │ └── proto-list@1.2.4
│ │ ├── fstream@1.0.8
│ │ ├─┬ glob@5.0.15
│ │ │ └── path-is-absolute@1.0.0
│ │ ├── graceful-fs@4.1.2
│ │ ├── hosted-git-info@2.1.4
│ │ ├── imurmurhash@0.1.4
│ │ ├── inflight@1.0.4
│ │ ├── inherits@2.0.1
│ │ ├── ini@1.3.4
│ │ ├─┬ init-package-json@1.9.1
│ │ │ └── promzard@0.3.0
│ │ ├─┬ minimatch@3.0.0
│ │ │ └─┬ brace-expansion@1.1.1
│ │ │ └── concat-map@0.0.1
│ │ ├─┬ mkdirp@0.5.1
│ │ │ └── minimist@0.0.8
│ │ ├─┬ node-gyp@3.2.1
│ │ │ ├─┬ glob@4.5.3
│ │ │ │ └─┬ minimatch@2.0.10
│ │ │ │ └─┬ brace-expansion@1.1.2
│ │ │ │ ├── balanced-match@0.3.0
│ │ │ │ └── concat-map@0.0.1
│ │ │ ├─┬ minimatch@1.0.0
│ │ │ │ ├── lru-cache@2.7.3
│ │ │ │ └── sigmund@1.0.1
│ │ │ └─┬ path-array@1.0.0
│ │ │ └─┬ array-index@0.1.1
│ │ │ └─┬ debug@2.2.0
│ │ │ └── ms@0.7.1
│ │ ├── nopt@3.0.6
│ │ ├─┬ normalize-package-data@2.3.5
│ │ │ └── is-builtin-module@1.0.0
│ │ ├── npm-package-arg@4.1.0
│ │ ├─┬ npm-registry-client@7.0.9
│ │ │ └─┬ concat-stream@1.5.1
│ │ │ ├─┬ readable-stream@2.0.4
│ │ │ │ ├── core-util-is@1.0.2
│ │ │ │ ├── isarray@0.0.1
│ │ │ │ ├── process-nextick-args@1.0.6
│ │ │ │ ├── string_decoder@0.10.31
│ │ │ │ └── util-deprecate@1.0.2
│ │ │ └── typedarray@0.0.6
│ │ ├── once@1.3.3
│ │ ├── opener@1.4.1
│ │ ├─┬ osenv@0.1.3
│ │ │ └── os-tmpdir@1.0.1
│ │ ├─┬ read@1.0.7
│ │ │ └── mute-stream@0.0.5
│ │ ├─┬ read-package-json@2.0.2
│ │ │ └─┬ json-parse-helpfulerror@1.0.3
│ │ │ └── jju@1.2.1
│ │ ├─┬ readable-stream@1.1.13
│ │ │ ├── isarray@0.0.1
│ │ │ └── string_decoder@0.10.31
│ │ ├─┬ request@2.67.0
│ │ │ ├─┬ bl@1.0.0
│ │ │ │ └─┬ readable-stream@2.0.4
│ │ │ │ ├── core-util-is@1.0.2
│ │ │ │ ├── isarray@0.0.1
│ │ │ │ ├── process-nextick-args@1.0.6
│ │ │ │ ├── string_decoder@0.10.31
│ │ │ │ └── util-deprecate@1.0.2
│ │ │ ├─┬ har-validator@2.0.3
│ │ │ │ ├─┬ chalk@1.1.1
│ │ │ │ │ ├── ansi-styles@2.1.0
│ │ │ │ │ ├── has-ansi@2.0.0
│ │ │ │ │ └── supports-color@2.0.0
│ │ │ │ └─┬ is-my-json-valid@2.12.3
│ │ │ │ └── xtend@4.0.1
│ │ │ ├─┬ http-signature@1.1.0
│ │ │ │ ├── assert-plus@0.1.5
│ │ │ │ └─┬ sshpk@1.7.1
│ │ │ │ └─┬ dashdash@1.10.1
│ │ │ │ └── assert-plus@0.1.5
│ │ │ ├── json-stringify-safe@5.0.1
│ │ │ ├── node-uuid@1.4.7
│ │ │ ├── stringstream@0.0.5
│ │ │ ├── tough-cookie@2.2.1
│ │ │ └── tunnel-agent@0.4.2
│ │ ├── semver@5.1.0
│ │ ├─┬ sha@2.0.1
│ │ │ └─┬ readable-stream@2.0.2
│ │ │ ├── isarray@0.0.1
│ │ │ └── string_decoder@0.10.31
│ │ ├── slide@1.1.6
│ │ ├── spdx-license-ids@1.1.0
│ │ ├── strip-ansi@3.0.0
│ │ ├─┬ validate-npm-package-license@3.0.1
│ │ │ ├── spdx-correct@1.0.2
│ │ │ └─┬ spdx-expression-parse@1.0.2
│ │ │ └── spdx-exceptions@1.0.4
│ │ ├─┬ validate-npm-package-name@2.2.2
│ │ │ └── builtins@0.0.7
│ │ ├── wrappy@1.0.1
│ │ └── write-file-atomic@1.1.4
│ ├─┬ npmconf@2.1.2
│ │ ├─┬ config-chain@1.1.9
│ │ │ └── proto-list@1.2.4
│ │ ├── ini@1.3.4
│ │ ├─┬ mkdirp@0.5.1
│ │ │ └── minimist@0.0.8
│ │ └── uid-number@0.0.5
│ ├── opener@1.4.1
│ ├─┬ plist@1.2.0
│ │ ├── base64-js@0.0.8
│ │ ├── util-deprecate@1.0.2
│ │ ├─┬ xmlbuilder@4.0.0
│ │ │ └── lodash@3.10.1
│ │ └── xmldom@0.1.20
│ ├── properties-parser@0.2.3
│ ├─┬ rc@0.5.2
│ │ ├── deep-extend@0.2.11
│ │ ├── ini@1.1.0
│ │ ├── minimist@0.0.10
│ │ └── strip-json-comments@0.1.3
│ ├─┬ request@2.47.0
│ │ ├── aws-sign2@0.5.0
│ │ ├─┬ bl@0.9.4
│ │ │ └── readable-stream@1.0.33
│ │ ├── caseless@0.6.0
│ │ ├─┬ combined-stream@0.0.7
│ │ │ └── delayed-stream@0.0.5
│ │ ├── forever-agent@0.5.2
│ │ ├─┬ form-data@0.1.4
│ │ │ ├── async@0.9.2
│ │ │ └── mime@1.2.11
│ │ ├─┬ hawk@1.1.1
│ │ │ ├── boom@0.4.2
│ │ │ ├── cryptiles@0.2.2
│ │ │ ├── hoek@0.9.1
│ │ │ └── sntp@0.2.4
│ │ ├─┬ http-signature@0.10.1
│ │ │ ├── asn1@0.1.11
│ │ │ ├── assert-plus@0.1.5
│ │ │ └── ctype@0.5.3
│ │ ├── json-stringify-safe@5.0.1
│ │ ├── mime-types@1.0.2
│ │ ├── node-uuid@1.4.7
│ │ ├── oauth-sign@0.4.0
│ │ ├── qs@2.3.3
│ │ ├── stringstream@0.0.5
│ │ ├── tough-cookie@2.2.1
│ │ └── tunnel-agent@0.4.2
│ ├── semver@4.3.6
│ ├── shelljs@0.3.0
│ ├─┬ tar@1.0.2
│ │ ├── block-stream@0.0.8
│ │ └─┬ fstream@1.0.8
│ │ ├── graceful-fs@4.1.2
│ │ └─┬ rimraf@2.5.0
│ │ └── glob@6.0.4
│ ├── unorm@1.3.3
│ ├── valid-identifier@0.0.1
│ └─┬ xcode@0.8.0
│ ├── node-uuid@1.3.3
│ └── pegjs@0.6.2
├─┬ nopt@3.0.1
│ └── abbrev@1.0.7
├── q@1.0.1
├── underscore@1.7.0
└─┬ update-notifier@0.5.0
├─┬ chalk@1.1.1
│ ├── ansi-styles@2.1.0
│ ├── escape-string-regexp@1.0.4
│ ├─┬ has-ansi@2.0.0
│ │ └── ansi-regex@2.0.0
│ ├── strip-ansi@3.0.0
│ └── supports-color@2.0.0
├─┬ configstore@1.4.0
│ ├── graceful-fs@4.1.2
│ ├── object-assign@4.0.1
│ ├── os-tmpdir@1.0.1
│ ├── uuid@2.0.1
│ ├─┬ write-file-atomic@1.1.4
│ │ ├── graceful-fs@4.1.2
│ │ ├── imurmurhash@0.1.4
│ │ └── slide@1.1.6
│ └── xdg-basedir@2.0.0
├── is-npm@1.0.0
├─┬ latest-version@1.0.1
│ └─┬ package-json@1.2.0
│ ├─┬ got@3.3.1
│ │ ├─┬ duplexify@3.4.2
│ │ │ ├── end-of-stream@1.0.0
│ │ │ └─┬ readable-stream@2.0.5
│ │ │ └── process-nextick-args@1.0.6
│ │ ├── infinity-agent@2.0.3
│ │ ├── is-redirect@1.0.0
│ │ ├── is-stream@1.0.1
│ │ ├── lowercase-keys@1.0.0
│ │ ├── nested-error-stacks@1.0.2
│ │ ├── object-assign@3.0.0
│ │ ├── prepend-http@1.0.3
│ │ ├─┬ read-all-stream@3.0.1
│ │ │ ├─┬ pinkie-promise@1.0.0
│ │ │ │ └── pinkie@1.0.0
│ │ │ └── readable-stream@2.0.5
│ │ └── timed-out@2.0.0
│ └─┬ registry-url@3.0.3
│ └─┬ rc@1.1.6
│ ├── deep-extend@0.4.0
│ └── strip-json-comments@1.0.4
├─┬ repeating@1.1.3
│ └─┬ is-finite@1.0.1
│ └── number-is-nan@1.0.0
├─┬ semver-diff@2.1.0
│ └── semver@5.1.0
└── string-length@1.0.1
localhost:/ zhangxh$ cordova create hello com.example.hello HelloWorld
Creating a new cordova project.
localhost:/ zhangxh$