Disabling some files in Xcode project from compilation

后端 未结 4 607
长发绾君心
长发绾君心 2020-12-06 10:45

I have started a new project in Xcode by duplicating an existing folder, because my new app will have a lot of common features with the old one.

The problem is that

4条回答
  •  长情又很酷
    2020-12-06 11:38

    In Xcode 9, I am not sure about older versions, go to:

    Build Settings -> Build Options -> Excluded Source File Names

    Add all file names you want excluded. You can even do wildcard matching.

    Bellow is an example of how I have excluded all files starting with dev- and ending with .cc for all schemes except for a Debug scheme that is built for Simulator. All Debug Simulator builds exclude files starting with release- and ending with .cc

    Hope this helps!!

    UPDATE

    I had a similar problem with frameworks and you can exclude frameworks from being embedded into your app with this too!

    My problem was that I had 2 frameworks, one was built for the simulator and the other was build for ARM. iTunes Connect complained about me including the simulator one with the app.

    If you have many frameworks this help with reducing the app's size too.

提交回复
热议问题