Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.9k views
in Technique[技术] by (71.8m points)

iphone - Unit tests failing to run after app rename due to apple linker error

I recently changed the name of my app and now my unit tests are not running, I am getting an Apple linker error.

Any idea how to fix this? If I expand my 'Products' folder in Xcode there are 2 files:

MyApp.app MyAppTests.octest [which appears red]

Update: Deleted all the build folders (derived data) still doesn't work!

Ld /Users/my/Library/Developer/Xcode/DerivedData/srStudio-bdkguonwasdiazelguppliitkdox/Build/Products/Debug-iphonesimulator/companyDesignerTests.octest/companyDesignerTests normal i386 cd /Users/my/Documents/Working/companyDesigner setenv MACOSX_DEPLOYMENT_TARGET 10.6 setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang -arch i386 -bundle -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -L/Users/my/Library/Developer/Xcode/DerivedData/srStudio-bdkguonwasdiazelguppliitkdox/Build/Products/Debug-iphonesimulator -F/Users/my/Library/Developer/Xcode/DerivedData/srStudio-bdkguonwasdiazelguppliitkdox/Build/Products/Debug-iphonesimulator -F/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/Developer/Library/Frameworks -F/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/Developer/Library/Frameworks -filelist /Users/my/Library/Developer/Xcode/DerivedData/srStudio-bdkguonwasdiazelguppliitkdox/Build/Intermediates/srStudio.build/Debug-iphonesimulator/companyDesignerTests.build/Objects-normal/i386/companyDesignerTests.LinkFileList -mmacosx-version-min=10.6 -bundle_loader "/Users/my/Library/Developer/Xcode/DerivedData/srStudio-bdkguonwasdiazelguppliitkdox/Build/Products/Debug-iphonesimulator/s & r.app" -Xlinker -objc_abi_version -Xlinker 2 -lxml2 -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50000 -framework CoreData -framework CoreGraphics -framework Foundation -framework UIKit -framework SenTestingKit -o /Users/my/Library/Developer/Xcode/DerivedData/srStudio-bdkguonwasdiazelguppliitkdox/Build/Products/Debug-iphonesimulator/companyDesignerTests.octest/companyDesignerTests

ld: in /Users/my/Library/Developer/Xcode/DerivedData/srStudio-bdkguonwasdiazelguppliitkdox/Build/Products/Debug-iphonesimulator/s & r.app, can't map file, errno=22 for architecture i386 Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang failed with exit code 1

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The following solution works for me:

-> Select your project

-> select your projectTest file from TARGET

-> In Host Application, select your project from dropdown only if it show custom


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...