How can I build a specific architecture using xcodebuild?

前端 未结 2 1061
忘掉有多难
忘掉有多难 2020-12-05 02:53

I have legacy code that relies on pointers being 32-bit and want to use xCodeBuild to build that code from command line. This doesn\'t

相关标签:
2条回答
  • 2020-12-05 03:14
    xcodebuild ONLY_ACTIVE_ARCH...
    //or
    Build Settings -> Build Active Architecture Only -> ONLY_ACTIVE_ARCH
    

    YES - build binary with a single architecture for a connected device

    NO - build binary for a specific -arch(valid architectures aka VALID_ARCHS) if it was specified or for all the architectures in other cases

    The recommendation is to use Yes for Debug(it save a build time) and No for Release build.

    Note: it is safety to run on simulator

    To check the version use lipo -info[About]

    0 讨论(0)
  • 2020-12-05 03:34

    You have to set the ONLY_ACTIVE_ARCH to NO if you want xcodebuild to use the ARCHS parameters. By passing these parameters, you can force the proper architecture.

    xcodebuild ARCHS=i386 ONLY_ACTIVE_ARCH=NO -configuration Debug -workspace MyProject.xcworkspace -scheme MyLib
    

    See this reference for details.

    0 讨论(0)
提交回复
热议问题