alasarr
alasarr

Reputation: 1605

Xcodebuild cannot build framework library for simulator sdk

I'm having some issues when I try to build a framework using xcodebuild. My xcode version is 6.1.

This line works well:

xcodebuild -target Knot3DLib -configuration Release -sdk iphoneos

However it doesn't work:

xcodebuild -target Knot3DLib -configuration Release -sdk iphonesimulator

It says:

No architectures to compile for (ARCHS=i386 x86_64, VALID_ARCHS=arm64 armv7 armv7s).

I've no defined neither i386 nor x86_64 as archs in my project, so why does xcodebuild try to build i386? Here's my architecture build settings:

build settings

I can run the project from Xcode in both simulator and devices.

I've tried other similar questions but none of them worked for me.

Upvotes: 2

Views: 3353

Answers (1)

jackslash
jackslash

Reputation: 8570

The simulator is just that, a simulator. Xcode builds code that runs on a simulated environment on your computer. Your computer has an intel CPU and your phone has an ARM CPU. The compiler generates different code for these processors.

The error:

No architectures to compile for (ARCHS=i386 x86_64, VALID_ARCHS=arm64 armv7 armv7s).

Tells you that the architecture you are trying to compile for: ARCHS=i386 x86_64 is not in the list of VALID_ARCHS.

i386 and x86_64 are the architectures that intel CPUs use. If you are trying to build a framework with xcodebuild and you want to be able to link against the simulator sdk you need to add i386 and x86_64 to your list of VALID_ARCHS

Upvotes: 8

Related Questions