APP debugging method, device, computer equipment and storage medium
Through the design of separating the APP shell framework and the H5 program package, APP debugging on a custom server is realized, which solves the problems of low efficiency and inaccurate effect of traditional debugging methods, improves the simplicity and accuracy of debugging, and realizes front-end Diversified debugging of code.
Patent Information
- Application Number
- CN202010223292.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-03-26
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2040-03-26
AI Technical Summary
Traditional APP debugging methods are inefficient and cannot accurately simulate different terminal device environments, resulting in unsatisfactory debugging results. The debugging process is cumbersome and cannot achieve diversified debugging of front-end code.
Using a design that separates the APP shell framework from the H5 program package, the H5 program package is obtained through the preset URL address and loaded into the APP shell framework for debugging, thereby achieving front-end page rendering and debugging in a real environment.
It improves the simplicity, efficiency and accuracy of APP debugging. It can be debugged on a customized server to avoid inconsistent display effects caused by different device environments, realize diversified debugging of front-end code, and quickly locate and repair problems.
Smart Images

Figure CN111563032B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of APP development, and in particular to an APP debugging method, device, computer equipment and computer-readable storage medium. Background Art
[0002] With the development of front-end technology, in order to avoid the need for users to upgrade the APP when the APP is updated, H5 development has gradually replaced most of the native development content in traditional technology. However, as H5 does more things, the probability of problems also gradually increases, resulting in H5 debuggers needing to debug APPs involving APP development or APP repair every day.
[0003] In traditional technology, there are generally two ways to debug an APP: 1) The debugger simulates the server running code on his own computer and opens the page in the computer browser for debugging. That is, when debugging the front-end APP, the APP page is directly run through the computer browser to debug the APP. However, since the APP will run on various mobile phones and other terminal devices, and the mobile phone brands are different and the kernels used are different, the browser cannot accurately simulate the terminal devices such as smartphones from different developers, resulting in unsatisfactory results when debugging the APP. The effect of running in the computer browser is often quite different from the effect in the APP on the real machine. Sometimes the effect looks normal on the computer, but there is a problem on the mobile phone.
[0004] 2) Directly access the page on the APP for debugging. This page is deployed in a real production environment. Disadvantages of this solution: Inflexible. The debugger needs to deploy the code to the server every time it debugs the code, so that the APP can be changed dynamically.
[0005] Later, we ran the APP on the phone and debugged it through background logs and tools such as Charles. However, this debugging method is not only troublesome, but also focuses on the analysis of the backend interface part of the APP, and cannot be as diversified as browser debugging. In addition, since the front-end code involved in the APP is often deployed on different servers during development, testing and production, each server will have more or less inconsistencies, which makes it more troublesome to debug the front-end APP and reduces the efficiency of APP debugging. Summary of the invention
[0006] The embodiments of the present application provide an APP debugging method, apparatus, computer device, and computer-readable storage medium, which can solve the problem of low APP debugging efficiency in traditional technologies.
[0007] In the first aspect, an embodiment of the present application provides an APP debugging method, which is applied to a debugging terminal, wherein the debugging terminal is a computer device that applies the APP, and the APP is pre-developed as an APP shell framework and several H5 program packages, wherein the H5 program package is an independent unit for implementing the functions of the APP, and the APP shell framework implements the functions of the APP by loading the H5 program package. The method is applied to the APP shell framework, and the debugging terminal is configured with the APP shell framework. The method includes: obtaining the URL address corresponding to the H5 program package to be debugged in a preset manner; according to the URL address, loading the H5 program package from a preset server, and loading the H5 program package into the web page view in the APP shell framework; rendering the front-end page corresponding to the H5 program package through the web page view to debug the H5 program package to obtain the debugging result corresponding to the H5 program package.
[0008] In the second aspect, an embodiment of the present application also provides an APP debugging device, which is applied to a debugging terminal, wherein the debugging terminal is a computer device that applies the APP, and the APP is pre-developed as an APP shell framework and several H5 program packages, wherein the H5 program package is an independent unit for implementing the functions of the APP, and the APP shell framework implements the functions of the APP by loading the H5 program package. The device is applied to the APP shell framework, and the debugging terminal is configured with the APP shell framework. The device includes: an acquisition unit, which is used to acquire the URL address corresponding to the H5 program package to be debugged in a preset manner; a loading unit, which is used to load the H5 program package from a preset server according to the URL address, and load the H5 program package into the web page view in the APP shell framework; a debugging unit, which is used to render the front-end page corresponding to the H5 program package through the web page view to debug the H5 program package to obtain the debugging result corresponding to the H5 program package.
[0009] In a third aspect, an embodiment of the present application further provides a computer device, which includes a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the APP debugging method when executing the computer program.
[0010] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the APP debugging method.
[0011] The embodiments of the present application provide an APP debugging method, device, computer equipment and computer-readable storage medium. When the embodiments of the present application implement APP debugging, since the debugging terminal is a computer equipment that applies the APP, the debugger can customize the debugging terminal. After installing the APP on the debugging terminal, and since the H5 program package is downloaded separately, the debugger can store the H5 program package on a customized server to customize the debugging page through the URL address corresponding to the H5 program package, and connect the debugging terminal to the corresponding server through the URL address. After loading the H5 program package, the debugging page corresponding to the H5 program package is run through the debugging terminal to obtain the actual debugging effect of the H5 program package on the debugging terminal. Since the H5 package and server can be flexibly customized, and the debugging terminal is the real application environment corresponding to the use of the APP, running the APP in the debugging terminal to debug the APP can obtain real and accurate debugging effects. Compared with the traditional technology of debugging the APP front-end code through the browser, or debugging through the background log and Charles and other tools, facing a variety of terminal devices and various operating systems and resolutions and other application environments, it can realize the diversification of APP front-end code debugging, and can effectively avoid the problem of inconsistent APP front-end page display effects caused by different application environments corresponding to different machine devices. If there is a problem with the APP front-end code corresponding to the H5 package during the APP debugging process, the debugger can quickly locate the problem, which can improve the simplicity, efficiency and accuracy of APP debugging, and can improve the debugging efficiency of APP front-end code. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0013] Figure 1 A schematic diagram of an application scenario of an APP debugging method provided in an embodiment of the present application;
[0014] Figure 2 A schematic diagram of the structure of the APP provided in the embodiment of the present application;
[0015] Figure 3 A flowchart of an APP debugging method provided in an embodiment of the present application;
[0016] Figure 4 A schematic diagram of an interactive process of the APP debugging method provided in an embodiment of the present application;
[0017] Figure 5 A schematic block diagram of an APP debugging device provided in an embodiment of the present application; and
[0018] Figure 6 A schematic block diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0019] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0020] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0021] See also Figure 1 and Figure 2 , Figure 1 A schematic diagram of an application scenario of an APP debugging method provided in an embodiment of the present application, Figure 2 A schematic diagram of the structure of the APP provided in the embodiment of the present application. In the embodiment of the present application, the APP is pre-developed into an APP shell framework and several H5 program packages, the H5 program package is an independent unit for implementing the functions of the APP, the APP shell framework implements the functions of the APP by loading the H5 program package, the method is applied to the APP shell framework, and the APP shell framework is configured on the debugging terminal (that is, the APP is installed on the debugging terminal). Figure 2 As shown, the APP is pre-developed as an APP shell framework H and several H5 packages, that is, a complete APP includes an APP shell H, H5 package A, H5 package B, H5 package C, H5 package D and H5 package E. The APP shell H loads H5 package A, H5 package B, H5 package C, H5 package D and H5 package E to realize the complete APP function. Specifically, the APP includes the following two parts:
[0022] 1) APP shell. The APP shell mainly provides the following contents: (1) some system functions and invocation methods that cannot be directly invoked by H5 pages, such as system functions such as camera and GPS positioning, which can be called by H5 pages when needed; (2) a global Webview (referring to web view, also known as network view) window, which is used to load H5 pages and render them; (3) some preset debugging commands, which are triggered by a series of buttons (such as turning on debugging, automatic repair, etc.) to execute commands one by one to perform specific operations.
[0023] 2) H5 package. The H5 package is a development package corresponding to the independent units of the H5 parts contained in the APP divided according to preset rules. For example, the APP is divided into different H5 development packages according to the functions or modules of the APP. Figure 2 The APP includes H5 package A, H5 package B, H5 package C, H5 package D and H5 package E, and the H5 package can also be called H5 development package or H5 package. H5 packages can collaborate with each other by directly jumping to the page through the browser's location.href. Among them, the H5 package can be any number. When you need to debug which H5 package, just load the H5 package corresponding to the corresponding H5 page in the APP shell. After the APP is developed, the APP shell and the APP page framework structure will generally not change, that is, the framework content contained in the APP is fixed, and only the specific content contained in the H5 page corresponding to the H5 package will change. In the embodiment of the present application, the H5 page corresponding to the H5 package is deployed on the service provider's own backend server, instead of being reviewed by a third-party platform like the APP update. Therefore, when updating, you only need to update the H5 package corresponding to the H5 page of the service provider's own backend server, which will not affect the subsequent APP update.
[0024] Among them, the APP shell is only used to load each H5 application package (ie Figure 2 In the Android system and IOS system, if the H5 page needs to use the functions in the APP shell, the APP shell and the H5 page package can interact in their respective corresponding ways. For example, in the Android system, the APP shell and the H5 page package can interact through a bridge connection, such as Android JS bridge interaction. Android JS bridge interaction refers to the way Webview and JS interact in the Android system, using the connection bridge JsBridge for connection. In the IOS system, the IOS Webview interacts with JS, and the JavaScriptCore framework can be used for interaction.
[0025] like Figure 1As shown, the application scenarios include: (1) Server. It is used to store the downloaded files contained in the APP, including the APP installation file (essentially the APP shell) and the H5 program package. Different H5 program packages can be stored on different servers to achieve distributed storage of H5 program packages. For example, Figure 2 The H5 package A in is stored in Figure 1 On server 1, H5 package B and H5 package C are stored on server 2, H5 package D and H5 package E are stored on server 3, and so on. The server can be a server of the unit where the APP service provider is located. If the server is used to store the H5 package for debugging, it can also be a computer terminal such as a laptop or desktop computer used by the debugger. (2) Debug terminal. It can also be called a test terminal. It is a terminal device that installs the APP, simulates the usage environment in the production environment, and is used to test whether the APP runs normally, such as a terminal device such as a smart phone, tablet computer or smart watch that installs the APP. (3) Display terminal. A computer device used to display the debugging process and results of the APP, such as a laptop or desktop computer that is easy to display the debugging process and debugging results.
[0026] Figure 1 The working process of each subject in is as follows: 1) The debugging terminal downloads the APP from the server (what is actually downloaded in the embodiment of the present application is the APP shell) and installs the APP on the debugging terminal. 2) The debugging terminal receives the connection between the display terminal such as a computer and the corresponding browser debugging tool on itself, and authorizes the access to the display terminal and the APP. 3) After the debugging terminal opens the APP, the APP on the debugging terminal downloads the H5 program package to be debugged from the server (that is, the code corresponding to the front-end page of the APP), and runs the H5 program package to be debugged to debug the H5 program package, thereby displaying the front-end page corresponding to the APP in a simulated production environment. The debugging effect displayed at this time is the display effect corresponding to the actual page when accessing this page in the production environment, so as to determine whether the H5 display is normal and realize the debugging of the H5 program package. 4) The debugging terminal maps the debugging process of the H5 program package to the display terminal connected to the debugging terminal, so as to display the debugging results through the display terminal, so as to facilitate the debugging personnel to view the debugging results and modify the H5 program package.
[0027] It should be noted that Figure 1 The diagram only shows a smartphone as the debugging terminal and a laptop or desktop computer as the display front end. In actual operation, the terminal type is not limited to Figure 1As shown in, the terminal can also be an electronic device such as a smart watch, a laptop computer or a tablet computer. The application scenario of the above-mentioned APP debugging method is only used to illustrate the technical solution of the present application, and is not used to limit the technical solution of the present application. The above-mentioned connection relationship can also have other forms.
[0028] See also Figure 3 , Figure 3 It is a flowchart of the APP debugging method provided in the embodiment of the present application. The APP debugging method described in the embodiment of the present application is applied to the debugging terminal, which is a computer device that applies the APP. The debugging terminal includes a terminal device such as a smart phone, a tablet computer, and various wearable devices that install the APP for users to use the APP. It is specifically applied to the APP shell framework configured on the debugging terminal. The APP is installed on the debugging terminal. In the embodiment of the present application, what is actually installed is the APP shell framework. Figure 3 As shown, the method includes the following steps S301-S303:
[0029] S301. Obtain the URL address corresponding to the H5 program package to be debugged in a preset manner.
[0030] Among them, the preset method includes an automatic selection method or a method of receiving a user input address to obtain the URL address corresponding to the H5 package to be debugged. URL refers to Uniform Resource Locator, abbreviated as URL, also known as the website address, and the website address format is: <protocol>: / / <domain name or IP>:<port> / <path>, where <protocol>: / / <domain name or IP> is required, and the IP address is an IP address assigned to each host connected to the Internet. The IP address is used to uniquely identify the logical address of the computer on the Internet, and access between machines is carried out through the IP address. It can be seen that the URL contains the IP address.
[0031] Specifically, the debugging terminal downloads the APP from the server and installs the APP. The APP here refers to the APP shell. Since the APP is changed from its original self-contained content to an empty shell, the H5 program package on the corresponding server is automatically loaded after the server is determined according to the obtained URL address in the empty shell. Only the H5 program package needs to be published on the server, and there is no need to publish the entire APP. That is, the APP provides a system framework environment for the operation of the H5 program package, and all the H5 program packages required by the APP are handed over to the server for processing through separate loading. Among them, the debugging terminal, which can also be called a test terminal, refers to a computer device that tests whether the H5 program package contained in the APP is running normally. It can be a smart terminal, such as a smart phone, tablet computer or smart watch, etc., a terminal device that installs the APP.
[0032] Among them, obtaining the URL address corresponding to the H5 package to be debugged by automatic selection means that when debugging the APP, the local server address for downloading the H5 package can be automatically obtained by the debugging terminal. It can be done by accessing the current LAN active IP address when opening the APP, traversing the IP address, and sending a request to obtain a page for each IP address. If it can return normally, it means that this LAN IP has enabled local services. Finally, all IPs that have enabled local services are displayed on the debugging APP. The debugging personnel need to debug the H5 package on the server corresponding to which IP address, and the debugging terminal obtains the IP address corresponding to the H5 package to be debugged according to the IP address selected by the debugging personnel. For example, a group of server display lists can pop up when the debugging terminal opens the APP, and the debugging personnel selects the server, and the debugging terminal automatically locates to the front-end page corresponding to the H5 package on the server selected by the debugging personnel. The method of receiving the user input address refers to the debugging device receiving the IP address of the server where the H5 package to be debugged is located, which is directly input by the debugging personnel. Since only the H5 package for debugging needs to be downloaded and the server address corresponding to the H5 package is dynamically input, the H5 package can be set on different servers. The setting of the server where the H5 package is located is flexible and optional, which makes it easy to change the server. For example, a new server can be added to achieve server expansion, and the front-end code can be deployed to more distributed servers. The subsequent APP dynamically selects the server to be accessed according to the set IP address, which will not affect the debugging efficiency and will not bring burden to the debugger for APP debugging.
[0033] Since the APP shell needs to load the H5 package on the server according to the IP address of the server where the H5 page is located in order to access the page on the server, open and enter the APP on the debugging terminal, dynamically enter the URL address to be debugged, that is, the domain name and corresponding port of the server, and the APP dynamically selects the server to be accessed according to the input IP address and loads the corresponding H5 package of the server.
[0034] S302. According to the URL address, load the H5 program package from a preset server, and load the H5 program package into the web page view in the APP shell framework.
[0035] Specifically, since the URL contains the IP address corresponding to the server where the H5 program package is located, after the debugging terminal obtains the URL corresponding to the H5 program package to be debugged, it parses the URL, parses the IP address from the URL, and loads the H5 program package from the server corresponding to the IP address according to the IP address, and loads the H5 program package into the web page view in the APP shell frame, so that the web page view further parses the H5 program package and renders the H5 program package. The process of rendering the H5 program package is the process of debugging the H5 program package, so as to display the web page corresponding to the H5 program package, thereby realizing the debugging of the H5 program package.
[0036] Furthermore, the step of loading the H5 program package from a preset server according to the URL address and loading the H5 program package into the web page view in the APP shell framework includes:
[0037] Receive an opening instruction to open the APP; according to the opening instruction, obtain a first URL corresponding to the homepage of the APP; according to the first URL, load a first H5 program package corresponding to the homepage from a first preset server; load the first H5 program package into a web view in the APP shell frame to identify a second URL contained in the first H5 program package; according to the second URL, load a second H5 program package from a second preset server; load the second H5 program package into the web view to identify a third URL contained in the second H5 program package; according to the third URL, load a third H5 program package from a third preset server, and load the third H5 program package into the web view; iterate the step of identifying the second URL contained in the first H5 program package, and iterate the step of identifying the third URL contained in the second H5 program package, until all URLs contained in the first H5 program package are identified and all URLs contained in the second H5 program package are identified.
[0038] Specifically, since any APP application containing H5 starts from the homepage and jumps to the sub-pages contained in the homepage through various links, the debugging of the H5 package can start from the homepage of the H5 package, load the server corresponding to the H5 development package homepage, and then continuously identify the URLs in the page for subsequent page debugging until all URLs in the page are identified and loaded and debugged in the order of identification. That is, the debugging terminal receives an opening instruction to open the APP, obtains a first URL corresponding to the homepage of the APP according to the opening instruction, loads a first H5 program package corresponding to the homepage from a first preset server according to the first URL, and loads the first H5 program package into the web view in the APP shell frame to identify the second URL contained in the first H5 program package, and loads the second H5 program package from the second preset server according to the second URL; loads the second H5 program package into the web view to identify the third URL contained in the second H5 program package, and loads the third H5 program package from the third preset server according to the third URL, and loads the third H5 program package into the web view, iterates the step of identifying the second URL contained in the first H5 program package, and iterates the step of identifying the third URL contained in the second H5 program package, until all URLs contained in the first H5 program package and all URLs contained in the second H5 package are identified.
[0039] S303: Rendering the front-end page corresponding to the H5 program package through the web page view to debug the H5 program package and obtain the debugging result corresponding to the H5 program package.
[0040] Among them, the web view, also known as the network view in English, can load and display web pages. It can be regarded as a browser, which is mainly used to display the content after the network request, that is, to display the content of the network address request in it.
[0041] Specifically, when developing an APP, the APP shell framework corresponding to the development APP can be installed separately and includes some system functions, for example, the APP shell framework includes a web view to display each page in the APP through the web view. After the debugging terminal opens the APP, according to the obtained URL address, the H5 program package (i.e., the front-end code) to be debugged is loaded and downloaded from the corresponding preset server, and the H5 program package is loaded into the web view, which is included in the APP shell framework, and the front-end code to be debugged is run to debug the front-end code to be debugged. In the embodiment of the present application, since the APP is changed from its original built-in content to an empty shell, the H5 program package is loaded from the server corresponding to the IP address in the empty shell according to the IP address contained in the received URL, that is, the APP only provides a framework environment for the operation of the H5 program package, and the implementation of other content in the APP is all handled by the server through loading. Therefore, in traditional technology, the Webview is opened to render the front-end page when the APP is opened, while in the embodiment of the present application, the server address is dynamically obtained according to the selected or input server IP, and then the H5 program package on the server is loaded into the Webview, and then the front-end page corresponding to the H5 program package is rendered. Here, the APP shell loads the H5 application mainly by putting the address of the H5 application into the Webview in the APP shell, so that the page can be automatically opened and rendered. The process of web page rendering generally includes: inputting the H5 package into the HTML parser, parsing by the HTML parser, and then building a DOM tree. During this period, if JavaScript code is encountered, it is handed over to the JavaScript engine for processing; if the style information comes from the CSS parser, an internal drawing model is built, and the layout module calculates the position and size information of each element inside the model. Finally, the drawing module completes the drawing from the model to the image, completes the web page rendering, and displays the rendering result, so as to render the front-end page corresponding to the H5 package through the web page view to debug the H5 package, so as to obtain the debugging result corresponding to the H5 package and realize the debugging of the APP.
[0042] When implementing APP debugging in the embodiment of the present application, since the debugging terminal is a computer device that applies the APP, the debugger can customize the debugging terminal. After installing the APP on the debugging terminal, and since the H5 program package is downloaded separately, the debugger can store the H5 program package on a customized server to customize the debugging page through the URL address corresponding to the H5 program package, and connect the debugging terminal to the corresponding server through the URL address. After loading the H5 program package, the debugging page corresponding to the H5 program package is run through the debugging terminal to obtain the actual debugging effect of the H5 program package on the debugging terminal. Since the H5 package and server can be flexibly customized, and the debugging terminal is the real application environment corresponding to the use of the APP, running the APP in the debugging terminal to debug the APP can obtain real and accurate debugging effects. Compared with the traditional technology of debugging the APP front-end code through the browser, or debugging through the background log and Charles and other tools, facing a variety of terminal devices and various operating systems and resolutions and other application environments, it can realize the diversification of APP front-end code debugging, and can effectively avoid the problem of inconsistent APP front-end page display effects caused by different application environments corresponding to different machine devices. If there is a problem with the APP front-end code corresponding to the H5 package during the APP debugging process, the debugger can quickly locate the problem, which can improve the simplicity, efficiency and accuracy of APP debugging, and can improve the debugging efficiency of APP front-end code.
[0043] In one embodiment, the application environment corresponding to the APP debugging method also includes a display terminal, and the display terminal is used to display the debugging of the APP on the debugging terminal by mapping. The display terminal is a computer device that displays the debugging process and debugging results of the APP on the debugging terminal by mapping, and the errors in the debugging results can be modified by the display terminal. The display terminal includes a desktop computer or a laptop computer. Before the step of rendering the front-end page corresponding to the H5 program package through the web page view, it also includes:
[0044] receiving a connection request from the display terminal;
[0045] Performing connection authorization on the connection request to establish a connection with the display terminal;
[0046] After the step of rendering the front-end page corresponding to the H5 program package through the web page view, the method further includes:
[0047] The debugging process of debugging the H5 program package is mapped to the display terminal connected to itself, so as to display the debugging result through the display terminal.
[0048] Specifically, since the code that needs to be debugged will exist in two types of servers, one is the company's server, and the other is the debugger's own local server (the local server refers to the server when the debugger's own computer is used as the server, and the code that needs to be run is stored on his own computer, so that the debugging terminal can download the code from his own computer and run the process is called local server operation). When the server is a local server, the debugging process on the debugging terminal can be mapped to the display terminal corresponding to the debugger's local computer. At this time, the display terminal includes a computer device used by the debugger, such as a laptop or desktop computer. When the local server is turned on, the H5 page on the local server is loaded through the APP shell for debugging. At this time, mapping the debugging information to the computer will make it easier for the debugger to view the debugging results and locate and modify the problems in the debugging, which can shorten the debugging process, thereby improving the debugging efficiency of the APP. If it is a company server, no mapping is required and it can be displayed directly on the debugging terminal.
[0049] Further, the display terminal is connected to the debugging terminal through a data cable or other means. For example, a display terminal such as a desktop computer accesses the APP through a data cable, and the browser on the debugger's computer accesses the corresponding browser debugging tool on the debugging terminal to connect to the APP on the debugging terminal. The debugging terminal receives the connection request of the display terminal and authorizes the connection request to establish a connection with the display terminal. That is, after the debugging terminal receives the connection request of the display terminal, it pre-authorizes the access rights of the APP on the debugging terminal. It can be authorized by receiving an operation instruction of manually clicking to agree to the authorization, or it can be automatically authorized by setting an authorization whitelist, including requiring the debugging terminal to grant access rights to the display terminal and the APP to grant access rights to the debugging terminal. Only after the two rights are granted, the debugging terminal can establish a connection with the display terminal, the debugger's computer can directly access the page in the APP, and the debugging terminal can map the debugging process of debugging the H5 program package to the display terminal that is in a connected state with itself, and then display the debugging results through the display terminal. For example, when a smartphone is connected to a computer via a data cable, an Android phone uses the Chrome device manager to access the access device, and an IOS phone uses Safari's developer mode to identify the access device.
[0050] In one embodiment, the step of performing connection authorization on the connection request to establish a connection with the display terminal includes:
[0051] According to the connection request, obtaining a device identification of a computer device to which the display terminal belongs;
[0052] Determine whether the device identifier is included in a preset authorization whitelist;
[0053] If the device identification is included in the preset authorization whitelist, it is permitted to establish a connection with the display terminal.
[0054] Specifically, an APP authorization whitelist can be set in advance in the debugging terminal, and the device identification corresponding to the display terminal that is allowed to connect can be set in the APP authorization whitelist. After the debugging terminal receives the connection request, it obtains the device identification of the computer device to which the display terminal belongs according to the connection request, and determines whether the device identification is included in the preset authorization whitelist. If the device identification is included in the preset authorization whitelist, the debugging terminal is allowed to establish a connection with the display terminal. If the device identification is not included in the preset authorization whitelist, the debugging terminal is refused to establish a connection with the display terminal. For example, the serial number of the computer device corresponding to the display terminal is added to the APP authorization whitelist configuration file. If the serial number of the computer device corresponding to the display terminal is in the APP authorization whitelist, the display terminal is allowed to establish a connection with the debugging terminal to achieve automatic authorization. And after configuring the APP authorization whitelist, there is no need to re-authorize the download of the APP on the debugging terminal.
[0055] See also Figure 4 , Figure 4 An interactive flow diagram of the APP debugging method provided in an embodiment of the present application. Figure 4 When debugging an APP, the execution subjects are mainly the APP on the debugging terminal and the browser on the display terminal. Figure 4 As shown, the debugging process of the front-end code in the APP under the dynamic server is as follows:
[0056] 1) On the debugging terminal, download the APP installation file that needs to be debugged from the server. Here, the APP refers to the APP shell in the embodiment of the present application. 2) Install the APP on the debugging terminal. 3) Receive the connection of the display terminal and grant the display terminal access rights, that is, receive the display terminal connected via a data cable, connect to the browser of the display terminal, and authorize the display terminal to access the APP. When accessing the APP via a data cable, it is necessary to authorize the debugging terminal first, so first authorize the APP access rights on the debugging terminal, and then connect the debugging terminal to the computer via a data cable. Android phones use Chrome's device manager to access the access device, and IOS phones use Safari's developer mode to identify the access device. 4) Open and enter the APP. 5) The debugging tool on the display terminal automatically identifies the APP on the connected debugging terminal, so that the APP debugging process and debugging results can be displayed through mapping. 6) Receive the debugging interface opening instruction, receive the address of the page you want to open, and jump to the page in the APP. You can dynamically input the server domain name and corresponding port that needs to be debugged. The APP dynamically selects the server to be accessed based on the input content and loads the server's corresponding H5 development kit homepage. You can open the browser debugging tool corresponding to Android or IOS, find the debugging device, and jump directly to the page that needs to be debugged through location.href. 7) The debugging terminal downloads the H5 program package corresponding to the page address from the server corresponding to the obtained URL address. 8) Render the downloaded H5 program package to open the page, that is, open the page you want to open for debugging, render the page to open the page, and the process of displaying the page is the debugging process. 9) The debugging process is mapped to the display terminal via a data cable connection. 10) The debugging results are displayed through the debugging tool integrated in the browser on the display terminal.
[0057] In the embodiment of the present application, the method of using the APP on the debugging terminal to access the actual page and using the browser on the display terminal for debugging can effectively avoid the problem of inconsistent front-end page display effects caused by machine hardware reasons. At the same time, it can also fully retain the convenience brought by browser debugging, so that debuggers can quickly locate the problem, find out the cause and repair it, improve the timeliness of problem repair, avoid wasting too much time in finding the problem, shorten the debugging process, and improve debugging efficiency.
[0058] In one embodiment, the step of loading the H5 program package from a preset server according to the URL address includes:
[0059] According to the URL address, the H5 program package is loaded from the server included in the preset server cluster.
[0060] Specifically, since only the H5 program package for debugging needs to be downloaded and the server address corresponding to the H5 program package is dynamically input, the setting of the server where the H5 program package is located is flexible and optional. Multiple H5 program packages can be set on different servers, thereby realizing the distributed deployment of the H5 program package in the server cluster. When downloading the H5 program package, the H5 program package is loaded from the server included in the preset server cluster according to the URL address.
[0061] Furthermore, the server cluster may be modified, including changing servers and adding new servers, to achieve flexible deployment of H5 program packages, thereby improving the convenience and efficiency of APP debugging.
[0062] Furthermore, the step of loading the H5 program package from the preset server includes:
[0063] Load the H5 program package from the newly added server.
[0064] Specifically, since only the H5 program package for debugging needs to be downloaded and the server address corresponding to the H5 program package is dynamically input, changing the server address corresponding to the H5 program package will not affect the debugging of the APP. The H5 program package can be set on any server. For example, the H5 program package can be set on a newly added server, and the APP loads the H5 program package from the newly added server.
[0065] Furthermore, the newly added server can be included in the preset server cluster, that is, the H5 package is loaded from the newly added server included in the preset server cluster. For example, the H5 package is distributedly deployed in the server cluster, and a new server is added to the server cluster. The H5 package to be debugged is deployed on the newly added server included in the server cluster to achieve the expansion of the server cluster without affecting the debugging of the APP. Therefore, the H5 package can be downloaded from the newly added server according to actual needs, that is, the H5 package is loaded from the newly added server included in the preset server cluster. When debugging the H5 package on the new server, it is only necessary to fill in the newly added server domain name and port in the APP for debugging. Due to the flexibility of server selection, the efficiency of APP debugging can be improved.
[0066] In one embodiment, the step of loading the H5 program package from a preset server includes:
[0067] The H5 program package is loaded from a local server, where the local server is a server used by a computer device used by the debugger himself, and the local server includes a desktop computer or a laptop computer.
[0068] Specifically, when debugging an APP, the server storing the H5 package can be the company's server, or the computer device used by the debugger himself can be used as the server. The computer device used by the debugger himself can be called a local server relative to the company's server. The H5 package is loaded from the preset server, that is, the H5 package is loaded from the computer device used by the debugger himself. Among them, the local server refers to a server environment built on the debugger's own computer. The H5 package corresponding to the H5 page code is placed in this server. Accessing the page address on this server through the browser address on the computer adapted by the debugger himself is called accessing the local server, thereby achieving the convenience of debugging by utilizing the debugger's local server and avoiding the inaccurate debugging caused by the difference between the computer browser and the APP in the real production environment, thereby improving the accuracy, convenience and efficiency of APP debugging.
[0069] Furthermore, the local server may be a server in a preset server cluster, that is, the local server is included in the preset server cluster, or the local server may be a newly added server, that is, the newly added server is the local server, or the local server is a server in the preset server cluster and is also a newly added server, that is, a local server is newly added to the preset server cluster, that is, the local server is a newly added server included in the preset server cluster.
[0070] In one embodiment, the computer device corresponding to the display terminal and the local server are the same computer device.
[0071] Specifically, the debugger uses the computer he uses as a server to store the H5 program package and as a display terminal to display the debugging process and debugging results mapped from the debugging terminal, so that it is convenient for the debugger to locate the problems in the debugging process and to modify the problems in the debugging process, thereby improving the debugging efficiency. In the traditional APP debugging process, the debugger uses his own computer as a server and accesses the APP through the browser on his own computer. The browser on the computer also provides a mobile page debugging tool, but the computer is not a mobile phone after all. The application in the APP is debugged through the browser on the computer. Compared with debugging on a real mobile phone or other test machine, there is a big difference. In addition, the browser kernel versions used by mobile phones of different merchants will be different, and these differences will cause errors when the APP is running in terminals under various production environments. Therefore, directly debugging the APP through the browser on the computer cannot reflect the actual effect of the APP in the production environment. It is necessary to debug the H5 program package corresponding to the APP page on the real machine corresponding to the production environment to ensure the good compatibility of the APP page in the production environment. In the embodiment of the present application, since the APP running process is on the debugging terminal and the debugging terminal is loaded with the code of the local server, by utilizing the feature that the same browser can access each other across platforms, the debugging terminal and the computer used as the local server are connected through a data cable, and the debugging process corresponding to the APP running effect on the debugging terminal is mapped to the computer through the same browser. For example, Chrome on an Android phone and Chrome on a Window computer are connected through a data cable, so that the effect on the Android phone can be seen on the computer (similar to an extended screen), so that the actual page corresponding to the H5 program package can be accessed by using the APP and debugging can be performed using the browser on the computer.
[0072] Further, when the H5 page is rendered in the APP shell, it can be considered that the download is complete, and before the debugging is automatically executed, the command operation button loaded in the APP shell is triggered, so as to automatically debug, and the debugging process is mapped to a display terminal such as a laptop or desktop computer to display the debugging results. For example, you can open the browser debugging tool corresponding to Android or IOS, find the identification device, and jump directly to the page that needs to be debugged through location.href. The debugging process is to automatically debug on a smart phone through a series of instructions defined in the APP shell. Among them, debugging refers to opening each page to determine whether there is an error. When executing the page, the JavascrURLt code of the page will actually be executed. If an exception occurs during the execution of the Js code, the browser will automatically throw an exception. The exception information carries a series of information such as the error type and location). When an exception occurs, it is considered that the page has an error, thereby realizing the convenience of using the local server, using the APP on the hardware device corresponding to the real debugging terminal to access the actual page, and using the browser on the display terminal such as a desktop computer to debug and display, to complete the debugging of the APP, which can improve the efficiency of APP debugging. Among them, the convenience of the local server is that the local server runs the code on the debugger's own computer. After the debugger modifies the code, it can be quickly updated to the server, which is very convenient. At this time, it has little to do with the computer browser. The actual page is still running in the mobile phone APP. It is just that the actual running effect on the debugging terminal is mapped through the computer browser. Moreover, this method of using APP to access the actual page and using the browser for debugging, that is, the APP shell loads the page, and uses the browser mapping to clearly map the debugging process to the computer. Analyzing and debugging can effectively avoid the problem of inconsistent display effects of the front-end page caused by machine hardware reasons. At the same time, through the debugging method of the front-end code in the APP of the embodiment of the present application under the dynamic server, it is easy to find the differences in different production environments, and repair the problems in the H5 program package, so that the H5 program package is compatible with various models, and the convenience brought by browser debugging can be completely retained, so that the debugger can quickly locate the problem, find out the cause and repair it, and achieve the timeliness of problem repair, solve the debugger The problem is difficult to locate the problem, the location is inaccurate, and the problem is slow to handle. A series of problems, avoid wasting too much time in finding problems, and improve the debugging efficiency and development efficiency of the APP.
[0073] In the embodiment of the present application, the APP is downloaded from the server through the debugging terminal, and the APP is installed on the debugging terminal. The debugging terminal receives the connection of the display terminal such as a computer through the browser debugging tool corresponding to the debugging terminal, and authorizes the display terminal and the APP to access. After the debugging terminal opens the APP, the APP on the debugging terminal downloads the front-end code to be debugged from the server corresponding to the obtained URL address, and the server can be flexibly set as needed. The server can be one of multiple servers and can be expanded, and the front-end code to be debugged is run to debug the front-end code to be debugged, so as to access the actual page through the APP. The debugging terminal maps the debugging process of the H5 program package to the display terminal such as a laptop or desktop computer connected to the debugging terminal, so as to display the debugging result through the display terminal, and realizes the use of the APP on the debugging terminal to access the actual page, and uses the browser on the display terminal such as the desktop computer for debugging and displaying, which can effectively avoid the problem of inconsistent display effect of the front-end page caused by the hardware of the machine, and at the same time can fully retain the convenience brought by browser debugging, so that the debugger can quickly locate the problem and improve the debugging efficiency of the APP front-end code.
[0074] In one embodiment, after the step of rendering the front-end page corresponding to the H5 program package through the web page view to debug the H5 program package to obtain the debugging result corresponding to the H5 program package, it also includes:
[0075] Determine whether the debugging result contains an exception;
[0076] If the debugging result contains an exception, the exception is captured by a preset global exception capture function;
[0077] Repair the exception by using a preset repair function to complete the update of the H5 program package, and execute the step of loading the H5 program package from the local server;
[0078] The step of determining whether the debugging result contains an exception is iterated until the debugging result contains no exception.
[0079] Specifically, after the H5 package is downloaded from the server, the APP on the debugging terminal automatically opens each page contained in the H5 package for debugging. Since the front-end page interaction is handled by events, debugging can read various events in the page through algorithms, such as the Click event of clicking and the Focus event of getting focus, etc., and execute all events in a loop to automatically debug the entire H5 package. At the same time, it is determined whether there is an exception in each page contained in the H5 package. If there is an exception, the error and other exceptions are thrown to the preset global exception handling function. The global exception handling function reads the code contained in the H5 package again according to the exception, reads the exception position code corresponding to the exception in the H5 package, and rewrites the code corresponding to the exception position according to the exception type reported by the exception position code, so as to repair the exception. For example, when executing a method corresponding to an event, if an error occurs, the error is thrown to the global error handling function. After capturing the error data, the error handling function will sort out the error information, and then automatically solve the error, or remind the debugger to manually solve the error. If it is manually solved, the exception handling function skips this exception, and the debugger modifies the error in the code by himself. If it is an automatic repair, use the exception handling method defined in the exception handling function to repair the exception. For example, if the reported error is that a certain parameter is undefined, just write this parameter directly in the code segment.
[0080] Furthermore, if the server is a local server, and the computer device corresponding to the display terminal and the local server are the same computer device, since the server is the local computer device of the debugger himself during the debugging process, it is convenient for the debugger to control the debugging, and add a global error capture and repair function to the local code (the local code refers to the code that starts the server running on the debugger's own computer. The capture and repair function is actually the split of the exception handling function. The exception handling must first capture the exception and then repair the exception), and then use the task script to execute each page. Since the browser will simply throw an exception when it finds an error, to handle these exceptions, a global capture function is required to capture the exception information. When an error occurs, it is analyzed in the global error capture method to obtain where the exception occurred in the front-end code and what the exception is, so as to do further exception handling and deliver the analysis results to the repair function. The repair function directly writes the code patch in the source code to repair the exception. For example, now there is an error in the H5 page that a certain variable is undefined. At this time, the browser will throw an exception and say which line of the code has what exception. At this time, the global error capture method receives the error and sorts out the error information. It is assumed that the variable a in the third line is undefined, and this message is passed to the repair function. The repair function allows the debugger to choose manual repair or automatic repair. In the case of manual repair, the debugger will repair the code modification himself. The automatic repair APP can directly check the definition of a variable in the line before the error code to repair this exception. Since the debugger's own computer is used as a server at this time, the code running in the APP is the code on the debugger's own computer. At this time, it is very fast to modify the code and then run the modified code. After the code is modified, the server hot update will automatically render the modified new code. The embodiment of the present application uses the debugger's own computer as a server and display terminal, which can not only realize the rapid repair of the code through the local server, but also simulate the real operating environment of the APP, and display the debugging results of the debugging process through the browser debugging tool on the display terminal, realizing efficient and accurate debugging of the front-end code in the APP under the dynamic server, solving the problems of difficult positioning of the debugger, inaccurate positioning and slow problem handling, and effectively improving the overall development and repair efficiency of the APP.
[0081] It should be noted that the APP debugging method described in the above embodiments can recombine the technical features contained in different embodiments as needed to obtain a combined implementation plan, but all of them are within the scope of protection required by this application.
[0082] See also Figure 5 , Figure 5A schematic block diagram of an APP debugging device provided in an embodiment of the present application. Corresponding to the above APP debugging method, an embodiment of the present application also provides an APP debugging device, which is applied to a debugging terminal, wherein the debugging terminal is a computer device that applies the APP, and the APP is pre-developed as an APP shell framework and a plurality of H5 program packages, wherein the H5 program package is an independent unit that implements the APP function, and the APP shell framework implements the APP function by loading the H5 program package, and the device is applied to the APP shell framework, and the debugging terminal is configured with the APP shell framework, such as Figure 5 As shown, the APP debugging device includes a unit for executing the above APP debugging method, and the device can be configured in a computer device corresponding to a debugging terminal such as a smart phone. Figure 5 The APP debugging device 500 includes an acquisition unit 501, a loading unit 502 and a debugging unit 503.
[0083] The acquisition unit 501 is used to acquire the URL address corresponding to the H5 program package to be debugged in a preset manner;
[0084] A loading unit 502 is used to load the H5 program package from a preset server according to the URL address, and load the H5 program package into a web page view in the APP shell framework;
[0085] The debugging unit 503 is used to render the front-end page corresponding to the H5 program package through the web page view to debug the H5 program package and obtain the debugging result corresponding to the H5 program package.
[0086] In one embodiment, the application environment corresponding to the APP debugging method also includes a display terminal, and the display terminal is used to display the debugging of the APP on the debugging terminal in a mapping manner. The APP debugging device 500 also includes:
[0087] A receiving unit, configured to receive a connection request from the display terminal;
[0088] an authorization unit, configured to perform connection authorization on the connection request to establish a connection with the display terminal;
[0089] The mapping unit is used to map the debugging process of the H5 program package to the display terminal connected to itself, so as to display the debugging result through the display terminal.
[0090] In one embodiment, the authorization unit includes:
[0091] A first acquisition subunit is used to acquire a device identification of a computer device to which the display terminal belongs according to the connection request;
[0092] A determination subunit, used to determine whether the device identification is included in a preset authorization whitelist;
[0093] The permission subunit is used to permit the establishment of a connection with the display terminal if the device identification is included in the preset authorization whitelist.
[0094] In one embodiment, the loading unit 502 includes:
[0095] A receiving subunit, used to receive an opening instruction to open the APP;
[0096] A second acquisition subunit is used to acquire a first URL corresponding to the homepage of the APP according to the opening instruction;
[0097] A first loading subunit, configured to load a first H5 program package corresponding to the homepage from a first preset server according to the first URL;
[0098] A first loading subunit, used to load the first H5 program package into the web page view in the APP shell frame to identify the second URL included in the first H5 program package;
[0099] A second loading subunit, configured to load a second H5 program package from a second preset server according to the second URL;
[0100] A second loading subunit, used for loading the second H5 program package into the web page view to identify a third URL included in the second H5 program package;
[0101] A third loading subunit is used to load a third H5 program package from a third preset server according to the third URL, and load the third H5 program package into the web page view;
[0102] An iterative subunit is used to iterate the step of identifying the second URL contained in the first H5 program package, and iterate the step of identifying the third URL contained in the second H5 program package, until all URLs contained in the first H5 program package and all URLs contained in the second H5 program package are identified.
[0103] In one embodiment, the APP debugging device 500 further includes:
[0104] A judging unit, used to judge whether the debugging result contains an abnormality;
[0105] A capture unit, configured to capture the exception by using a preset global exception capture function if the debugging result contains an exception;
[0106] A repair unit, used to repair the exception by using a preset repair function to complete the update of the H5 program package, and execute the step of loading the H5 program package from the local server;
[0107] The iterative unit is used to iterate the step of determining whether the debugging result contains an exception until the debugging result does not contain an exception.
[0108] It should be noted that those skilled in the art can clearly understand that the specific implementation process of the above-mentioned APP debugging device and each unit can refer to the corresponding description in the aforementioned method embodiment, and for the convenience and conciseness of the description, it will not be repeated here.
[0109] At the same time, the division and connection method of each unit in the above-mentioned APP debugging device is only for illustration. In other embodiments, the APP debugging device can be divided into different units as needed, and the units in the APP debugging device can also adopt different connection orders and methods to complete all or part of the functions of the above-mentioned APP debugging device.
[0110] The above-mentioned APP debugging device can be implemented in the form of a computer program, which can be used in Figure 6 Runs on the computer device shown.
[0111] See also Figure 6 , Figure 6 600 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device 600 may be a computer device such as a desktop computer or a server, or may be a component or part in other devices.
[0112] See also Figure 6 The computer device 600 includes a processor 602 , a memory and a network interface 605 connected via a system bus 601 , wherein the memory may include a non-volatile storage medium 603 and an internal memory 604 .
[0113] The non-volatile storage medium 603 can store an operating system 6031 and a computer program 6032. When the computer program 6032 is executed, the processor 602 can execute the above-mentioned APP debugging method.
[0114] The processor 602 is used to provide computing and control capabilities to support the operation of the entire computer device 600 .
[0115] The internal memory 604 provides an environment for the operation of the computer program 6032 in the non-volatile storage medium 603. When the computer program 6032 is executed by the processor 602, the processor 602 can execute the above-mentioned APP debugging method.
[0116] The network interface 605 is used to communicate with other devices over the network. Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the present application solution, and does not constitute a limitation on the computer device 600 to which the present application solution is applied. The specific computer device 600 may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components. For example, in some embodiments, the computer device may only include a memory and a processor. In such an embodiment, the structure and function of the memory and the processor are the same as those of the present application solution. Figure 6 The embodiments shown are consistent and will not be described again here.
[0117] Among them, the APP is pre-developed as an APP shell framework and several H5 program packages, the H5 program package is an independent unit for realizing the functions of the APP, and the APP shell framework realizes the functions of the APP by loading the H5 program package. The processor 602 is used to run the computer program 6032 stored in the memory to implement the following steps: obtaining the URL address corresponding to the H5 program package to be debugged in a preset manner; according to the URL address, loading the H5 program package from a preset server, and loading the H5 program package into the web page view in the APP shell framework; rendering the front-end page corresponding to the H5 program package through the web page view to debug the H5 program package to obtain the debugging result corresponding to the H5 program package.
[0118] In one embodiment, the application environment corresponding to the APP debugging also includes a display terminal, and the display terminal is used to display the debugging of the APP through a mapping method. Before implementing the step of rendering the front-end page corresponding to the H5 program package through the web page view, the processor 602 further implements the following steps:
[0119] receiving a connection request from the display terminal;
[0120] Performing connection authorization on the connection request to establish a connection with the display terminal;
[0121] After implementing the step of rendering the front-end page corresponding to the H5 program package through the web page view, the processor 602 further implements the following steps:
[0122] The debugging process of debugging the H5 program package is mapped to the display terminal connected to itself, so as to display the debugging result through the display terminal.
[0123] In one embodiment, when the processor 602 implements the step of authorizing the connection request to establish a connection with the display terminal, the processor 602 specifically implements the following steps:
[0124] According to the connection request, the device identification of the computer device to which the display terminal belongs is obtained; it is determined whether the device identification is included in the preset authorization whitelist; if the device identification is included in the preset authorization whitelist, a connection is established with the display terminal.
[0125] In one embodiment, when the processor 602 implements the step of loading the H5 program package from the preset server according to the URL address and loading the H5 program package into the web page view in the APP shell framework, the following steps are specifically implemented:
[0126] Receive an opening instruction to open the APP; according to the opening instruction, obtain a first URL corresponding to the homepage of the APP; according to the first URL, load a first H5 program package corresponding to the homepage from a first preset server; load the first H5 program package into a web view in the APP shell frame to identify a second URL contained in the first H5 program package; according to the second URL, load a second H5 program package from a second preset server; load the second H5 program package into the web view to identify a third URL contained in the second H5 program package; according to the third URL, load a third H5 program package from a third preset server, and load the third H5 program package into the web view; iterate the step of identifying the second URL contained in the first H5 program package, and iterate the step of identifying the third URL contained in the second H5 program package, until all URLs contained in the first H5 program package are identified and all URLs contained in the second H5 program package are identified.
[0127] In one embodiment, after implementing the step of rendering the front-end page corresponding to the H5 program package through the web page view to debug the H5 program package to obtain the debugging result corresponding to the H5 program package, the processor 602 further implements the following steps:
[0128] Determine whether the debugging result contains an exception;
[0129] If the debugging result contains an exception, the exception is captured by a preset global exception capture function;
[0130] Repair the exception by using a preset repair function to complete the update of the H5 program package, and execute the step of loading the H5 program package from the local server;
[0131] The step of determining whether the debugging result contains an exception is iterated until the debugging result contains no exception.
[0132] It should be understood that in the embodiment of the present application, the processor 602 may be a central processing unit (CPU), and the processor 602 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0133] Those skilled in the art will appreciate that all or part of the processes in the method for implementing the above embodiment can be completed by a computer program, which can be stored in a computer-readable storage medium. The computer program is executed by at least one processor in the computer system to implement the process steps of the embodiment of the above method.
[0134] Therefore, the present application also provides a computer-readable storage medium. The computer-readable storage medium may be a non-volatile computer-readable storage medium, and the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the following steps:
[0135] A computer program product, when running on a computer, enables the computer to execute the steps of the APP debugging method described in the above embodiments.
[0136] The computer-readable storage medium may be an internal storage unit of the aforementioned device, such as a hard disk or memory of the device. The computer-readable storage medium may also be an external storage device of the device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the device. Furthermore, the computer-readable storage medium may also include both an internal storage unit of the device and an external storage device.
[0137] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described equipment, devices and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0138] The computer-readable storage medium may be a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk, etc., which are computer-readable storage media that can store program codes.
[0139] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0140] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0141] The steps in the method of the embodiment of the present application can be adjusted in order, combined and deleted according to actual needs. The units in the device of the embodiment of the present application can be combined, divided and deleted according to actual needs. In addition, the functional units in the various embodiments of the present application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0142] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for an electronic device (which can be a personal computer, terminal, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application.
[0143] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. An APP debugging method, applied to a debugging terminal, wherein the debugging terminal is a computer device that applies the APP, characterized in that: The APP is pre-developed into an APP shell framework and several H5 program packages, the H5 program package is an independent unit for realizing the functions of the APP, the APP shell framework realizes the functions of the APP by loading the H5 program package, the method is applied to the APP shell framework, the debugging terminal is configured with the APP shell framework, and the method includes: Obtain the URL address corresponding to the H5 program package to be debugged in a preset manner; According to the URL address, the H5 program package is loaded from the preset server, and the H5 program package is loaded into the web page view in the APP shell frame; Rendering the front-end page corresponding to the H5 program package through the web page view to debug the H5 program package to obtain the debugging result corresponding to the H5 program package; The application environment corresponding to the APP debugging method also includes a display terminal, and the display terminal is used to display the debugging of the APP on the debugging terminal in a mapping manner. Before the step of rendering the front-end page corresponding to the H5 program package through the web page view, it also includes: receiving a connection request from the display terminal; Performing connection authorization on the connection request to establish a connection with the display terminal; After the step of rendering the front-end page corresponding to the H5 program package through the web page view, the method further includes: Mapping the debugging process of the H5 program package to the display terminal connected to itself, so as to display the debugging result through the display terminal; The step of loading the H5 program package from a preset server according to the URL address and loading the H5 program package into the web page view in the APP shell framework includes: Receiving an opening instruction to open the APP; According to the opening instruction, obtain a first URL corresponding to the homepage of the APP; According to the first URL, loading a first H5 program package corresponding to the homepage from a first preset server; Loading the first H5 program package into the web page view in the APP shell frame to identify the second URL contained in the first H5 program package; According to the second URL, loading a second H5 program package from a second preset server; Loading the second H5 program package into the web page view to identify a third URL included in the second H5 program package; According to the third URL, load a third H5 program package from a third preset server, and load the third H5 program package into the web page view; Iterating the step of identifying the second URL contained in the first H5 program package, and iterating the step of identifying the third URL contained in the second H5 program package, until all URLs contained in the first H5 program package and all URLs contained in the second H5 program package are identified; After the step of rendering the front-end page corresponding to the H5 program package through the web page view to debug the H5 program package to obtain the debugging result corresponding to the H5 program package, the method further includes: Determine whether the debugging result contains an exception; If the debugging result contains an exception, the exception is captured by a preset global exception capture function; Repairing the exception by a preset repair function to complete the updating of the H5 program package, and executing the step of loading the H5 program package from the preset server; The step of determining whether the debugging result contains an exception is iterated until the debugging result contains no exception.
2. The APP debugging method according to claim 1, characterized in that: The step of authorizing the connection request to establish a connection with the display terminal includes: According to the connection request, obtaining a device identification of a computer device to which the display terminal belongs; Determine whether the device identifier is included in a preset authorization whitelist; If the device identification is included in the preset authorization whitelist, it is permitted to establish a connection with the display terminal.
3. An APP debugging device, applied to a debugging terminal, wherein the debugging terminal is a computer device that applies the APP, characterized in that: The APP is pre-developed into an APP shell framework and several H5 program packages, the H5 program package is an independent unit for realizing the functions of the APP, the APP shell framework realizes the functions of the APP by loading the H5 program package, the device is applied to the APP shell framework, the debugging terminal is configured with the APP shell framework, and the device includes: An acquisition unit, used for acquiring the URL address corresponding to the H5 program package to be debugged in a preset manner; A loading unit, used to load the H5 program package from a preset server according to the URL address, and load the H5 program package into a web page view in the APP shell frame; A debugging unit, used for rendering a front-end page corresponding to the H5 program package through the web page view to debug the H5 program package, so as to obtain a debugging result corresponding to the H5 program package; The device also includes: A receiving unit, configured to receive a connection request from a display terminal; an authorization unit, configured to perform connection authorization on the connection request to establish a connection with the display terminal; A mapping unit, used for mapping the debugging process of the H5 program package to the display terminal connected to the display terminal, so as to display the debugging result through the display terminal; The loading unit comprises: A receiving subunit, used to receive an opening instruction to open the APP; A second acquisition subunit is used to acquire a first URL corresponding to the homepage of the APP according to the opening instruction; A first loading subunit, configured to load a first H5 program package corresponding to the homepage from a first preset server according to the first URL; A first loading subunit, used to load the first H5 program package into the web page view in the APP shell frame to identify the second URL included in the first H5 program package; A second loading subunit, configured to load a second H5 program package from a second preset server according to the second URL; A second loading subunit, used for loading the second H5 program package into the web page view to identify a third URL included in the second H5 program package; A third loading subunit is used to load a third H5 program package from a third preset server according to the third URL, and load the third H5 program package into the web page view; an iterative subunit, configured to iterate the step of identifying the second URL contained in the first H5 program package, and iterate the step of identifying the third URL contained in the second H5 program package, until all URLs contained in the first H5 program package and all URLs contained in the second H5 program package are identified; The APP debugging device also includes: A judging unit, used to judge whether the debugging result contains an abnormality; A capture unit, configured to capture the exception by using a preset global exception capture function if the debugging result contains an exception; A repair unit, used to repair the exception by a preset repair function to complete the update of the H5 program package, and execute the step of loading the H5 program package from a preset server; The iterative unit is used to iterate the step of determining whether the debugging result contains an exception until the debugging result does not contain an exception.
4. The APP debugging device according to claim 3, characterized in that: The authorization unit comprises: A first acquisition subunit is used to acquire a device identification of a computer device to which the display terminal belongs according to the connection request; A determination subunit, used to determine whether the device identification is included in a preset authorization whitelist; The permission subunit is used to permit the establishment of a connection with the display terminal if the device identification is included in the preset authorization whitelist.
5. A computer device, characterized in that: The computer device includes a memory and a processor connected to the memory; the memory is used to store a computer program; the processor is used to run the computer program stored in the memory to execute the steps of the APP debugging method as described in any one of claims 1-2.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the steps of the APP debugging method as described in any one of claims 1-2.
Citation Information
Patent Citations
HTML5 page debugging method and device in APP
CN105357323A
Development method of mobile phone client side application program
CN105653270A
Application program debugging method and device
CN106126420A
H5 application test method, device, computer device and storage medium
CN108628747A
Page debugging method and device
CN108874674A
