xcodebuild test command for using with jenkins doesn´t work

If you're using a custom build script, you can pass -arch i386 to xcodebuild

For instance:

xcodebuild -project MY_PROJECT -target TEST_TARGET -sdk iphonesimulator -configuration "Debug" -arch i386

(Scroll all the way to the right in the code sample above. The relevant flag is -arch i386)

Should force it to build against i386. However, you need to make sure i386 is in your VALID_ARCHS settings for the target.


In case anyone running into the same annoying problem again, I will share my script here: Remember to run this command under the directory that has the xcodeproj file.

xcodebuild \
-project "full-path-to-your-xcodeproj-file" \
-target YOUR_TARGET \
-sdk iphonesimulator6.1 \
-arch i386 \
-configuration Debug \
VALID_ARCHS="armv6 armv7 i386" \
ONLY_ACTIVE_ARCH=NO \
TARGETED_DEVICE_FAMILY="1" \
clean install

I modified the TARGETED_DEVICE_FAMILY because I only build for iPhone. If you want to build for both iPhone and iPad, delete this line or replace with TARGETED_DEVICE_FAMILY="1, 2".