ld: file not found: linker command failed with exit code 1
You might be getting this error because you renamed your project and Tests
cannot be found anymore. This is easy to fix:
Solve it in Xcode like this:
- Select your project from the project navigator.
- Select
[Your project's Tests]
under targets - Under
General
tab change theHost Application
from the drop down - Build and run.
This problem happened to me because I renamed my project and the tests could't find it anymore.
I had a similar problem -- it's because I was using Cocoapods and had opened the .xcodeproj file instead of the .xcworkspace file... doh!
The problem is that after renaming the product its Tests target is still looking for the previous app name.
Select your Tests target and then in Build Settings modify the TestHost values to correspond your new product name in the following way:
$(BUILT_PRODUCTS_DIR)/YourNewProductName.app/YourNewProductName