简体   繁体   中英

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:

构建设置

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM