iOS: XCode 4.4.1: xcodebuild error - Unable to read diagnostics from file

ε祈祈猫儿з 提交于 2019-12-12 03:56:32

问题


So I would like to use xcodebuild in Terminal to create a build from a test application (called RunTeszt1). The app is an iOS single view application with nothing in it, just created and closed.

When I this from the Terminal, the build fails.

xcodebuild -target "RunTeszt1" -sdk "$iphoneos5" -configuration Debug

The error is:

Unable to read diagnostics from file "/var/folders/6s/cjw35hhs5lb6wpnx9m8lr2km0000gn/C/com.apple.Xcode.501/SharedPrecompiledHeaders/RunTeszt1-Prefix-eqntxoxxhhlzvieuipqbxfumbpxb/RunTeszt1-Prefix.pch.dia" (Invalid File): Bad header in diagnostics file

Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1

When I run the app from XCode (4.4.1), the build completes and everything is ok. However, If I run the Console app and inspect the results after hitting build button in XCode, I see the same error message in the console. Nevertheless the build succeeds and opens the simulator.

Is this really a bug in xcodebuild which should be sent to apple? If it is I imagine a bunch of people already sent it.

How can I either make the error go away, or stop it from cancelling the building process, so circumvent it like XCode does?


回答1:


Turns out the problem was code signing. Even though I put Don't code sign in the build settings, it still hanged up on it. Also it seems "-sdk xxx" was also at fault (no matter what sdk I specified). Running this command resulted in a successful build:

xcodebuild clean build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -target RunTeszt2


来源:https://stackoverflow.com/questions/12514629/ios-xcode-4-4-1-xcodebuild-error-unable-to-read-diagnostics-from-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!