All Products
Document Center

Switch iOS environment

Last Updated: Sep 23, 2021

During app development, the app environment (namely, workspace) may occasionally change, and the app may be developed in multiple workspaces in parallel. mPaaS provides a tool for you to conveniently switch among environments (workspaces) during development. There are two types of workspace switching modes:

  • Static workspace switching
  • Dynamic workspace switching

Static workspace switching

In static workspace switching, the default meta.config configuration file in the project is manually replaced on the client and then repackaged for access in a new workspace.

This mode applies only to a scenario where only the configuration information about the current workspace is updated.
  1. 1. Replace the meta.config file of the current project with the mPaaS plug-in.
  2. Delete and then reinstall the app and the new workspace configuration information takes effect immediately.

Dynamic workspace switching

In dynamic workspace switching, workspace options in mobile phone settings are modified to dynamically modify the app workspace information without repackaging on the client.

  • This mode applies to a scenario where an app is developed in multiple workspaces in parallel and is frequently switched among them in the development phase.
  • The dynamic workspace switching feature is only supported on Apsara Stack.

Restricted by the mPaaS security signature verification mechanism, updating workspace configuration information modifies the WSG signature verification image yw_1222.jpg. Therefore, dynamic workspace switching has two restrictions.

  • The dynamic workspace switching mode applies only to the development phase. Therefore, be sure to delete the corresponding configuration before the app is released.
  • Signature verification for network requests must be disabled in the mPaaS console. Otherwise, requests will fail due to incorrect signature verification image information.
  1. ![ ddd](

Workspace information configuration

  1. Enable dynamic workspace switching. Specifically, rewrite the enableSettingService method in category of MPaaSInterface and return YES.

    1. @implementation MPaaSInterface (Portal)
    2. - (BOOL)enableSettingService
    3. {
    4. return YES;
    5. }
    6. @end
  2. Download the workspace configuration file, and then add it to the project.


  3. Understand the workspace configuration information in Setting.bundle.

    • Setting.bundle provides four workspaces by default, corresponding to the 4 configuration files: Debug, Sit, Release, and Custom respectively.
    • Among them, Debug, Sit and Release are preset workspaces. You need to download the configuration files of the target workspaces from the mPaaS console. Rename them to Debug, Sit, and Release, and use them to replace the example files in the original Setting. bundle.


    • The Custom workspace applies to a scenario where repackaging is not performed on the client and app workspace information is directly configured in mobile phone settings. The configuration path on a mobile phone is Settings > Current app > Settings > Customizing. Enter the corresponding values based on the downloaded configuration information.

    • To preset more workspaces in addition to the default Debug, Sit, Release, and Custom workspaces, add a configuration item in Setting. bundle/Service. plist and add the corresponding configuration file. The format is as follows:


Dynamic workspace switching

  • After the Settings.bundle workspace configuration file is added, the app configuration information will overwrite the default meta.config file in the project, and the workspace selected in Settings.bundle prevails. The path for viewing the currently selected workspace is: Mobile phone Settings > mPaaS app > Settings > Category. The Sit workspace is selected by default.

  • To switch to another workspace, go to Mobile phone Settings > mPaaS app > Settings > Category and select the workspace. End the process and start it again for the new workspace to take effect.