Best Practice to Set up ios Environments: Develop, Staging, and Production

July 19, 2021 Publish By : EXPERT APP DEVS 1 min read Viewed By : 534
set-up environments for iOS
  1. Development (Internal testing ):-

  • Development distribution outside the iOS App Store
  • Used for development and internal testing 
  • Change api server url to development server 
  1. Staging :- 

  • Staging distribution outside the iOS App Store
  • Used for Staging and Client testing 
  • Change api server url to Staging server 
  1. Production :-

  • Distribution in the iOS App Store
  • Used for AppStore user  
  • Change api server url to Production server 

How to add Setup environment to our project :- 

  1. Create project 
  2. Adding Configurations 
  • Every project created with two default configurations 1. Debug 2. Release Debug and Release default configurations
  • Now our project needs to create with three configuration development ,  staging and production.
  • To add new configuration click on + button below configuration list. add new configuration and configuration list

 

  1. Storing the configuration in info.plist
  • To access the configuration at runtime, we need to store it in the target's Info.plist.
  •  In info.plist Add new Row to create a new key-value pair. Set the key as Configuration and the value$(CONFIGURATION).

 

Configuration and the value CONFIGURATION

 

  1. Defining Schemes

  • configuration stored in the target's Info.plist, Now it is time to add the ability to easily switch environments. We do this by adding a scheme for every configuration.

configuration stored in the Info plis

 

  1. Set configuration to scheme

Select server type when creating Archive.

Set configuration to scheme

 

  • Select server type when creating Archive.

Select server type when creating Archive

Need a consultation?

Drop us a line! We are here to answer your questions 24/7.