iOS swift configurations

Manage Configurations 1

I as an iOS developer, face some situations like someone comes to me and says, “Hey, the app crashes, look at that” Assume that I have two versions installed from testflight or app store. I ask, “Which version is it?” and the answer might be “I don’t remember” I wanted to solve this problem without asking any question to the person who comes to me. Also, I wanted to add some controls where the app installed like testflight, app store or via Xcode. I wished to separate the versions with configuration. The answer is schemes.

When creating a new project, debug and release configurations comes automatically.

iOS swift configurations

I prefer to add one more configuration, which is called Test. It duplicates from “release”. Let’s click plus button where it is below the release configuration and select Duplicate Release Configuration.

iOS swift configurations

Why we need Test configuration?

Debug is for developers.

Release is for the AppStore.

Test is for testers.


Configure the App

Let’s start with the name of the app. Go to the Build Settings and search with the product name.

iOS swift product name

Change the names by configuration.

So, the question is, how can I run the app by configuration? Let’s manage the schemes!

iOS swift schemes

Click the plus button where on the bottom-left and create 2 more schemes. Change the names of the schemes Debug, Release, Test. To give a name, click the scheme name.

iOS swift schemes

Open the debug scheme clicking double times over the scheme name. Select configurations as Debug.

iOS swift manage schemes

The selective configurations are in Run on Info tab as Build Configuration, in Test on Info tab as Build Configuration, in Profile on Info tab as Build Configuration, in Analyze as Build Configuration, in Archive as Build Configuration.

The build configurations must be Debug for the Debug scheme, Test for the Test scheme and Release for the Release scheme.

Let’s select the Debug scheme and run the app.

iOS swift run simulator

When the app runs, you see the app name is Debug.

iOS swift debug configuration


What is Next?

We will change bundle id, app icon, base API URL by configuration in the next story.

The next story: Managing Configurations 2

Full project

Read in Medium

Keep following for more!

Note: Please comment if any correction or better way exists then you can help everyone.

1 Comment:

  1. Brad Guardado

    YOU NEED QUALITY VISITORS for your: yusufdemirci.dev

    My name is Brad Guardado, and I’m a Web Traffic Specialist. I can get:
    – visitors from search engines
    – visitors from social media
    – visitors from any country you want
    – very low bounce rate & long visit duration

    CLAIM YOUR 24 HOURS FREE TEST => https://bit.ly/3h750yC

Leave a Reply:

Your email address will not be published.