Dab88
Dab88

Reputation: 199

Run Unit Test by command line - Swift Project with cocoaPods

I'm trying to run a Unit Test from my project using the following command:

xcodebuild test -scheme 'WaveIt' -destination 'platform=iOS Simulator,name=iPhone 6,OS=8.4'

But I get back this:

ld: library not found for -lSocketRocket clang: error: linker command failed with exit code 1 (use -v to see invocation)

Testing failed: Linker command failed with exit code 1 (use -v to see invocation) ** TEST FAILED **

The following build commands failed: Ld DerivedData/WaveIt/Build/Products/Debug-iphonesimulator/WaveIt.app/WaveIt normal x86_64 (1 failure)

My project includes libraries with cocoaPods:

And Alamofire (git submodule)

Can anybody tell me what is the problem?

Regards

Upvotes: 4

Views: 1816

Answers (1)

Tomáš Linhart
Tomáš Linhart

Reputation: 14299

You need to specify your workspace in xcodebuild.

xcodebuild test -workspace 'WaveIt.workspace' -scheme 'WaveIt' -destination 'platform=iOS Simulator,name=iPhone 6,OS=8.4'

Upvotes: 5

Related Questions