1
votes

I want to create a test target for my app

Before adding the test target, the app builds and runs fine
When I add the test target this is what is displayed when i try to build

GenerateDSYMFile /Users/dev1/Library/Developer/Xcode/DerivedData/MyApp-apigviljomlmendsdvrgealzkevw/Build/Products/Debug-iphoneos/MyApp\ Tests.xctest.dSYM /Users/dev1/Library/Developer/Xcode/DerivedData/MyApp-apigviljomlmendsdvrgealzkevw/Build/Products/Debug-iphoneos/MyApp\ Tests.xctest/MyApp\ Tests cd /Users/dev1/Dev/IOSworkspace/MyApp

export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil /Users/dev1/Library/Developer/Xcode/DerivedData/MyApp-apigviljomlmendsdvrgealzkevw/Build/Products/Debug-iphoneos/MyApp\ Tests.xctest/MyApp\ Tests -o /Users/dev1/Library/Developer/Xcode/DerivedData/MyApp-apigviljomlmendsdvrgealzkevw/Build/Products/Debug-iphoneos/MyApp\ Tests.xctest.dSYM

error: unable to open executable '/Users/dev1/Library/Developer/Xcode/DerivedData/MyApp-apigviljomlmendsdvrgealzkevw/Build/Products/Debug-iphoneos/MyApp Tests.xctest/MyApp Tests'

How do I fix it ?

1

1 Answers

0
votes

The answer is... :

The Mach-O Linker flag in the test target was set to "executable" instead of "bundle".

as found on this page: https://stackoverflow.com/a/19325817/2136812