How to set up iOS environments Using Xcode Schemes: Production and Sandbox Chintan Prajapati February 23, 2023 3 min read Welcome to our guide on creating sandbox and production apps within a single project. When developing mobile applications, it’s essential to test and deploy them in different environments to ensure their quality and functionality. However, managing two separate projects for sandbox and production apps can be challenging and time-consuming. In this article, we’ll show you how to set up iOS environments Using create sandbox and production apps within a single project. By using this approach, you can easily switch between environments, streamline your development process, and avoid common mistakes that can arise from managing separate projects.We’ll cover various aspects of creating a single project for both sandbox and production apps, including how to set up different configurations, handle data, and manage resources. With our step-by-step instructions and best practices, you’ll be able to create a more efficient and organized workflow for your mobile app development.Whether you’re a seasoned developer or just starting out, this guide will provide you with valuable insights into managing sandbox and production apps within a single project. So, let’s dive in and learn how to create a more streamlined development process for your mobile applications!To create two schemes for a sandbox and production app in Xcode, follow these steps: Open your Xcode project and select the project in the Project Navigator. Click on the “Scheme” drop-down menu located in the top-left corner of Xcode and select “Edit Scheme…”. In the Edit Scheme window, click on the “Manage Schema” button in the bottom-left corner to add a new scheme. In the Manage Scheme window, click on the “+” button in the bottom-left corner to add a new scheme. After clicking on the “+” button open popup to enter your schema name. (etc Sample Project Production) Name the new scheme to reflect the environment it will be used for (e.g., Sandbox, Production). Select the target for the new scheme from the “Build” tab. Customize any additional settings, such as the Run or Test configurations, as desired. We can set two different bundle identifiers according to the sandbox and production app. So during the build release time, we don’t want to edit the bundle identifier every time. Please follow the below steps for that. Go To Build Setting -> Check Packaging -> Open Product Bundle Identifier You can set it according to your feasible bundle identifier. Check the below screenshot for that. You can also double check bundle identifiers for sandbox and production apps in the General section. Check below screenshot We can set the display name according to the sandbox and production app. Follow the steps below. Go To Build Setting -> Top left corner tap “+” icon. Add User-Defined Setting Add “App Name” in User-Defined Settings. We set “App_Name” in the “Display Name” of the General Section. After setting $(APP_NAME) as the display name then the display name looks like the below. Maintain sandbox and production app API base URL using build settings. So follow the below steps: Go To Build Setting -> Top left corner tap the “+” icon. Add User-Defined Setting Check the below screenshot on how to add baseurl. This “APP_BASE_URL” is set into an info.plist file as “BaseUrl” properties. “BaseUrl” property we will get into our code using the below line. You can set this variable as constant and use it anywhere in the whole project. Also Read: Latest guide on Xero oAuth 2.0 integration with Native iOS app using PKCEstatic let baseURL = Bundle.main.object(forInfoDictionaryKey: "BaseURL") as! String