OCUnit测试现有的iOS项目。 “ld:找不到文件” [英] OCUnit tests to existing iOS project. "ld: file not found"
问题描述
我一直关注此博文:将单元测试添加到现有项目。
我收到此错误:
ld:找不到文件:
Build / Products / Debug-iphoneos / MyApp.app / MyApp
命令
/Developer/Platforms/iPhoneSimulator.platform/Developer/ usr / bin / clang
因退出代码1而失败
ld: file not found: Build/Products/Debug-iphoneos/MyApp.app/MyApp Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang failed with exit code 1
我有我的测试目标属性,
I have my test target properties,
Bundle Loader = $(BUILT_PRODUCTS_DIR)/MyApp.app/MyApp
Bundle Loader = $(BUILT_PRODUCTS_DIR)/MyApp.app/MyApp
测试主机= $(BUNDLE_LOADER )
Test Host = $(BUNDLE_LOADER)
(两者都等于:build / Debug-iphoneos / MyApp.app / MyApp)
(which both equate to: build/Debug-iphoneos/MyApp.app/MyApp)
我猜测这些变量并没有指向与编译器相同的位置。 build / Debug-iphoneos / ...vsBuild / Products / Debug-iphoneos /...\"
My wild guess is that those variables aren't pointing to the same location as the compiler. "build/Debug-iphoneos/..." vs "Build/Products/Debug-iphoneos/..."
我猜这可能是完全错误的,但是无论哪种方式,有没有人知道是什么导致了这个错误或我将如何解决这些环境变量?
I could be totally wrong on that guess, but either way, does anyone know what's causing this error or how I would fix those environment variables?
感谢您的帮助,
Sam
推荐答案
深入了解〜/ Library / Developer / Xcode / DerivedData,进入你的项目。从那里,按照Bundle Loader路径。看看实际上有什么。
Dig into ~/Library/Developer/Xcode/DerivedData, down into your project. From there, follow the Bundle Loader path. See what's actually there.
现在看看你的Info.plist(或你的目标的信息设置)并寻找可执行文件或 CFBundleExecutable
。如果是 $ {EXECUTABLE_NAME}
,请检查目标的产品名称设置。
Now look at your Info.plist (or your target's Info settings) and look for "Executable file" or CFBundleExecutable
. If it's ${EXECUTABLE_NAME}
, check your target's "Product name" setting.
这篇关于OCUnit测试现有的iOS项目。 “ld:找不到文件”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!