Question

This question is related, but does not resolve the specific issue I am having.

I am using Xcode 4.6.3 under OS X 10.7.5.

I simply created the default project for a single view iOS app and made no changes to the project settings. The project, of course, builds in Xcode for the iOS Simulator. However, when I try to use xcodebuild from the command line, xcodebuild fails.

The project name is just: temp

I tried:

xcodebuild -scheme temp -sdk iphonesimulator6.1

and that produced the results:

Build settings from command line:
    SDKROOT = iphonesimulator6.1

=== BUILD NATIVE TARGET temp OF PROJECT temp WITH CONFIGURATION Debug ===
Check dependencies
No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=x86_64, VALID_ARCHS=i386).


** BUILD FAILED **


The following build commands failed:
    Check dependencies
(1 failure)

Based on the other SO question, I tried:

xcodebuild ARCHS="armv7 armv7s" ONLY_ACTIVE_ARCH=NO -scheme temp -sdk iphonesimulator6.1

and got similar results:

Build settings from command line:
    ARCHS = armv7 armv7s
    ONLY_ACTIVE_ARCH = NO
    SDKROOT = iphonesimulator6.1

=== BUILD NATIVE TARGET temp OF PROJECT temp WITH CONFIGURATION Debug ===
Check dependencies
No architectures to compile for (ARCHS=armv7 armv7s, VALID_ARCHS=i386).


** BUILD FAILED **


The following build commands failed:
    Check dependencies
(1 failure)

What xcodebuild command do I need to execute to be able to build with xcodebuild?

Thank you.

Was it helpful?

Solution

UPDATED: Seems like many folks have trouble of this sort in xcode 4, and the general solution seems to be to force the architecture you need and disable 'active only', which is what you had tried to do... but for the simulator, you need to specify i386 instead of arm*, like this:

xcodebuild ARCHS="i386" ONLY_ACTIVE_ARCH=NO -scheme temp -sdk iphonesimulator6.1

* ORIGINAL response which spawned comment thread below and still has some valuable reference: It sounds like your project my not be set up for 64-bit. You should be able to add arm64 to your valid architectures in your build settings and I believe xcode will automatically treat it as x86_64 for simulator builds.

For the second thing you attempted, you are hard-coding your architectures to IPhone architectures while targeting a simulator, which I believe is why the architectures are not available there.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top