Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Xcode Project Configuration

Xcode Project Configuration

Slides for my @CocoaHeadsBE talk from 31/03/2015

Avatar for Thomas Keuleers

Thomas Keuleers

March 31, 2015

Other Decks in Programming

Transcript

  1. Why bother configuration? • Saves you time and prevents stupid

    mistakes • Keep it simple, only chose for a more advanced configuration when you really need to. • The bigger the project, the more important it gets 4
  2. –https://developer.apple.com “specifies a product to build and contains the instructions

    for building the product from a set of files in a project or workspace ” Xcode Target 5
  3. Xcode Target • Outputs 1 product • Separates physically different

    build products Example: Tests, extension, … 7
  4. Real world case: Step 1 8 Make a new app

    that has: • Application Target • Tests • Extension • Watchkit app
  5. Additions Support testing environments Each environment has a separate build

    product: • Icon • Bundle identifier • Server url • … 14
  6. Xcode Target - Server URL #if TARGET_TEST let serverURL =

    "https://test.companywebsite.be/api" #elseif TARGET_ACCEPT let serverURL = "https://accept.companywebsite.be/api" #else let serverURL = "https://companywebsite.be/api" #endif Step 1 Step 2 20
  7. 21

  8. Xcode Target duplication Benefit(s) Downsides Room for error Not scalable

    Quick setup Quick setup but made up time will catch up 23
  9. .xcconfig • Plain text key-value file • Declaring build parameters

    in one spot • Shared configuration for your target(s) 35
  10. Disclaimer This is just one way of using .xcconfig Demo

    37 Transforming a project to use .xcconfig
  11. Xcode Configuration 42 • 2 standard ones • differ mostly

    in debug info and build optimisation • sufficient for product development needs • Most developers never need to change these Debug & Release