All Products
Search
Document Center

Switch iOS environment

Last Updated: Mar 22, 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.

Note: 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.
     sss
  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.

Note:
  • 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.

  • Applicable only to the development phase: 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](http://docs-aliyun.cn-hangzhou.oss.aliyun-inc.com/assets/pic/111262/AntCloud_zh/1552905359956/%E5%9B%BE%E7%89%874.png)

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 Settings.bundle.zip, and then add it to the project.

    aaa

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

    • Setting.bundle provides four workspaces by default, corresponding to the Debug, Sit, Release, and Custom 4 configuration files 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.

      Undefined

    • 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:

      ccc

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.