用xcode编译可以通过,但是用xcodebuild 编译不能通过

上一篇 / 下一篇  2012-08-16 14:59:29

用xcode编译可以通过,但是用xcodebuild 编译不能通过,报错:

 

Undefined symbols for architecture i386:
  "_NSURLIsExcludedFromBackupKey", referenced from:
      -[CDVFile setMetadata:withDict:] in Cordova
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
 
分析原因可能是xcode升级之后,苹果会删除掉以前的Develop文件夹,导致系统找不到位于Develop文件夹下的众多命令
解决办法:
先去找最新的Xcode.app下各种命令的位置,结果是在
  • /Applications/Xcode.app/Contents/Developer/usr/bin

下面,然后修改$PATH的值:

  • vim ~/.bash_profile

增加上面的路径到PATH里面:

  • export PATH=.:/opt/local/bin:/opt/local/sbin:/Applications/Xcode.app/           Contents/Developer/usr/bin:$PATH

保存退出后

  • source ~/.bash_profile

这时候再打xcodebuild命令,就有反应了

  • xcodebuild -target “xxxxxx” -configuration Debug -sdk iphoneos

一大通log之后,久违的东西出现了!

  • ** BUILD SUCCEEDED **

 


TAG:

smalllin的个人空间 引用 删除 smalllin   /   2012-08-16 15:42:29
自动化打包介绍
http://stblog.baidu-tech.com/?p=1295
 

评分:0

我来说两句

Open Toolbar