سؤال

I have a Mac application which is built using i386 architecture on 64 bit Mac. Recently I have added test cases (XCTest) in Xcode project to test the project and everything is working fine when I launch the tests using Xcode. But when I try to run the test cases on command line I get error complaining about mismatch in architecture for which the tests were built for and that of the machine I am running on.

/Applications/Xcode5.app/Contents/Developer/usr/bin/xctest -XCTest MyTests.xctest 2014-02-11 14:58:23.600 xctest[57952:707] The test bundle at /Users/myself/Library/Developer/Xcode/DerivedData/MyAppMac-elsbcgzhxehizognmveiiwsqvusx/Build/Products/Debug/MyTests.xctest could not be loaded because it is built for a different architecture than the currently-running test rig (which is running as x86_64). 2014-02-11 14:58:23.603 xctest[57953:203] *** NSTask: Task create for path '/Users/myself/Library/Developer/Xcode/DerivedData/MyAppMac-elsbcgzhxehizognmveiiwsqvusx/Build/Products/Debug/MyTests.xctest/Contents/MacOS/MyTests' failed: 22, "Invalid argument". Terminating temporary process.

The testcases are also built with architecture = i386

any insight would be helpful,

Thanks

هل كانت مفيدة؟

المحلول

I ended up running the unit tests using xcodebuild command as below

xcodebuild test -scheme MyProjWithTests

More information about xcodebuild here

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top