在Cocoa Touch中运行逻辑单元测试时,.app文件找不到文件错误

时间:2013-06-25 18:15:22

标签: xcode cocoa-touch

我在尝试运行新创建的cocoa touch逻辑单元测试时遇到以下错误(使用新创建的单元测试目标):

ld: file not found:  /Users/mtford/Library/Developer/Xcode/DerivedData/MyApp-fggwogwgifttccffwerwbfhoklcf/Build/Products/Debug-iphonesimulator/MyApp.app/MyApp
clang: error: linker command failed with exit code 1 (use -v to see invocation)

但是这个位置确实存在于我的文件系统中:

Michaels-MacBook-Air:~ mtford$ ls -l /Users/mtford/Library/Developer/Xcode/DerivedData/MyApp-fggwogwgifttccffwerwbfhoklcf/Build/Products/Debug-iphonesimulator/MyApp.app/MyApp
-rwxr-xr-x  1 mtford  staff  3160412 Jun 25 19:10 /Users/mtford/Library/Developer/Xcode/DerivedData/MyApp-fggwogwgifttccffwerwbfhoklcf/Build/Products/Debug-iphonesimulator/MyApp.app/MyApp

我最终试图解决这个问题......

更新

我发现为什么Xcode会抛出错误:它正在寻找:

 " /Users/mtford/Library/Developer/Xcode/DerivedData/Mosayc-fggwogwgifttccffwerwbfhoklcf/Build/Products/Debug-iphonesimulator/Mosayc.app/Mosayc"

运行Ld命令时。注意前面的空间?这会导致bash错误。这个空间可能来自哪个想法?

1 个答案:

答案 0 :(得分:1)

在Bundle loader下的目标设置中,我有“$(BUILT_PRODUCTS_DIR)/MyApp.app/MyApp”(注意空格)。我删除了空间仍然无法正常工作。我也删除了引号然后它工作正常!