Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing app name broke ability to run tests in xcode

After I changed the product name for my app, I could still run the app in the simulator, but when I try to run tests, I get this error:

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

Why is the test action still trying to read from the old app name, even though I've changed the Product Name build property and xcode no longer builds to that location?

like image 201
Stefan Kendall Avatar asked Dec 09 '22 11:12

Stefan Kendall


2 Answers

you need to change the "bundle loader" property of your unit test target.

Check the other properties of both the test and the app for the "OldAppName" by typing it in the search field on the "Build Settings" page for both targets.

Here is a screen shot to illustrate:

enter image description here

like image 200
Brad Allred Avatar answered Feb 11 '23 11:02

Brad Allred


How you changed your appname? from the Project navigation pane? or from the build settings packaging -> product name of the target ?However i also want to tell that second way is ideal way to do it.

like image 21
creative_rd Avatar answered Feb 11 '23 11:02

creative_rd