When I run xcodebuild
, it crashes. It seems that it is not compiling the test target's dependency, which is the main app. The test target is called NiknikTests
, while the app's target is called WTATest3
.
Ld build/UninstalledProducts/NiknikTests.xctest/NiknikTests normal i386
cd "/Users/ethen/.jenkins/workspace/Build NikNik"
export IPHONEOS_DEPLOYMENT_TARGET=7.1
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/ethen/Desktop/sbt/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -bundle -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk -L/Users/ethen/.jenkins/workspace/Build\ NikNik/build/Release-iphonesimulator -L/Users/ethen/.jenkins/workspace/Build\ NikNik/NiknikTests/TestLibraries/include/lib -F/Users/ethen/.jenkins/workspace/Build\ NikNik/build/Release-iphonesimulator -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -filelist /Users/ethen/.jenkins/workspace/Build\ NikNik/build/NikNik.build/Release-iphonesimulator/NiknikTests.build/Objects-normal/i386/NiknikTests.LinkFileList -bundle_loader /Users/ethen/.jenkins/workspace/Build\ NikNik/build/Release-iphonesimulator/Niknik.app/Niknik -Xlinker -objc_abi_version -Xlinker 2 -force_load /Users/ethen/.jenkins/workspace/Build\ NikNik/NiknikTests/TestLibraries/include/lib/libOCMock.a -ObjC -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=7.1 -framework UIKit -framework Foundation -Xlinker -dependency_info -Xlinker /Users/ethen/.jenkins/workspace/Build\ NikNik/build/NikNik.build/Release-iphonesimulator/NiknikTests.build/Objects-normal/i386/NiknikTests_dependency_info.dat -o /Users/ethen/.jenkins/workspace/Build\ NikNik/build/UninstalledProducts/NiknikTests.xctest/NiknikTests
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_NNBoundaryLineModel", referenced from:
objc-class-ref in NNBoundaryLineModelTests.o
(maybe you meant: _OBJC_CLASS_$_NNBoundaryLineModelTests)
"_OBJC_CLASS_$_NNConstant", referenced from:
objc-class-ref in NNConstantTests.o
(maybe you meant: _OBJC_CLASS_$_NNConstantTests)
"_OBJC_CLASS_$_NNPlayerModel", referenced from:
objc-class-ref in NNPlayerModelTests.o
(maybe you meant: _OBJC_CLASS_$_NNPlayerModelTests)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Here is my xcodebuild
command:
xcodebuild \
-target NiknikTests \
-arch i386 \
-configuration “Debug” \
-sdk iphonesimulator \
TARGETED_DEVICE_FAMILY="2" \
ONLY_ACTIVE_ARCH=NO \
clean install
When I run the tests from inside of Xcode, it works just fine.
EDIT: This is showing the target dependency of NiknikTests
.
Why is it not building the target dependency?
I looks like it is not building the target dependency because of some issues with arch i386. In order to fix this I have two suggestions, 1) Delete the two arch statements from the xcodebuild command:
xcodebuild \
-target NiknikTests \
-configuration “Debug” \
-sdk iphonesimulator \
TARGETED_DEVICE_FAMILY="2" \
clean install
It should automatically choose the correct architecture for the program. However, if that does not work, 2) Try replacing "-arch i386 \" with "ARCHS=i386 \" IE
xcodebuild \
-target NiknikTests \
ARCHS=i386 \
-configuration “Debug” \
-sdk iphonesimulator \
TARGETED_DEVICE_FAMILY="2" \
ONLY_ACTIVE_ARCH=NO \
clean install
Did you try turning on build implicit dependencies under your build scheme ?
I had similar issues with Cocoapods and running unit tests
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With