Test application installation method and device

By modifying the system's native scanning mechanism to install preset APKs, skipping the installation of test applications on the terminal device, and installing and starting separately in the test application scenario, the problem of complex storage space occupation and operation of terminal devices is solved, and the effect of saving storage space and simplifying operations is achieved.

CN119938066APending Publication Date: 2025-05-06HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311403955.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-25
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

In the prior art, the test applications preset by the terminal equipment after leaving the factory under the user version system are still installed by the system native mechanism, occupying the terminal's storage space, and operating in complex ways, with wear and other problems.

Method used

By modifying the system native scanning mechanism to install preset APKs, skip the installation process of the test application, and when determining that the current scenario is a test application, install and start the test application separately. Specifically, the production service detects whether the startup data of the test application contains the startup data. If included, install and start, otherwise it will not be installed.

Benefits of technology

In user usage scenarios, the terminal's storage space is saved, the test application takes up storage space is avoided, and the operation is simplified and the device wear is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119938066A_ABST
    Figure CN119938066A_ABST
Patent Text Reader

Abstract

The invention provides a test application installation method and device, the method is applied to terminal equipment, and the method skips installation of a test application when a system native mechanism scans a preset APK of an installation system. Meanwhile, conditional installation of the test application is realized, and specifically, when the current scene is the scene of the test application, a new thread is established to independently install the test application and self-starts. And when it is determined that the current scene is not the scene of the test application, the test application is not installed, so that the storage space of the terminal in the user scene is saved. Visibly, according to the scheme, the test application is only installed in the scene of the test application, and the test application is not installed in the user scene, so that the storage space occupied by installation of the test application is saved, and the user can obtain more storage space.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a test application installation method and device. Background Art

[0002] Terminal devices (such as mobile phones, tablet computers and other smart electronic devices) need to undergo a series of tests before leaving the factory, and can only leave the factory if they pass the tests.

[0003] The wired production line uses USB communication in the cabinet to write customized data (such as region, country, physical number of the device, etc.) into the terminal device in order to further test the terminal device. The wired method of writing customized data requires connection to the USB interface of the terminal device, which may cause appearance damage such as wear and scratches. Moreover, the wired method of writing customized data has problems such as complex operation and large space occupied by the line. With the development of intelligent and unmanned terminal production lines, wireless production has gradually replaced wired production as a production line solution. The wireless production line needs to pre-install the corresponding test application in the system of the terminal device. The application can download the customized data and other content required for the test from the cloud server and write it into the terminal device, and further use the test application to perform the corresponding test process, that is, to realize wireless testing. However, under the user version system, the test application pre-installed after the terminal leaves the factory is still installed by the system native mechanism, occupying the storage space of the terminal. Summary of the invention

[0004] In view of this, the present application provides a test application installation method and device to solve the above technical problems, and the disclosed technical solutions are as follows:

[0005] In the first aspect, the present application provides a test application installation method, which is applied to a terminal device, and the terminal device includes a package management service and a production service. The method includes: the package management service scans and installs the pre-installed application of the terminal device, and when it is determined that the configuration information of the test application is included in the first configuration file, the installation process of the test application is skipped, and the first configuration file contains information of the application to be skipped; when the production service determines that the current scene is the scene of the test application, the test application is installed and started separately; when the production service determines that the current scene is not the scene of the test application, the test application is not installed. It can be seen that the scheme modifies the system's native scanning and installation mechanism of the system pre-installed APK, so that it skips the installation process of the test application. At the same time, the test application is installed conditionally. Specifically, when the current scene is the test application, the test application is installed separately and automatically started. The test application is not installed in the scene that is not the test application (such as the user use scene). In this way, in the scene that is not the test application, the storage space occupied by the installation of the test application is saved, so that the user can obtain more storage space.

[0006] In one possible implementation, when the production service determines that the current scenario is a scenario for a test application, the test application is installed and started separately, including: when the production service detects that the startup data of the production service includes startup data of the test application, it determines that the current scenario is a scenario for the test application; and the production service installs and starts the test application based on the startup data of the test application.

[0007] In a possible implementation, when the production service determines that the current scenario is not the scenario of the test application, before the test application is installed, the method further includes: after the test application completes the corresponding test items, erasing the startup data of the test application, the startup data including a silent installation flag and a self-start flag; after the terminal device is turned on again, the package management service scans and installs the pre-installed applications of the terminal device, and when it is determined that the first configuration file contains the configuration information of the test application, skipping the installation process of the test application. It can be seen that after the test application is installed and started and the test is completed, the silent installation flag and the self-start flag of the test application are erased so that the test application is not automatically installed later.

[0008] In one possible implementation, when the production service determines that the current scenario is not the scenario of the test application, the test application is not installed, including: when the production service determines that the startup data of the production service does not contain the startup data of the test application, it is determined that the current scenario is not the scenario of the test application, and the test application is not installed.

[0009] In a possible implementation, the startup data of the test application includes a silent installation flag and a self-start flag; the production service installs and starts the test application based on the startup data of the test application, including: the production service creates a thread based on the name of the test application and the storage directory address and installs the application package file of the test application according to the silent installation flag; the production service starts the test application based on the package name and startup name of the test application according to the self-start flag. It can be seen that the scheme identifies the startup data of the test application to determine that the current scene is the scene of the test application, and pulls up the thread to install the test application separately based on the silent installation flag in the startup data, and starts the test application based on the self-start flag to perform the corresponding test task.

[0010] In one possible implementation, the production service creates a thread according to the silent installation flag, reads and installs the test application package file based on the name of the test application package and the storage directory address, including: the production service generates a silent installation command based on the silent installation flag corresponding to the test application, the silent installation command includes the application package name and storage directory address corresponding to the test application; the production service executes the silent installation command, obtains and installs the application package file of the test application based on the application package name and the storage directory address.

[0011] In one possible implementation, the production service starts the test application based on the package name and startup name of the test application according to a self-start flag, including: the production service calls the test application startup command to start the test application based on the self-start flag corresponding to the test application, the test application startup command includes the package name and startup name of the test application, and the startup name is the activity name corresponding to the page started by the first page of the test application.

[0012] In one possible implementation, the terminal device also includes a small system service. When the production service determines that the current scenario is a test application scenario, before the test application is installed and started separately, the method also includes: after the terminal device is turned on, the small system service is started; when the small system service determines that the current scenario is a production test scenario, the production service is started layer by layer, and the startup data of the production service is passed to the production service.

[0013] In one possible implementation, when the small system service determines that the current scenario is a production test scenario, it starts the production service layer by layer and passes the startup data of the production service to the production service, including: when the small system service determines that the current scenario is a production test scenario, it adds production service flag information to the kernel startup information; passes the kernel startup information containing the production service flag information to the kernel to start the kernel; the kernel starts the user-level process and passes the kernel startup information to the user-level process; the user-level process determines that the kernel startup information contains the production service flag information, and sets the production service startup attribute information; the user-level process calls the production service startup, and passes the production service startup data to the production service.

[0014] In one possible implementation, when the production service determines that the first configuration file contains configuration information of the test application, the installation process of the test application is skipped, including: the production service reads the name and storage directory of the application contained in the first configuration file; when the first configuration file contains the name and storage directory of the test application, determines that the first configuration file contains the configuration information of the test application; when it is determined that the first configuration file contains the configuration information of the test application, the test application is not installed.

[0015] In a second aspect, the present application also provides a terminal device, which includes: one or more processors, a memory and a touch screen; the memory is used to store program code; the processor is used to run the program code, so that the terminal device implements a test application installation method as described in any one of the first aspects.

[0016] In a third aspect, the present application further provides a computer-readable storage medium having instructions stored thereon, which, when executed on a terminal device, causes the terminal device to execute a test application installation method as described in any one of the first aspects.

[0017] In a fourth aspect, the present application further provides a computer program product having an executable program stored thereon, which, when the computer program product is run on a terminal device, enables the terminal device to implement a test application installation method as described in any one of the first aspects.

[0018] It should be understood that the description of technical features, technical solutions, beneficial effects or similar language in this application does not imply that all features and advantages can be realized in any single embodiment. On the contrary, it is understood that the description of features or beneficial effects means that specific technical features, technical solutions or beneficial effects are included in at least one embodiment. Therefore, the description of technical features, technical solutions or beneficial effects in this specification does not necessarily refer to the same embodiment. Furthermore, the technical features, technical solutions and beneficial effects described in the present embodiment can also be combined in any appropriate manner. Those skilled in the art will understand that the embodiment can be realized without one or more specific technical features, technical solutions or beneficial effects of a specific embodiment. In other embodiments, additional technical features and beneficial effects can also be identified in a specific embodiment that does not embody all embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0020] Figure 1 is a schematic diagram of a wireless production line system provided in an embodiment of the present application;

[0021] Figure 2 It is an installation flow chart of a test application in the related art;

[0022] Figure 3 It is a structural diagram of a terminal device provided in an embodiment of the present application;

[0023] Figure 4 It is a test application installation flow chart provided in an embodiment of the present application;

[0024] Figure 5 is another test application installation flow chart provided in an embodiment of the present application;

[0025] Figure 6 This is a test application installation sequence diagram provided in an embodiment of the present application. DETAILED DESCRIPTION

[0026] The terms "first", "second", "third", etc. in the specification, claims and drawings of this application are used to distinguish different objects rather than to limit a specific order.

[0027] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0028] See also Figure 1 , showing a schematic diagram of a wireless production line system provided in an embodiment of the present application. This embodiment is described by taking a mobile phone as an example of a terminal device. In other embodiments of the present application, the terminal device may be a tablet computer, a smart wearable device, a desktop, a laptop, a notebook computer, an ultra-mobile personal computer (UMPC), a handheld computer, a netbook, a personal digital assistant (PDA), a wearable electronic device, a smart watch, and the like.

[0029] like Figure 1 As shown, the mobile phone to be tested is transferred to a testing station. In an exemplary embodiment, the testing station can be a shielding box.

[0030] The test station includes a router, which is used to generate a wireless network, so that the mobile phone to be tested at the test station can connect to the wireless network through the router. After the mobile phone to be tested at the test station is connected to the wireless network, it can request to access the cloud server.

[0031] In an embodiment of the present application, the mobile phone to be tested at the test station (i.e., the terminal side) can send a cloud request to the cloud server (i.e., the cloud side) to request data in the cloud server, such as hot-deployed applets, customized data (e.g., region, country, device physical number, etc.), image packages, etc.

[0032] After receiving the cloud request from the mobile phone to be tested, the cloud server responds to the request and returns the corresponding data. For example, in an embodiment of the present application, the mobile phone to be tested can request to download customized data from the cloud server and write it into the mobile phone. In addition, the mobile phone to be tested can also request to download hot deployment applets, mirror packages, etc. from the cloud server.

[0033] In addition, if Figure 1 As shown, the test station includes an input end and an output end. The mobile phone that has completed the test corresponding to the current test station moves out of the current test station through the output end. For example, mobile phone 1 has completed the test and moves out of the test station.

[0034] The mobile phone to be tested enters the testing station through the input end, for example, mobile phone 6 is the mobile phone to be tested.

[0035] Figure 2 The figure shows the current test application installation process. This embodiment still takes the mobile phone as an example for the terminal device. Figure 2 As shown, the installation process of the test application is as follows:

[0036] 1) After the mobile phone system is upgraded to the user version system at the previous station on the production line and turned on, it enters the current test station.

[0037] 2) The mobile phone system will scan the preset application package (Android application package, APK) in the preset directory. The preset APK in this embodiment includes a test application. The mobile phone system will scan and install the test application.

[0038] 3) After the test application is installed, an installation directory for the test application is generated in the mobile phone, such as "data / data / package name directory", which occupies the storage space of the mobile phone.

[0039] 4) Run the test application to complete the test process of the mobile phone, such as the test process includes: downloading customized data from the cloud server and writing it to the mobile phone, as well as other test items. After the mobile phone completes the test, restore the factory settings or restart and turn it on again.

[0040] 5) After restarting, the user version of the system will still scan the preset APK in the preset directory, and the test application will be installed again.

[0041] 6) When you install the test application again, the corresponding installation directory is still generated for the application, that is, "data / data / package name directory".

[0042] 7) When the phone is turned off for shipment, the phone contains the installation directory and APK file of the test application, which takes up the storage space of the phone.

[0043] From the above process, it can be seen that in the current test application installation process, the mobile phone will install the test application regardless of the test application scenario or the user usage scenario. However, the test application is an application developed to complete the wireless automated testing of the mobile phone, and the user has no usage scenario for the application. Moreover, after the test application is installed, it will occupy the storage space of the mobile phone, resulting in a reduction in the storage space available to the user. It can be seen that in this test application installation solution, the test application is still installed by the system native mechanism after the terminal device leaves the factory and occupies the storage space of the terminal.

[0044] In order to solve the above technical problems, the present application provides a test application installation method, which skips the installation of the test application when the system native mechanism scans and installs the system pre-installed APK. The test application is further installed conditionally. Specifically, if the current scene is the scene of the test application, a new thread is created to install the test application separately and start it automatically. If the current scene is a user usage scene, the test application is not installed, thereby saving the storage space of the terminal in the user scene.

[0045] Figure 3 It is a structural diagram of a terminal device provided in an embodiment of the present application.

[0046] like Figure 3 As shown, the terminal device may include a processor 101 , a memory 102 and a wireless communication module 103 .

[0047] The processor 101 may include one or more processing units. Different processing units may be independent devices or integrated into one or more processors. For example, in the present application, the processor 101 may skip the installation of the test application when the system native mechanism scans and installs the pre-installed APK. Also, when the current scenario is a scenario for the test application, the test application is installed, but the test application is not installed in the user usage scenario, that is, the test application is installed conditionally.

[0048] The memory 102 may be used to store computer executable program codes, which include instructions. The processor 101 executes various functional applications and data processing of the terminal device by running the instructions stored in the memory. For example, in this embodiment, the processor 101 may install a test application by executing the instructions stored in the memory.

[0049] The wireless communication module 103 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the terminal device. The wireless communication module 160 can be one or more devices integrating at least one communication processing module.

[0050] In addition, an operating system runs on the above components. operating system, Open source operating system, Windows operating system, etc. Applications can be installed and run on this operating system.

[0051] The operating system of the terminal device can adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the terminal device.

[0052] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.

[0053] The application layer may include a series of application packages. For example, in the embodiment of the present application, the application package may also include a test application.

[0054] The application framework layer provides an application programming interface (API) and a programming framework for the applications of the application layer. The application framework layer includes some predefined functions. For example, in the embodiment of the present application, the application framework layer includes a small system service, an init process, a SystemServer, a PackageManagerService (PMS), a ParallelPackageParser, a PackageParser, a ManufactureControlServer (MCS), etc.

[0055] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.

[0056] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.

[0057] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0058] A system library may include multiple functional modules.

[0059] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.

[0060] It should be noted that although the embodiments of the present application are described using the Android system as an example, its basic principles are also applicable to electronic devices based on operating systems such as iOS or Windows.

[0061] The following will be combined Figure 4 The test application installation process provided in the embodiment of the present application is introduced, such as Figure 4 As shown, the method may include the following process:

[0062] 1) After the mobile phone system is upgraded to the user version system at the previous production line station and turned on, it enters the current test station.

[0063] 2) The phone system will scan and install the preset APK in the preset directory but skip installing the test app, and start a new thread to install the test app separately. The preset directory is the storage directory address used to store the system preset APK.

[0064] 3) After installing the test application, a corresponding installation directory is generated in the phone, namely "data / data / package name directory".

[0065] 4) After running the test application to complete the test content of the current test station, restore the factory settings or restart and turn on the machine again.

[0066] 5) After the phone is turned on again, the system will still scan the preset APK in the preset directory but skip the installation of the test application. In addition, it will not pull up a thread to install the test application separately, and finally shut down for shipment.

[0067] Depend on Figure 4 As can be seen from the process shown, the system always skips the automatic installation process of the test application. At the same time, the test application is installed and started to realize automatic testing only when the installation conditions are met (that is, the current scene is the scene of the test application). The test application is not installed when the installation conditions are not met (that is, the current scene is not the scene of the test application). In this way, the test application will not be installed after the mobile phone leaves the factory to occupy the storage space of the mobile phone, saving the storage space of the mobile phone.

[0068] The following will be combined Figure 5 Further introduce the test application installation process provided by this application, such as Figure 5 As shown, the process is as follows:

[0069] 1) Configure a configuration file for skipping the installation of the test application, such as the uninstall_apk.xml configuration file, which contains the name and storage directory of the test application.

[0070] 2) Write the silent installation flag and the automatic start flag for the test application.

[0071] 3) The system is upgraded to the user version and started.

[0072] The above three steps are completed before entering the test station.

[0073] 4) The mobile phone system scans the preset APK in the preset directory.

[0074] 5) After the uninstall_apk.xml configuration file contains the information of the test application, skip installing the test application.

[0075] 6) Also, start a new thread to install the test application separately.

[0076] 7) Generate the installation directory of the test application in the mobile phone: "data / data / package name directory".

[0077] 8) After the test is started, the customized data and other test content required by the test are downloaded from the cloud server and written into the mobile phone system to complete the corresponding test content.

[0078] 9) The test application erases the silent installation flag and the automatic startup flag.

[0079] 10) After the phone has completed the test, restore it to factory settings or restart it.

[0080] 11) After restarting, the system scans and installs the preset APK in the preset directory.

[0081] 12) The system scans the preset APK in the preset directory, and after determining that the unstall_apk.xml configuration file contains information about the test application, it skips installing the test application. In addition, the silent installation flag and the self-start flag have been erased, so the test application will not be installed and started separately.

[0082] The following will be combined Figure 6 The test application installation method provided in the present application is further introduced in detail, and the method is applied to terminal devices such as mobile phones, tablet computers, smart wearable devices, smart watches and other devices.

[0083] like Figure 6 As shown, the process may include the following steps:

[0084] S101, the mobile phone starts up the mini-system service.

[0085] Mini system services are native services in the mobile phone system, which complete various initializations during the phone startup process.

[0086] S102, the small system service determines whether the startup data of the production service is empty; if not, execute S103; if yes, directly start the kernel.

[0087] The manufacture control server (MCS) is a system-level service that completes the contents related to production testing in terminal equipment.

[0088] The startup data of the production service may include startup parameters of each production APK included in the production service. For example, the production APK includes a test application, and the startup parameters of the test application may include a silent installation flag and a self-start flag.

[0089] In an exemplary embodiment, the startup data of the production service may be stored in the system memory, and the small system service may read the startup data of the production service according to the agreed memory address and determine whether the startup data of the production service is empty.

[0090] If the startup data of the production service is not empty, it indicates that the current scenario is a production test scenario, and the production service needs to be started to complete the corresponding production test task. If the startup data of the production service is empty, it indicates that the current scenario is not a production test scenario, and there is no need to start the production service. Start other services in the system normally, such as the system kernel.

[0091] S103, the small system service adds production service flag information to the kernel startup information.

[0092] The kernel startup information includes a kernel startup command, which is used to start the kernel of the system.

[0093] The production service flag information indicates that the current usage scenario is a production test scenario. In an exemplary embodiment, the small system service adds start_mcs_flag=true in the kernel startup information.

[0094] S104, the mini-system service sends kernel startup information to the kernel to start the kernel.

[0095] In S103, the production service flag information is added to the kernel startup information, so the kernel startup information sent to the kernel includes the production service flag information.

[0096] S105, after the kernel is started, the init process is started and kernel startup information is passed to the init process.

[0097] The init process is the first user-level process started by the kernel. The init process is the starting point of all processes in the system, that is, all processes in the system are created and run by the init process. For example, in this embodiment, after the init process is started, it starts the system service (SystemServer), the production service (MCS), etc.

[0098] The following steps S106 to S112 are related steps after starting the system service, and S113 to S119 are related steps after starting the MCS.

[0099] S106, after the init process is started, the system service is started.

[0100] SystemServer is the entry point for starting services in the system. SystemServer creates SystemServiceManager to create, start and manage services in the system. For example, in this embodiment, SystemServer is used to start and manage the package management system service (PackageManagerService, PMS).

[0101] S107, after SystemServer is started, the package management service (PackageManagerService, PMS) is started.

[0102] S108, PMS scans the APK in the preset directory.

[0103] PMS is a package management system service provided by the Android system, which is used to manage all package information, including application installation, uninstallation, update, and parsing of APK files.

[0104] In an embodiment of the present application, after the PMS is started, it scans the preset APK stored in the preset directory address.

[0105] S109, PMS determines whether the currently scanned APK is the non-installed APK configured in the configuration file; if yes, execute S110; if not, execute S111.

[0106] PMS reads the configuration file, namely, the unstall_apk.xml configuration file, from the agreed storage address. The configuration file records the information of the APK that does not need to be installed, such as the storage directory address and the APK name.

[0107] Compare the name of the currently scanned APK with the APK name in the configuration file to see if they are consistent. If they are consistent, continue to determine whether the storage directory address of the currently scanned APK is consistent with the storage directory address of the APK recorded in the configuration file. If they are consistent, determine that the configuration file contains the configuration information of the currently scanned APK.

[0108] If the name or storage directory address of the currently scanned APK is inconsistent with the APK information recorded in the configuration file, it is determined that the configuration file does not contain the configuration information of the currently scanned APK.

[0109] S110, the PMS skips the installation process of the currently scanned APK.

[0110] If the configuration file contains the configuration information of the currently scanned APK, the PMS skips the APK and does not install it. In this embodiment, the configuration file includes the information of the test application. When the PMS scans the test application and determines that the test application has configuration information in the configuration file, the installation process of the test application is directly skipped, that is, the test application is not installed. Moreover, skipping the installation of the test application is always effective, that is, in any usage scenario (test application scenario, user usage scenario, etc.), the PMS skips the installation process of the test application.

[0111] S111, PMS sends the currently scanned APK file to the APK parsing queue.

[0112] If the configuration file does not contain the configuration information of the currently scanned APK, the APK needs to be installed. Further, the scanned APK file is sent to ParallelPackageParser for APK file parsing.

[0113] ParallelPackageParser is a queue, which can be called an APK parsing queue. It is used to collect system APK files, then take out the APK from the queue and call PackageParser to parse the APK file.

[0114] S112, PMS calls the APK parsing module to parse the APK file.

[0115] Exemplarily, the APK parsing module may be PackageParser, which is mainly responsible for parsing the APK file, that is, parsing the APK configuration file, the AndroidManifest.xml configuration file. The AndroidManifest.xml file is an information description file of the entire application, which defines component information such as Activity, Content provider, and BroadcastReceiver contained in the application.

[0116] The process of scanning and installing the preset APK shown in the above steps S107-S112 is executed cyclically until all the preset APKs in the system are scanned.

[0117] The process shown in the above steps S106-S110 is the process of PMS skipping the installation of the test application. This application skips the installation process of the test application by modifying the processing logic of the PMS service of the system native scanning pre-installed APK.

[0118] In the scenario of testing the application, it is necessary to install and run the test application to implement self-testing. In the scenario of user use, it is not necessary to install the test application. The embodiment of the present application adds a processing scenario of conditional installation of the test application and self-start in the MCS, that is, the process shown in the following steps S113-S121:

[0119] S113, the init process determines whether there is production service flag information in the kernel startup information; if yes, execute S114.

[0120] If the kernel startup information contains the production service flag information, it indicates that the current scenario is a production test scenario and the production service, that is, MCS, needs to be started.

[0121] S114, the init process sets the production service startup attribute information.

[0122] After the init process determines that the kernel startup information contains the production service flag information (ie, start_mcs_flag=true), it sets the attribute ro.start_mcs_flag=true, indicating that the current usage scenario is a production test scenario.

[0123] S115, the init process starts the MCS based on the production service startup attribute information, and transmits the production service startup data to the MCS.

[0124] The small system service determines in S102 that the startup data of the production service is not empty, and further transmits the startup data of the production service to the init process layer by layer. The init process continues to transmit the startup data of the production service to the MCS.

[0125] Exemplarily, the production service startup data may include startup data of an APK related to production testing, such as test application scenario data and startup data. The startup data of the test application may include a silent installation flag and a self-start flag.

[0126] The test application scenario data indicates that the current scenario is a test application scenario, for example, the scenario data may be predefined characters. If the production service startup data includes the test application scenario data, it indicates that the current scenario is a test application scenario, that is, a self-test scenario using a test application.

[0127] S116, MCS determines whether the production service startup data is a scenario for a test application; if so, executes S117; if not, the test application is not installed.

[0128] MCS determines whether the production service startup data contains test application scenario data. If so, it determines that it is a test application scenario, that is, a scenario in which the test application is used for testing. It further processes the silent installation and self-startup scenarios of the test application.

[0129] In another embodiment, if the MCS determines that the production service startup data does not include the test application scenario data, it is determined that the current scenario is not a scenario of the test application.

[0130] If the production service startup data does not contain the test application scenario data but includes other APK scenario data, the startup scenarios of other APKs are processed, which will not be described in detail here.

[0131] S117, the MCS generates a silent installation command based on the silent installation flag of the test application.

[0132] After the MCS detects the silent installation flag of the test, it generates a silent installation command, which includes the name of the test application and the storage directory address.

[0133] S118, MCS executes the silent installation command to parse the APK file of the test application and install it.

[0134] In an exemplary embodiment, the MCS creates a new thread to parse the silent installation command to obtain the APK name and storage directory address of the test application, and further reads the APK file of the test application based on the storage directory address and APK name to parse and install it.

[0135] S119, the MCS calls a test application start command based on the self-start flag of the test application to start the test application.

[0136] In an exemplary embodiment, the test application start command is pre-written into the code of the MCS. After the MCS detects the self-start flag of the test application, it calls the start command to start the test application.

[0137] The test application startup command includes the package name and startup name of the test application. The MCS sends the startup command to the service for starting the test application, and the service executes the startup command to launch the test application based on the package name and startup name in the startup command.

[0138] The package name is the unique identifier of the application. Different applications have different package names. The package name of the application can be obtained by parsing the APK configuration file, that is, the AndroidManifest.xml file.

[0139] Launch name (AppActivity), or called launch page, a page in an application is an Activity, usually the first page launched is called the launch page. Find the AppActivity (launch name) containing the category value "android.intent.category.LAUNCHER" in the AndroidManifest.xml file of the application. android.intent.category.LAUNCHER is an Intent category, which is used to indicate that the Intent is a request to launch an application.

[0140] The process shown in the above steps S114-S120 is the process of installing the test application through the MCS service conditions, that is, the test application is installed only when the MCS detects that the current scene is a scene for the test application, and the test application is not installed when the user uses the scene, thereby saving the storage space of the terminal.

[0141] In addition, the present application does not limit the execution order of S114-S120 and S106-S110. In this embodiment, S106-S110 is executed first and then S114-S120. In other embodiments, S114-S120 may be executed first and then S106-S110.

[0142] The test application installation method provided in this embodiment modifies the system native scanning and installation logic of the pre-installed APK, so that the system skips the installation process of the test application. Furthermore, the processing logic of conditionally installing the test application and self-starting is added in the production service. Specifically, when it is determined that the current scene is a test application scene, the test application is installed and self-started to achieve self-testing. When it is determined that the current scene is a user use scene, the test application is not installed to avoid occupying the terminal storage space due to the installation of the test application, thereby saving the terminal storage space.

[0143] Through the description of the above implementation methods, technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0144] In the several embodiments provided in this embodiment, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0145] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0146] In addition, each functional unit in each embodiment of the present embodiment may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0147] 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 computer-readable storage medium. Based on this understanding, the technical solution of this embodiment 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 several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of the method described in each embodiment. The aforementioned storage medium includes: flash memory, mobile hard disk, read-only memory, random access memory, disk or optical disk and other media that can store program codes.

[0148] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall 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. A test application installation method, characterized in that: Applied to a terminal device, the terminal device includes a package management service and a production service, the method includes: The package management service scans and installs pre-installed applications of the terminal device, and skips the installation process of the test application when it is determined that the first configuration file contains configuration information of the test application, and the first configuration file contains information of the application to be skipped for installation; When the production service determines that the current scenario is the scenario of the test application, the test application is installed and started separately; When the production service determines that the current scenario is not the scenario of the test application, the test application is not installed.

2. The method according to claim 1, characterized in that When the production service determines that the current scenario is a scenario of the test application, the test application is installed and started separately, including: When the production service detects that the startup data of the production service includes the startup data of the test application, it determines that the current scene is the scene of the test application; The production service installs and starts the test application based on the start-up data of the test application.

3. The method according to claim 1 or 2, characterized in that: When the production service determines that the current scenario is not the scenario of the test application, before not installing the test application, the method further includes: After the test application completes the corresponding test items, the startup data of the test application is erased, the startup data including a silent installation flag and a self-start flag; After the terminal device is turned on again, the package management service scans and installs the pre-installed application programs of the terminal device, and when it is determined that the first configuration file includes the configuration information of the test application, the installation process of the test application is skipped.

4. The method according to claim 3, characterized in that When the production service determines that the current scenario is not the scenario of the test application, the test application is not installed, including: When the production service determines that the startup data of the production service does not include the startup data of the test application, it is determined that the current scene is not the scene of the test application, and the test application is not installed.

5. The method according to claim 2, characterized in that: The startup data of the test application includes a silent installation flag and a self-start flag; The production service installs and starts the test application based on the startup data of the test application, including: The production service creates a thread according to the silent installation flag, reads the application package file of the test application based on the name and storage directory address of the test application, and installs the application package file; The production service starts the test application according to the self-start flag and based on the package name and startup name of the test application.

6. The method according to claim 5, characterized in that The production service creates a thread according to the silent installation flag, reads the test application package file based on the name and storage directory address of the test application package, and installs the file, including: The production service generates a silent installation command based on the silent installation flag corresponding to the test application, wherein the silent installation command includes an application package name and a storage directory address corresponding to the test application; The production service executes the silent installation command, obtains the application package file of the test application based on the application package name and the storage directory address, and installs it.

7. The method according to claim 5, characterized in that The production service starts the test application according to the self-start flag and based on the package name and the startup name of the test application, including: The production service calls a test application startup command based on a self-start flag corresponding to the test application to start the test application. The test application startup command includes a package name and a startup name of the test application. The startup name is an activity name corresponding to a page started by the first page of the test application.

8. The method according to any one of claims 1 to 7, characterized in that: The terminal device further includes a small system service. When the production service determines that the current scene is the scene of the test application, before the test application is separately installed and started, the method further includes: After the terminal device is turned on, the mini-system service is started; When the mini-system service determines that the current scenario is a production test scenario, it starts the production service layer by layer and transmits the start-up data of the production service to the production service.

9. The method according to claim 8, characterized in that When the mini-system service determines that the current scenario is a production test scenario, starting the production service layer by layer and transmitting the start-up data of the production service to the production service includes: When the mini-system service determines that the current scenario is a production test scenario, the mini-system service adds production service flag information to the kernel startup information; Passing kernel startup information including the production service flag information to the kernel to start the kernel; The kernel starts a user-level process and transmits the kernel startup information to the user-level process; The user-level process determines that the kernel startup information includes the production service flag information, and sets the production service startup attribute information; The user-level process calls the production service startup and transmits the production service startup data to the production service.

10. The method according to claims 1-9, characterized in that When the production service determines that the first configuration file contains the configuration information of the test application, skipping the installation process of the test application includes: The production service reads the name and storage directory of the application program included in the first configuration file; When the first configuration file includes the name and storage directory of the test application, determining that the first configuration file includes configuration information of the test application; When it is determined that the first configuration file includes the configuration information of the test application, the test application is not installed.

11. A terminal device, characterized in that: The terminal device includes: one or more processors, a memory and a touch screen; the memory is used to store program code; the processor is used to run the program code, so that the terminal device implements the test application installation method as described in any one of claims 1 to 10.

12. A computer-readable storage medium, characterized in that: Instructions are stored thereon, and when the instructions are executed on a terminal device, the terminal device executes the test application installation method according to any one of claims 1 to 10.