Monday, 11 February 2019

Workspace, Project, Target, Scheme

Workspace
Contains a collection of projects. 
E.g. When you create Cocoa Touch Framework as a sub project of the existing main project. Or when you 'pod install' any third party libraries which creates the Pods project along with the .xcworkspace file.

Project
The source code and any other resources.

Target
Specifies the building settings and define how much of the source code and resources should go to the product. When you say build/run, you are running a target.
It defines a single product. You can create more targets if you need slightly different versions of an app(e.g. different brandings, different testing targets contain different test cases).

Scheme
By default, a target has one related scheme. But you can create more schemes for the same target. A scheme can also contain multiple targets (e.g. 1. testing scheme contains test cases from multiple targets 2. Local testing scheme only for your new feature since you don't want to run all the tests everytime)
"An Xcode scheme defines a collection of targets to build, a configuration to use when building, and a collection of tests to execute." -- Apple Documentation
Those configuration might be environment variables, System language, Location...etc.

No comments:

Post a Comment