A method and device suitable for environment switching debugging of APP

By creating test instances in APP development and combining environment switching variables with URL addresses, dynamic domain name control is achieved, which solves the problem of cumbersome code environment switching debugging steps and improves development efficiency and exception locating capabilities.

CN112597027BActive Publication Date: 2024-10-15上海高顿教育科技有限公司
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202011564112.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-25
Publication Date
2024-10-15
Estimated Expiration
2040-12-25

AI Technical Summary

Technical Problem

During the APP development process, the code environment switching and debugging steps are cumbersome, resulting in low code development efficiency for testers, and existing technology cannot effectively improve efficiency.

Method used

By creating test instances in multiple development environments, setting environment switching variables, and combining them with URL addresses, dynamic domain name control is achieved, and test instances are switched between multiple development environments.

Benefits of technology

It improves code development efficiency and team coordination efficiency, facilitates exception location and tracking, and simplifies the environment switching process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112597027B_ABST
    Figure CN112597027B_ABST
Patent Text Reader

Abstract

The present invention relates to a method for environment switching debugging of APP, which specifically includes the following steps: S1, creating test instances under multiple development environments based on APP development kit; S2, setting environment switching variables of the test instance according to the development environment corresponding to the test instance; S3, obtaining the URL address of the test instance, adjusting the environment switching variables, and combining with the URL address of the test instance to realize the switching of the test instance between multiple development environments. Compared with the prior art, the present invention has the advantages of improving code development efficiency and team cooperation efficiency, facilitating tracking of code anomalies, etc.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of application environment testing, and in particular to a method and device suitable for environment switching debugging of an APP. Background Art

[0002] In the process of APP development, it is generally developed in a test environment, and then it needs to be debugged in a pre-release environment or a production environment. At the same time, in the process of APP development, a lot of time needs to be spent on code compilation. After each environment switch, the corresponding code needs to be modified and the code needs to be compiled again for the code to take effect. For example: the current environment is a development environment. If you need to switch to a production environment, you need to manually modify the code, and then change the test environment to an online environment, and then compile the code. Only after completion can you debug and develop the code in the production environment. The above operations are very cumbersome, and during the development process, it takes a lot of time for testers to switch and debug the environment, resulting in low code development efficiency for testers.

[0003] The prior art CN201910372789.6 discloses a method for switching test environments on a mobile client. The method determines the adaptive startup operation for the APP based on the status of the environment variable information stored in the APP, and then obtains the current test environment information of the mobile client to determine the target test environment corresponding to the APP. However, the startup operation is required as a preprocessing step to obtain the test environment information. The process is time-consuming and cannot effectively improve the code development efficiency of testers. Summary of the invention

[0004] The purpose of the present invention is to overcome the defect of the above-mentioned prior art that the code environment switching debugging steps are cumbersome and lead to low code development efficiency, and to provide a method and device suitable for environment switching debugging of APP.

[0005] The purpose of the present invention can be achieved by the following technical solutions:

[0006] A method for debugging an APP environment switch, comprising the following steps:

[0007] S1. Create test instances in multiple development environments based on the APP development kit;

[0008] S2. Setting the environment switching variable of the test instance according to the development environment corresponding to the test instance;

[0009] S3. Obtain the URL address of the test instance, and switch the test instance between multiple development environments by adjusting the environment switching variable and combining it with the URL address of the test instance.

[0010] The development environment includes a test environment, a pre-release environment and a production environment.

[0011] Furthermore, the production environment includes an online environment.

[0012] Furthermore, the environment switching variable is combined with the URL address in step S3 by adding the environment switching variable to the front end of the URL address.

[0013] Furthermore, when the environment switching variable is added to the front end of the URL address, specifically, a character string corresponding to the environment switching variable is added to the front end of the URL address.

[0014] Furthermore, the character string corresponding to the environment switching variable corresponding to the test environment is t-.

[0015] Furthermore, the character string corresponding to the environment switching variable corresponding to the pre-release environment is pre-.

[0016] Furthermore, the character string corresponding to the environment switching variable corresponding to the production environment is an empty character string.

[0017] A device using the method for context switching debugging of an APP includes a memory and a processor. The method is stored in the memory and executed by the processor. The execution specifically includes the following steps:

[0018] S1. Create test instances in multiple development environments based on the APP development kit;

[0019] S2. Setting the environment switching variable of the test instance according to the development environment corresponding to the test instance;

[0020] S3. Obtain the URL address of the test instance, and switch the test instance between multiple development environments by adjusting the environment switching variable and combining it with the URL address of the test instance.

[0021] The memory is provided with local storage, and the APP development kit and environment switching variables are stored in the local memory. When the environment switching variable is successfully switched and saved, it will be saved in the local storage. When the next startup request is made, the local environment switching variable is obtained and then spliced ​​to the URL address.

[0022] Compared with the prior art, the present invention has the following beneficial effects:

[0023] 1. The present invention performs dynamic domain name control by combining environment switching variables with the URL address of the test instance. The development environment can be changed only by changing the character string of the environment switching variable, and the switching of the test development environment is dynamically realized, thereby improving the code development efficiency and team cooperation efficiency.

[0024] 2. Since the present invention changes the corresponding development environment by changing the character string of the environment switching variable, it is convenient to locate the same code exception after the environment is switched. For example, the code exception found in the production environment can still be accurately located after switching to the test environment, which is convenient for tracking the code exception. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 It is a schematic diagram of the process of the present invention;

[0026] Figure 2 Schematic diagram of the distribution of the development environment of the present invention. DETAILED DESCRIPTION

[0027] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.

[0028] Example

[0029] like Figure 1 As shown, a method for environment switching debugging of an APP specifically includes the following steps:

[0030] S1. Create test instances in multiple development environments based on the APP development kit;

[0031] S2. Setting the environment switching variable of the test instance according to the development environment corresponding to the test instance;

[0032] S3. Obtain the URL address of the test instance, and switch the test instance between multiple development environments by adjusting the environment switching variable and combining it with the URL address of the test instance.

[0033] The development environment includes the test environment, the staging environment, and the production environment.

[0034] The production environment includes the online environment.

[0035] The method of combining the environment switching variable with the URL address in step S3 specifically adds the environment switching variable to the front end of the URL address.

[0036] When the environment switching variable is added to the front end of the URL address, specifically, the character string corresponding to the environment switching variable is added to the front end of the URL address.

[0037] The string corresponding to the environment switch variable corresponding to the test environment is t-.

[0038] The string corresponding to the environment switch variable corresponding to the pre-release environment is pre-.

[0039] The string corresponding to the environment switch variable corresponding to the production environment is an empty string.

[0040] A device using a method for environment switching debugging for an APP includes a memory and a processor. The method is stored in the memory and executed by the processor. The execution specifically includes the following steps:

[0041] S1. Create test instances in multiple development environments based on the APP development kit;

[0042] S2. Setting the environment switching variable of the test instance according to the development environment corresponding to the test instance;

[0043] S3. Obtain the URL address of the test instance, and switch the test instance between multiple development environments by adjusting the environment switching variable and combining it with the URL address of the test instance.

[0044] The storage has local storage, and the APP development kit and environment switching variables are stored in the local storage. When the environment switching variable is successfully switched and click Save, it will be saved in the local storage. The next time the request is started, the local environment switching variable is obtained and then spliced ​​into the URL address.

[0045] like Figure 2 As shown, in this embodiment, an environment switching page is provided in the APP, and three radio buttons are arranged in the page. Each button corresponds to an environment setting, namely the test environment, the pre-release environment and the production environment. The operator first selects the required development environment on the environment switching page, obtains the corresponding environment switching variable, and then selects the URL address to be compiled. After the URL address selection is completed, the code development page under the corresponding development environment will be entered, which effectively improves the code development efficiency under different development environments.

[0046] In addition, it should be noted that the specific embodiments described in this specification may be named differently, and the above contents described in this specification are merely examples of the structure of the present invention. Any small or simple changes made based on the structure, features and principles of the present invention are included in the protection scope of the present invention. Those skilled in the art of the present invention may make various modifications or supplements to the specific examples described or adopt similar methods, as long as they do not deviate from the structure of the present invention or exceed the scope defined by the claims, they should all fall within the protection scope of the present invention.

Claims

1. A method for environment switching debugging of an APP, characterized in that: The specific steps include: S1. Create test instances in multiple development environments based on the APP development kit; S2. Setting the environment switching variable of the test instance according to the development environment corresponding to the test instance; S3, obtaining the URL address of the test instance, and implementing the switching of the test instance between multiple development environments by adjusting the environment switching variable and combining it with the URL address of the test instance; The development environment includes a test environment, a pre-release environment and a production environment; The method of combining the environment switching variable with the URL address in step S3 specifically adds the environment switching variable to the front end of the URL address; When the environment switching variable is added to the front end of the URL address, specifically, a character string corresponding to the environment switching variable is added to the front end of the URL address.

2. A method for environment switching debugging of an APP according to claim 1, characterized in that: The production environment includes an online environment.

3. A method for environment switching debugging of an APP according to claim 1, characterized in that: The character string corresponding to the environment switching variable corresponding to the test environment is t-.

4. A method for environment switching debugging of an APP according to claim 1, characterized in that: The character string corresponding to the environment switching variable corresponding to the pre-release environment is pre-.

5. A method for environment switching debugging of an APP according to claim 1, characterized in that: The character string corresponding to the environment switching variable corresponding to the production environment is an empty character string.

6. A device using the method for context switching debugging of an APP according to any one of claims 1 to 5, characterized in that: The method comprises a memory and a processor, wherein the method is stored in the memory and executed by the processor, and the execution specifically comprises the following steps: S1. Create test instances in multiple development environments based on the APP development kit; S2. Setting the environment switching variable of the test instance according to the development environment corresponding to the test instance; S3. Obtain the URL address of the test instance, and switch the test instance between multiple development environments by adjusting the environment switching variable and combining it with the URL address of the test instance.

7. A method for environment switching debugging of an APP according to claim 6, characterized in that: The memory is provided with local storage, and the APP development kit and environment switching variables are stored in the local storage.

Citation Information

Patent Citations

  • API testing method and device and electronic equipment

    CN107368420A

  • Test method and electronic device

    CN107402880A

  • Method for switching server addresses

    CN108153543A

  • Method for switching test environment of mobile phone client

    CN110333999A

  • Service environment switching method and computer readable storage medium

    CN111090452A