CN111382048B - Management method and device for mobile equipment on true machine test platform - Google Patents

Management method and device for mobile equipment on true machine test platform Download PDF

Info

Publication number
CN111382048B
CN111382048B CN201811626410.1A CN201811626410A CN111382048B CN 111382048 B CN111382048 B CN 111382048B CN 201811626410 A CN201811626410 A CN 201811626410A CN 111382048 B CN111382048 B CN 111382048B
Authority
CN
China
Prior art keywords
daemon
mobile
mobile equipment
state
equipment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811626410.1A
Other languages
Chinese (zh)
Other versions
CN111382048A (en
Inventor
李括
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
3600 Technology Group Co ltd
Original Assignee
3600 Technology Group Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 3600 Technology Group Co ltd filed Critical 3600 Technology Group Co ltd
Priority to CN201811626410.1A priority Critical patent/CN111382048B/en
Publication of CN111382048A publication Critical patent/CN111382048A/en
Application granted granted Critical
Publication of CN111382048B publication Critical patent/CN111382048B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2294Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing by remote test

Abstract

The invention provides a method and a device for managing mobile equipment on a true machine test platform. The method is applied to the mobile equipment end and comprises the following steps: after the mobile equipment is connected with a proxy server, a designated daemon is started in the mobile equipment in a mode of not suspending operation through the proxy server; detecting the current equipment state of the mobile equipment through the appointed daemon, and judging whether the current equipment state is abnormal or not; if yes, acquiring a test case script for maintaining the mobile equipment from the real machine test platform according to the information of the mobile equipment through the appointed daemon; and analyzing and executing the test case script through the appointed daemon so as to maintain the mobile equipment. The invention can continuously monitor the state of the mobile equipment and acquire and execute the corresponding test case script aiming at the abnormal state so as to realize the automatic maintenance of the mobile equipment.

Description

Management method and device for mobile equipment on true machine test platform
Technical Field
The invention relates to the technical field of remote true machine testing, in particular to a management method and device of mobile equipment on a true machine testing platform, a computer storage medium and computing equipment.
Background
The remote real machine test platform is a platform for remotely controlling mobile phone use, and can provide real machine operation of a cloud end, so that tests of a functional module, performance, safety, capacity, compatibility, usability, hardware environment, cross events, interfaces and the like of the mobile terminal app are provided for a user, and development and test of mobile phone software and the app are greatly facilitated.
When the mobile test is performed, the mobile phone and a proxy server (such as a PC (Personal Computer, personal computer) proxy) establish an adb (Android Debug Bridge ) connection through a USB (Universal Serial Bus ) data line or a WiFi network, and a USB debug mode under the option of a developer is started on the mobile phone, so that a user can operate and test the mobile phone on the test platform through the proxy server. However, the real machine test platform is usually provided with hundreds or thousands of mobile phone devices, and in the daily operation process, abnormality such as disconnection of USB connection of certain mobile phone devices, automatic closing of a developer mode and the like often occurs, so that the normal running of the test is affected. At this time, special maintenance personnel are required to perform corresponding maintenance treatment on the equipment, so that the labor cost is increased, and the efficiency is low.
Therefore, a method for monitoring the abnormal state of the mobile phone on the real-time testing platform and automatically maintaining the abnormal mobile phone is needed.
Disclosure of Invention
The present invention has been made in view of the above problems, and it is an object of the present invention to provide a method and apparatus for managing mobile devices on a real machine test platform, a computer storage medium, and a computing device that overcome or at least partially solve the above problems.
According to an aspect of the embodiment of the present invention, there is provided a method for managing mobile devices on a real machine test platform, applied to a mobile device side, including:
after the mobile equipment is connected with a proxy server, a designated daemon is started in the mobile equipment in a mode of not suspending operation through the proxy server;
detecting the current equipment state of the mobile equipment through the appointed daemon, and judging whether the current equipment state is abnormal or not;
if yes, acquiring a test case script for maintaining the mobile equipment from the real machine test platform according to the information of the mobile equipment through the appointed daemon;
and analyzing and executing the test case script through the appointed daemon so as to maintain the mobile equipment.
Optionally, the specified daemon is a java daemon;
starting a specified daemon in the mobile device by the proxy server in a manner that does not suspend operation, comprising:
and running a target dex file in the mobile equipment through a nohup command of an adb process of the proxy server so as to start the java daemon.
Optionally, the target dex file is formed by converting an executable jar package containing device state monitoring and test case script execution logic through an Android software development kit, and is configured in the mobile device in advance.
Optionally, the mobile device connects to the proxy server via an adb command using USB or WiFi.
Optionally, detecting, by the designated daemon, a current device state of the mobile device, including:
the current device state of the mobile device is periodically detected by the specified daemon.
Optionally, determining whether the current device state is abnormal includes:
judging whether the USB connection is broken; and/or
It is determined whether the developer mode is automatically turned off.
Optionally, after detecting the current device state of the mobile device, the method further comprises:
and reporting the current equipment state of the mobile equipment to the real machine test platform.
Optionally, the test case script is preconfigured in the real machine test platform according to the equipment model, the operating system version and/or the equipment abnormality type;
acquiring, by the specified daemon, a test case script for maintaining the mobile device from the real machine test platform according to information of the mobile device, including:
and acquiring a test case script for maintaining the mobile device from the real machine test platform according to the abnormal type of the current device state, the model of the mobile device and/or the operating system version of the mobile device through the appointed daemon.
Optionally, the test case script is json format.
Optionally, maintaining the mobile device includes:
and simulating user operation in the test case script through the specified method name and parameters.
Optionally, the user operation includes at least one of:
sleep, slide screen, click.
Optionally, executing the test case script includes:
and executing the test case script through an automatic test framework.
Optionally, the method further comprises:
and if the current equipment state is judged to be abnormal, the appointed daemon waits for the next detection of the current equipment state of the mobile equipment.
According to another aspect of the embodiment of the present invention, there is also provided a management apparatus for a mobile device on a real machine test platform, applied to a mobile device side, including:
the process starting module is suitable for starting a designated daemon in the mobile equipment in a mode of not suspending operation through the proxy server after the mobile equipment is connected with the proxy server;
the state detection module is suitable for detecting the current equipment state of the mobile equipment through the appointed daemon and judging whether the current equipment state is abnormal or not;
the script acquisition module is suitable for acquiring a test case script for maintaining the mobile equipment from the real machine test platform according to the information of the mobile equipment through the appointed daemon if the current equipment state is abnormal; and
and the script analysis execution module is suitable for analyzing and executing the test case script through the appointed daemon so as to maintain the mobile equipment.
Optionally, the specified daemon is a java daemon;
the process start module is further adapted to:
and running a target dex file in the mobile equipment through a nohup command of an adb process of the proxy server so as to start the java daemon.
Optionally, the target dex file is formed by converting an executable jar package containing device state monitoring and test case script execution logic through an Android software development kit, and is configured in the mobile device in advance.
Optionally, the mobile device connects to the proxy server via an adb command using USB or WiFi.
Optionally, the status detection module is further adapted to:
the current device state of the mobile device is periodically detected by the specified daemon.
Optionally, the status detection module is further adapted to:
judging whether the USB connection is broken; and/or
It is determined whether the developer mode is automatically turned off.
Optionally, the status detection module is further adapted to:
and after detecting the current equipment state of the mobile equipment, reporting the current equipment state of the mobile equipment to the real machine test platform.
Optionally, the test case script is preconfigured in the real machine test platform according to the equipment model, the operating system version and/or the equipment abnormality type;
the script acquisition module is further adapted to:
and acquiring a test case script for maintaining the mobile device from the real machine test platform according to the abnormal type of the current device state, the model of the mobile device and/or the operating system version of the mobile device through the appointed daemon.
Optionally, the test case script is json format.
Optionally, the script parsing execution module is further adapted to:
and simulating user operation in the test case script through the specified method name and parameters.
Optionally, the user operation includes at least one of:
sleep, slide screen, click.
Optionally, the script parsing execution module is further adapted to:
and executing the test case script through an automatic test framework.
Optionally, the apparatus further comprises:
and the process waiting module is suitable for enabling the appointed daemon to wait for next detection of the current equipment state of the mobile equipment if the current equipment state is judged not to be abnormal.
According to yet another aspect of embodiments of the present invention, there is also provided a computer storage medium storing computer program code which, when run on a computing device, causes the computing device to perform a method of managing mobile devices on a real machine test platform according to any of the preceding claims.
According to yet another aspect of an embodiment of the present invention, there is also provided a computing device including:
a processor; and
a memory storing computer program code;
the computer program code, when executed by the processor, causes the computing device to perform a method of managing mobile devices on a real machine test platform according to any one of the preceding claims.
According to the management method and the device for the mobile equipment on the real machine test platform, when the mobile equipment is on line on the real machine test platform, the designated daemon is started in the mobile equipment in a mode of not suspending operation through the proxy server, and then the current equipment state of the mobile equipment is detected through the designated daemon and whether the mobile equipment is abnormal or not is judged, if so, a test case script for maintaining the mobile equipment is obtained from the real machine test platform according to the information of the mobile equipment, and the test case script is analyzed and executed, so that the maintenance operation of the mobile equipment is realized. Because the appointed daemon is started in a mode of not suspending operation, even if the mobile equipment is in an abnormal state of USB connection disconnection or automatic closing of a developer mode, the appointed daemon can still be in an operation state, so that the state of the mobile equipment can be continuously monitored, and corresponding test case scripts can be acquired and executed aiming at the abnormal state, so that automatic maintenance of the mobile equipment is realized.
Further, by acquiring pre-configured test case scripts for different mobile device models, system versions and exception types from the real machine test platform according to the exception type of the current device state, the model of the mobile device and/or the operating system version of the mobile device, and simulating a series of user operations in the test case scripts by specifying method names and parameters, accurate automatic processing of the exception state problem with fixed processing steps can be achieved by executing the test case scripts.
The foregoing description is only an overview of the present invention, and is intended to be implemented in accordance with the teachings of the present invention in order that the same may be more clearly understood and to make the same and other objects, features and advantages of the present invention more readily apparent.
The above, as well as additional objectives, advantages, and features of the present invention will become apparent to those skilled in the art from the following detailed description of a specific embodiment of the present invention when read in conjunction with the accompanying drawings.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to designate like parts throughout the figures. In the drawings:
FIG. 1 is a flow chart of a method of managing mobile devices on a real machine test platform according to an embodiment of the invention;
FIG. 2 shows an apk building flow diagram for the Android system;
FIG. 3 is a flow chart of a method of managing mobile devices on a real machine test platform according to another embodiment of the present invention;
FIG. 4 is a schematic structural diagram of a management apparatus for a mobile device on a testing platform of a real machine according to an embodiment of the present invention; and
fig. 5 is a schematic structural diagram of a management apparatus for a mobile device on a testing platform of a real machine according to another embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
The remote real machine test platform is an important tool for developing and testing mobile device software and apps. Hundreds of mobile devices are usually arranged on a real machine test platform for operation, and abnormality such as disconnection of USB connection, automatic closing of a developer mode and the like of certain mobile devices often occur in the daily operation process, so that the normal running of the test is affected. In the prior art, aiming at the abnormality, special maintenance personnel are required to carry out corresponding maintenance treatment on equipment, so that the labor cost is increased, and the efficiency is low. In addition, in the prior art, the java process is directly started through an adb command in a USB debugging or developer mode. The java process started in this way depends on the USB connection of the device, and when the USB connection is disconnected, the java process is killed and cannot effectively monitor the state of the device and perform maintenance.
In order to solve the technical problems, an embodiment of the invention provides a management method of mobile equipment on a real machine test platform. FIG. 1 is a flow chart illustrating a method of managing mobile devices on a real machine test platform according to an embodiment of the present invention. Referring to fig. 1, the method is applied to a mobile device, and may at least include the following steps S102 to S108.
Step S102, after the mobile device is connected with the proxy server, a designated daemon is started in the mobile device through the proxy server in a mode of not suspending operation.
Step S104, detecting the current device state of the mobile device through the appointed daemon, and judging whether the current device state is abnormal or not.
And step S106, if yes, acquiring a test case script for maintaining the mobile equipment from the real machine test platform according to the information of the mobile equipment through the appointed daemon.
Step S108, analyzing and executing the test case script through the appointed daemon to maintain the mobile equipment.
According to the management method for the mobile equipment on the true machine test platform, when the mobile equipment is on line on the true machine test platform, the designated daemon is started in the mobile equipment in a mode of not suspending operation through the proxy server, and then the current equipment state of the mobile equipment is detected through the designated daemon and whether the mobile equipment is abnormal or not is judged, if so, a test case script for maintaining the mobile equipment is obtained from the true machine test platform according to the information of the mobile equipment, and the test case script is analyzed and executed, so that the maintenance operation of the mobile equipment is realized. Because the appointed daemon is started in a mode of not suspending operation, even if the mobile equipment is in an abnormal state of USB connection disconnection or automatic closing of a developer mode, the appointed daemon can still be in an operation state, so that the state of the mobile equipment can be continuously monitored, and corresponding test case scripts can be acquired and executed aiming at the abnormal state, so that automatic maintenance of the mobile equipment is realized.
The mobile device mentioned above may include a smart mobile terminal such as a mobile phone, a tablet computer, a smart watch, etc., on which an operating system may be mounted and which has the capability of accessing the internet. Preferably, an Android system is mounted on the mobile device. The proxy server may be a PC proxy that connects with the background heartbeat of the real machine test platform after start-up, i.e. by a heartbeat mechanism to ensure the validity of the communication connection between the proxy server and the real machine test platform.
In step S102 above, the mobile device may connect with the proxy server through the adb command.
In one mode, the mobile device may connect to the proxy server using a USB data line, then enable USB debug in the mobile device, and input an adb device command in a command line of the proxy server, to establish a communication connection between the mobile device and the proxy server, so as to debug the mobile device through the proxy server.
In another manner, the mobile device may connect to the proxy server using a WiFi network, obtain the IP address of the mobile device, and then execute an adb connect command in the proxy server, and through the IP address and the port number (typically 5555) of the mobile device, a communication connection between the mobile device and the proxy server may be established, so as to debug the mobile device through the proxy server.
In an alternative embodiment, the daemon is designated as a java daemon. At this time, the step of starting the specified daemon in the mobile device by the proxy server in such a way that it does not hang up may be further implemented as:
the target dex file is run in the mobile device by the nohup command of the adb process of the proxy server to start the java daemon.
The Nohup Command runs a Command specified by the Command parameter and any associated Arg parameter, causing the process to ignore all pending SIGHOP signals and continue running. The Dex file is a binary stream file format which can be executed and loaded by a Dalvik Virtual Machine (DVM) or an ART (Android run time) virtual machine, compared with a class file, redundant information is removed, class information of the whole java engineering is integrated, the file size is small, and the loading speed is high.
The Android application layer is realized by Java and kotlen programming languages, and a compiler compiles the Java and kotlen languages into Java bytecodes and then converts the bytecodes into corresponding dex files when compiling the Android application. The dex file can be directly operated by the command dalvikvm of the dalvik virtual machine in the Android system, and the Android system supports the nohup command. One code example for starting a java process by an adb command in an Android system is listed below:
adb shell“nohup dalvikvm-cp/data/local/tmp/traget.dex com.abc.opentest.main>/dev/null 2>&1&”
the java process started by the nohup command can still be in an operating state even if the USB connection of the mobile device is disconnected or the developer mode is closed.
Further, the above-mentioned target dex file is formed by converting an executable jar package containing device status monitoring and test case script execution logic through an Android SDK (Software Development Kit ) and is configured in the mobile device in advance.
The process of generating and configuring the target dex file is described below with reference to the apk (Android Package) construction flowchart of the Android system shown in fig. 2.
Referring to fig. 2, in a typical apk construction flow, first, the resource files under the res folder of the java project are packaged into r.java files and resources.arsc files by a AAPT (Android Asset Packaging Tool) tool, and if there is an aidl, the aidl interface is converted into a java interface class by an aidl tool. Then, R.java and aidl.java are compiled into class files by a java compiler. And then, packaging the source code class file and a third party jar or library into a dex file through dx.bat. The apkbuilder tool then packages all uncompiled resources (assets, so, jni), resources. Finally, the apk is signed by using a jarsigner tool through the configured signature file (Debug or Release Keystore, debugging or publishing key library) to obtain a signed apk (signed apk), and then the zipalign tool is used for aligning and optimizing the signed apk, so that the speed of accessing the apk file through memory mapping is faster, and the use of a memory in running is reduced.
Specifically, for the target dex file in the embodiment of the present invention, a java project is first created, and after service logic including equipment status monitoring and test case script execution logic is implemented according to the above construction flow, an executable jar package source. Jar is generated. The executable jar package is then converted to a dex package by the dx.bat tool in the Android SDK. The following is one code example of converting the executable jar packet into a dex packet by the Android SDK tool:
//\SDK\build-tools\27.0.3\dx.bat
dx--dex--output=traget.dex source.jar
in step S104 above, the current device state of the mobile device is detected by the specified daemon, and it is determined whether the current device state is abnormal.
The current device state of the mobile device is preferably detected periodically by a designated daemon to enable state monitoring of the mobile device. The detection period of the device state can be set according to actual needs, such as 1 hour, 10 minutes, etc., which is not limited by the present invention.
Preferably, determining whether the current device state is abnormal may be further implemented as:
judging whether the USB connection of the mobile device is broken; and/or
It is determined whether the developer mode of the mobile device is automatically turned off.
For example, when a prompt showing that the USB connection is disconnected is detected, but the plugging operation of the USB data line is not detected, it may be determined that the USB connection of the mobile device is disconnected. For another example, when a prompt is detected that the developer mode has been turned off, but a user's turn-off operation of the developer mode option is not detected, it may be determined that the developer mode of the mobile device has been automatically turned off.
In an alternative embodiment, after detecting the current device state of the mobile device by the specified daemon, the current device state of the mobile device may also be reported to the real machine test platform, specifically to the background system of the real machine test platform.
In the foregoing embodiments, the current device state is detected by a specified daemon within the mobile device and a determination is made as to whether the current device state is abnormal. In another alternative embodiment, after reporting the current device state of the mobile device to the real machine test platform, the real machine test platform may determine whether the current device state is abnormal, and return the determination result to the designated daemon. In this embodiment, the operation and basis for determining whether the current device status is abnormal are the same as those described above, and are not described herein.
In step S106, if it is determined that the current device status is abnormal, the test case script for maintaining the mobile device is obtained from the real machine test platform according to the information of the mobile device through the specified daemon. The test case script is preconfigured in a background system of the real machine test platform and is realized by adopting a custom script rule. The information of the mobile device referred to herein may include the mobile device vendor, operating system version, etc.
In an alternative embodiment, the test case script is in json format. json (JavaScript Object Notation, json object numbered musical notation) is a lightweight data exchange format, and data is stored and represented by adopting a text format completely independent of a programming language, so that the json (JavaScript Object Notation) is easy to read and write by people, and is easy to analyze and generate by machines, and the network transmission efficiency is effectively improved.
In an alternative embodiment, the test case script is preconfigured in the real machine test platform based on the device model, operating system version, and/or device exception type. At this time, the step of acquiring the test case script for maintaining the mobile device from the real machine test platform according to the information of the mobile device by the specified daemon may be further implemented as follows:
and acquiring a test case script for maintaining the mobile device from the real machine test platform according to the abnormal type of the current device state, the model of the mobile device and/or the operating system version of the mobile device by designating the daemon. The types of exceptions to the current device state referred to herein may include USB connection disconnection and/or developer mode auto-off.
In step S108, the test case script is parsed and executed by the specified daemon to maintain the mobile device.
In an alternative embodiment, the test case script is automatically executed by an automated test framework to maintain the mobile device.
Preferably, the maintenance operation of the mobile device is automatically performed by simulating the user operation by specifying the method name and the parameter in the test case script. The simulated user operation may include at least one of a hibernation, a slide screen, a click, etc. One example of a test case script for maintaining a mobile device in an abnormal state is listed below:
[
{"function":"sleep","params":[2],"expects":[]},
{"function":"swipe","params":[613,1264,690,566],"expects":[]},
{"function":"sleep","params":[2],"expects":[]},
{"function":"swipe","params":[654,1246,699,244],"expects":[]},
{"function":"sleep","params":[2],"expects":[]},
{"function":"swipe","params":[684,1130,277,0],"expects":[]},
{"function":"sleep","params":[4],"expects":[]},
{"function":"swipe","params":[464,721,464,721],"expects":[]},
{"function":"sleep","params":[11],"expects":[]},
{"function":"clickbymd5","params":["29ecb03e5763e493717649999bf35e68"],"expects":[]}
]
because the processing of equipment abnormality problems such as USB connection disconnection, automatic closing of a developer mode and the like usually has fixed processing steps, a series of user operations are simulated by appointed method names and parameters in the test case script, when the equipment abnormality is found, the automatic maintenance of the abnormal equipment can be realized only by acquiring and executing the test case script, no special maintenance personnel is needed, the labor cost is greatly saved, and the maintenance efficiency is improved.
In an alternative embodiment, the method of the present invention may further comprise the steps of:
if the current equipment state is judged to be abnormal, the appointed daemon is made to wait for the next detection of the current equipment state of the mobile equipment.
Having described various implementations of the links of the embodiment shown in fig. 1, the implementation procedure of the method for managing mobile devices on a real machine test platform of the present invention will be described in detail by using a specific embodiment.
Fig. 3 is a flow chart of a method for managing mobile devices on a testing platform of a real machine according to an embodiment of the invention. In this embodiment, a method for managing mobile devices on a true machine test platform is specifically described by combining a mobile device end, a proxy server and the true machine test platform. In this embodiment, the mobile device is a mobile phone, and the proxy server is a PC proxy. Referring to fig. 3, the method is applied to a mobile phone end, and at least may include the following steps S302 to S310.
In step S302, a connection is established with the PC agent through an adb command using USB.
Specifically, the mobile phone is connected with the PC by using a USB data line, then USB debugging is started in the mobile phone, and an adb device command is input in a command line of the PC agent, so that connection can be established.
Step S304, the target dex file is operated in the mobile phone through the nohup command of the adb process of the PC agent so as to start the java daemon.
When the java daemon is started, initializing the execution environment of the mobile phone terminal.
Step S306, the current mobile phone state is detected regularly through the java daemon, and whether the current mobile phone state is abnormal or not is judged.
Specifically, judging whether the USB connection of the mobile phone is broken; and/or judging whether the developer mode of the mobile phone is automatically closed.
Step S308, if the current mobile phone state is abnormal, acquiring a test case script from the real-machine test platform through the java daemon according to the equipment model, the operating system version and the mobile phone abnormal type of the mobile phone.
The test case script is preconfigured in the real machine test platform according to the equipment model, the operating system version and/or the equipment abnormality type.
Specifically, the abnormal type of the mobile phone comprises USB connection disconnection and/or automatic shutdown of a developer mode.
Step S310, the java daemon process analyzes the test case script and executes the test utilization script through the automatic test framework to maintain the mobile phone.
In this embodiment, before the connection between the mobile phone and the PC agent is established, after the PC agent is started, the PC agent is connected with the real machine test platform through heartbeat, that is, the validity of the communication connection between the proxy server and the real machine test platform is ensured through a heartbeat mechanism.
According to the embodiment of the invention, the java daemon is started through the nohup command, and the mobile equipment can still be in the running state even after the USB connection of the mobile equipment is disconnected or the developer mode is closed, so that the equipment state can be effectively monitored and the test case script for maintenance can be executed. Meanwhile, the test case script which is pre-configured for different mobile equipment models, system versions and abnormal types is obtained from the real machine test platform according to the abnormal type of the current equipment state, the model of the mobile equipment and/or the operating system version of the mobile equipment, so that the problem of the abnormal state with fixed processing steps can be accurately and automatically processed by executing the test case script.
Based on the same inventive concept, the embodiment of the invention also provides a management device of the mobile device on the real machine test platform, which is used for supporting the management method of the mobile device on the real machine test platform provided by any one embodiment or combination thereof. Fig. 4 is a schematic structural diagram of a management apparatus for a mobile device on a testing platform of a real machine according to an embodiment of the present invention. Referring to fig. 4, the apparatus may be applied to a mobile device, and may include at least: a process start module 410, a state detection module 420, a script acquisition module 430, and a script parsing execution module 440.
The functions of each component or device of the management apparatus of the mobile device on the real machine test platform according to the embodiment of the present invention are described below, and the connection relationship between each part is:
the process initiation module 410 is adapted to initiate a specified daemon in a mobile device through a proxy server in a manner that does not suspend operation after the mobile device is connected to the proxy server.
The state detection module 420 is connected to the process start module 410, and is adapted to detect the current device state of the mobile device through the specified daemon, and determine whether the current device state is abnormal.
The script acquisition module 430 is connected to the state detection module 420, and is adapted to acquire, if it is determined that the current device state is abnormal, a test case script for maintaining the mobile device from the real machine test platform according to the information of the mobile device through the specified daemon.
The script parsing execution module 440, connected to the script acquisition module 430, is adapted to parse and execute the test case script through the specified daemon process to maintain the mobile device.
In an alternative embodiment, designating the daemon as a java daemon, the process initiation module 410 is further adapted to:
the target dex file is run in the mobile device by the nohup command of the adb process of the proxy server to start the java daemon.
Further, the target dex file is formed by converting an executable jar package containing equipment state monitoring and test case script execution logic through an Android software development kit, and is configured in the mobile equipment in advance.
In an alternative embodiment, the mobile device connects to the proxy server via an adb command using USB or WiFi.
In an alternative embodiment, the status detection module 420 is further adapted to:
the current device state of the mobile device is periodically detected by the designated daemon.
In an alternative embodiment, the status detection module 420 is further adapted to:
judging whether the USB connection is broken; and/or
It is determined whether the developer mode is automatically turned off.
In an alternative embodiment, the status detection module 420 is further adapted to:
and after detecting the current equipment state of the mobile equipment, reporting the current equipment state of the mobile equipment to a true machine test platform.
In an alternative embodiment, where the test case script is preconfigured in the real machine test platform according to the device model, operating system version, and/or device exception type, the script acquisition module 430 is further adapted to:
and acquiring a test case script for maintaining the mobile device from the real machine test platform according to the abnormal type of the current device state, the model of the mobile device and/or the operating system version of the mobile device by designating the daemon.
In an alternative embodiment, the test case script is in json format.
In an alternative embodiment, the script parsing execution module 440 is further adapted to:
and simulating user operation by specifying the method name and the parameter in the test case script.
Further, the user operation includes at least one of:
sleep, slide screen, click.
In an alternative embodiment, the script parsing execution module 440 is further adapted to:
and executing the test case script through the automatic test framework.
In an alternative embodiment, as shown in fig. 5, the management apparatus of the mobile device on the real machine test platform illustrated in fig. 4 may further include a process waiting module 450. The process waiting module 450 is connected to the state detection module 420, and is adapted to, if it is determined that the current device state is not abnormal, make the designated daemon wait for the next detection of the current device state of the mobile device.
Based on the same inventive concept, the embodiment of the invention also provides a computer storage medium. The computer storage medium stores computer program code which, when run on a computing device, causes the computing device to perform a method of managing mobile devices on a real machine test platform according to any one or a combination of the above embodiments.
Based on the same inventive concept, the embodiment of the invention also provides a computing device. The computing device may include:
a processor; and
a memory storing computer program code;
the computer program code, when executed by a processor, causes the computing device to perform a method of managing mobile devices on a real machine test platform according to any one or a combination of the embodiments described above.
According to any one of the optional embodiments or the combination of multiple optional embodiments, the following beneficial effects can be achieved according to the embodiment of the invention:
according to the management method and the device for the mobile equipment on the real machine test platform, when the mobile equipment is on line on the real machine test platform, the designated daemon is started in the mobile equipment in a mode of not suspending operation through the proxy server, and then the current equipment state of the mobile equipment is detected through the designated daemon and whether the mobile equipment is abnormal or not is judged, if so, a test case script for maintaining the mobile equipment is obtained from the real machine test platform according to the information of the mobile equipment, and the test case script is analyzed and executed, so that the maintenance operation of the mobile equipment is realized. Because the appointed daemon is started in a mode of not suspending operation, even if the mobile equipment is in an abnormal state of USB connection disconnection or automatic closing of a developer mode, the appointed daemon can still be in an operation state, so that the state of the mobile equipment can be continuously monitored, and corresponding test case scripts can be acquired and executed aiming at the abnormal state, so that automatic maintenance of the mobile equipment is realized.
Further, by acquiring pre-configured test case scripts for different mobile device models, system versions and exception types from the real machine test platform according to the exception type of the current device state, the model of the mobile device and/or the operating system version of the mobile device, and simulating a series of user operations in the test case scripts by specifying method names and parameters, accurate automatic processing of the exception state problem with fixed processing steps can be achieved by executing the test case scripts.
It will be clear to those skilled in the art that the specific working procedures of the above-described systems, devices and units may refer to the corresponding procedures in the foregoing method embodiments, and are not repeated herein for brevity.
In addition, each functional unit in the embodiments of the present invention may be physically independent, two or more functional units may be integrated together, or all functional units may be integrated in one processing unit. The integrated functional units may be implemented in hardware or in software or firmware.
Those of ordinary skill in the art will appreciate that: the integrated functional units, if implemented in software and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in essence or in whole or in part in the form of a software product stored in a storage medium, comprising instructions for causing a computing device (e.g., a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present invention when the instructions are executed. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a read-only memory (ROM), a random-access memory (RAM), a magnetic disk, or an optical disk, etc.
Alternatively, all or part of the steps of implementing the foregoing method embodiments may be implemented by hardware (such as a personal computer, a server, or a computing device such as a network device) associated with program instructions, where the program instructions may be stored on a computer-readable storage medium, and where the program instructions, when executed by a processor of the computing device, perform all or part of the steps of the method according to the embodiments of the present invention.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all technical features thereof can be replaced by others within the spirit and principle of the present invention; such modifications and substitutions do not depart from the scope of the invention.

Claims (26)

1. A management method of mobile equipment on a true machine test platform is applied to a mobile equipment end and comprises the following steps:
after the mobile equipment is connected with a proxy server, a designated daemon is started in the mobile equipment in a mode of not suspending operation through the proxy server;
detecting the current equipment state of the mobile equipment through the appointed daemon, and judging whether the current equipment state is abnormal or not;
if yes, acquiring a test case script for maintaining the mobile equipment from the real machine test platform according to the information of the mobile equipment through the appointed daemon;
analyzing and executing the test case script through the appointed daemon to maintain the mobile equipment;
wherein maintaining the mobile device comprises:
and simulating user operation in the test case script through the specified method name and parameters.
2. The method of claim 1, wherein the designated daemon is a java daemon;
starting a specified daemon in the mobile device by the proxy server in a manner that does not suspend operation, comprising:
and running a target dex file in the mobile equipment through a nohup command of an adb process of the proxy server so as to start the java daemon.
3. The method of claim 2, wherein the target dex file is converted by an Android software development kit into an executable jar package containing device state monitoring and test case script execution logic and is pre-configured in the mobile device.
4. The method of claim 1, wherein the mobile device connects to the proxy server via an adb command using USB or WiFi.
5. The method of claim 1, wherein detecting, by the designated daemon, a current device state of the mobile device comprises:
the current device state of the mobile device is periodically detected by the specified daemon.
6. The method of claim 1, wherein determining whether the current device state is abnormal comprises:
judging whether the USB connection is broken; and/or
It is determined whether the developer mode is automatically turned off.
7. The method of claim 1, wherein upon detecting a current device state of the mobile device, further comprising:
and reporting the current equipment state of the mobile equipment to the real machine test platform.
8. The method of claim 1, wherein the test case script is preconfigured in the native test platform according to a device model, an operating system version, and/or a device exception type;
acquiring, by the specified daemon, a test case script for maintaining the mobile device from the real machine test platform according to information of the mobile device, including:
and acquiring a test case script for maintaining the mobile device from the real machine test platform according to the abnormal type of the current device state, the model of the mobile device and/or the operating system version of the mobile device through the appointed daemon.
9. The method of claim 1, wherein the test case script is json format.
10. The method of claim 1, wherein the user operation comprises at least one of:
sleep, slide screen, click.
11. The method of claim 1, wherein executing the test case script comprises:
and executing the test case script through an automatic test framework.
12. The method of any of claims 1-11, further comprising:
and if the current equipment state is judged to be abnormal, the appointed daemon waits for the next detection of the current equipment state of the mobile equipment.
13. A management device of mobile equipment on a true machine test platform is applied to a mobile equipment end and comprises:
the process starting module is suitable for starting a designated daemon in the mobile equipment in a mode of not suspending operation through the proxy server after the mobile equipment is connected with the proxy server;
the state detection module is suitable for detecting the current equipment state of the mobile equipment through the appointed daemon and judging whether the current equipment state is abnormal or not;
the script acquisition module is suitable for acquiring a test case script for maintaining the mobile equipment from the real machine test platform according to the information of the mobile equipment through the appointed daemon if the current equipment state is abnormal; and
the script analysis execution module is suitable for analyzing and executing the test case script through the appointed daemon so as to maintain the mobile equipment;
wherein the script parsing execution module is further adapted to:
and simulating user operation in the test case script through the specified method name and parameters.
14. The apparatus of claim 13, wherein the designated daemon is a java daemon;
the process start module is further adapted to:
and running a target dex file in the mobile equipment through a nohup command of an adb process of the proxy server so as to start the java daemon.
15. The apparatus of claim 14, wherein the target dex file is converted by an Android software development kit into an executable jar package containing device state monitoring and test case script execution logic and is pre-configured in the mobile device.
16. The apparatus of claim 13, wherein the mobile device connects to the proxy server via an adb command using USB or WiFi.
17. The apparatus of claim 13, wherein the status detection module is further adapted to:
the current device state of the mobile device is periodically detected by the specified daemon.
18. The apparatus of claim 13, wherein the status detection module is further adapted to:
judging whether the USB connection is broken; and/or
It is determined whether the developer mode is automatically turned off.
19. The apparatus of claim 13, wherein the status detection module is further adapted to:
and after detecting the current equipment state of the mobile equipment, reporting the current equipment state of the mobile equipment to the real machine test platform.
20. The apparatus of claim 13, wherein the test case script is preconfigured in the native test platform according to a device model, an operating system version, and/or a device exception type;
the script acquisition module is further adapted to:
and acquiring a test case script for maintaining the mobile device from the real machine test platform according to the abnormal type of the current device state, the model of the mobile device and/or the operating system version of the mobile device through the appointed daemon.
21. The apparatus of claim 13, wherein the test case script is json format.
22. The apparatus of claim 13, wherein the user operation comprises at least one of:
sleep, slide screen, click.
23. The apparatus of claim 13, wherein the script parsing execution module is further adapted to:
and executing the test case script through an automatic test framework.
24. The apparatus of any of claims 13-23, further comprising:
and the process waiting module is suitable for enabling the appointed daemon to wait for next detection of the current equipment state of the mobile equipment if the current equipment state is judged not to be abnormal.
25. A computer storage medium storing computer program code which, when run on a computing device, causes the computing device to perform a method of managing mobile devices on a real machine test platform according to any one of claims 1-12.
26. A computing device, comprising:
a processor; and
a memory storing computer program code;
the computer program code, when executed by the processor, causes the computing device to perform the method of managing mobile devices on a real machine test platform according to any one of claims 1-12.
CN201811626410.1A 2018-12-28 2018-12-28 Management method and device for mobile equipment on true machine test platform Active CN111382048B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811626410.1A CN111382048B (en) 2018-12-28 2018-12-28 Management method and device for mobile equipment on true machine test platform

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811626410.1A CN111382048B (en) 2018-12-28 2018-12-28 Management method and device for mobile equipment on true machine test platform

Publications (2)

Publication Number Publication Date
CN111382048A CN111382048A (en) 2020-07-07
CN111382048B true CN111382048B (en) 2023-10-20

Family

ID=71222146

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811626410.1A Active CN111382048B (en) 2018-12-28 2018-12-28 Management method and device for mobile equipment on true machine test platform

Country Status (1)

Country Link
CN (1) CN111382048B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111880849A (en) * 2020-07-21 2020-11-03 深圳创维-Rgb电子有限公司 Intelligent log control processing method and device for platform
CN111881519B (en) * 2020-07-31 2022-08-05 广州文远知行科技有限公司 Automatic driving test method and device, computer equipment and storage medium
CN112328467B (en) * 2020-09-17 2022-06-28 北京中数科技术有限公司 Embedded system program testing method and device
CN112433938A (en) * 2020-11-18 2021-03-02 京东数科海益信息科技有限公司 Method and device for testing application of mobile terminal
CN113467861A (en) * 2021-07-16 2021-10-01 腾讯科技(深圳)有限公司 File calling method and device, storage medium and electronic equipment
CN115952100A (en) * 2023-01-10 2023-04-11 北京百度网讯科技有限公司 Interface test method, device, system, electronic equipment and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105357030A (en) * 2015-09-30 2016-02-24 北京奇虎科技有限公司 Offline recovery method, device and system for terminal equipment on test platform
CN105512033A (en) * 2015-12-02 2016-04-20 厦门美图移动科技有限公司 Automated testing method and device of mobile terminal and mobile terminal
CN105516429A (en) * 2015-12-07 2016-04-20 腾讯科技(深圳)有限公司 Method and system for processing offline of terminal
CN106506658A (en) * 2016-11-21 2017-03-15 济南浪潮高新科技投资发展有限公司 A kind of method for retaining remote opening service
CN107122306A (en) * 2017-05-15 2017-09-01 网易(杭州)网络有限公司 Automated testing method and device, storage medium, electronic equipment
CN107463499A (en) * 2017-08-08 2017-12-12 百度在线网络技术(北京)有限公司 The long-range connection methods of ADB, device, equipment and storage medium
WO2018006702A1 (en) * 2016-07-05 2018-01-11 中兴通讯股份有限公司 Abnormality processing method, apparatus and system in automation test
WO2018045767A1 (en) * 2016-09-07 2018-03-15 中兴通讯股份有限公司 Terminal control method and apparatus, and user terminal

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105357030A (en) * 2015-09-30 2016-02-24 北京奇虎科技有限公司 Offline recovery method, device and system for terminal equipment on test platform
CN105512033A (en) * 2015-12-02 2016-04-20 厦门美图移动科技有限公司 Automated testing method and device of mobile terminal and mobile terminal
CN105516429A (en) * 2015-12-07 2016-04-20 腾讯科技(深圳)有限公司 Method and system for processing offline of terminal
WO2018006702A1 (en) * 2016-07-05 2018-01-11 中兴通讯股份有限公司 Abnormality processing method, apparatus and system in automation test
WO2018045767A1 (en) * 2016-09-07 2018-03-15 中兴通讯股份有限公司 Terminal control method and apparatus, and user terminal
CN106506658A (en) * 2016-11-21 2017-03-15 济南浪潮高新科技投资发展有限公司 A kind of method for retaining remote opening service
CN107122306A (en) * 2017-05-15 2017-09-01 网易(杭州)网络有限公司 Automated testing method and device, storage medium, electronic equipment
CN107463499A (en) * 2017-08-08 2017-12-12 百度在线网络技术(北京)有限公司 The long-range connection methods of ADB, device, equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Remote mobile test system: a mobile phone cloud for application testing;Jun-fei Huang等;4th IEEE International Conference on Cloud Computing Technology and Science Proceedings;587-590 *
移动终端设备管理技术的研究与实现;杭建;中国优秀硕士学位论文全文数据库 信息科技辑;I139-42 *

Also Published As

Publication number Publication date
CN111382048A (en) 2020-07-07

Similar Documents

Publication Publication Date Title
CN111382048B (en) Management method and device for mobile equipment on true machine test platform
US10606739B2 (en) Automated program code analysis and reporting
US9355017B2 (en) Automated error checking system for a software application and method therefor
US7900198B2 (en) Method and system for parameter profile compiling
US20110197097A1 (en) Incremental problem determination and resolution in cloud environments
CN107451474B (en) Software bug fixing method and device for terminal
CN110046479B (en) Link library file anti-debugging method and device based on android operating system
US9378122B2 (en) Adopting an existing automation script to a new framework
WO2018108041A1 (en) Remote debugging method and device, and computer storage medium
CN110955409B (en) Method and device for creating resources on cloud platform
CN104375938A (en) Dynamic behavior monitoring method and system for Android application program
CN106648762B (en) Method and device for building development environment
US8621438B2 (en) Generating debug information on demand
US20080127118A1 (en) Method and system for dynamic patching of software
US11429379B2 (en) Software checkpoint-restoration between distinctly compiled executables
US9841960B2 (en) Dynamic provision of debuggable program code
CN111258802A (en) Method for capturing application program crash information and related equipment
CN115168175A (en) Program error solving method, device, electronic equipment and storage medium
CN115756424A (en) Method, device and equipment for generating MVP (multifunction vehicle platform) code
US20150007139A1 (en) Optimizing error parsing in an integrated development environment
CN113626307A (en) Data verification method and device based on K8S container platform
Zakharov et al. Compositional environment modelling for verification of GNU C programs
KR102369345B1 (en) Method for managing mobile applications in virtual machine
US11520614B2 (en) Operating system-agnostic container runtime
Plewnia A Framework for Regression Test Prioritization and Selection

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20230921

Address after: Room 03, 2nd Floor, Building A, No. 20 Haitai Avenue, Huayuan Industrial Zone (Huanwai), Binhai New Area, Tianjin, 300450

Applicant after: 3600 Technology Group Co.,Ltd.

Address before: 100088 room 112, block D, 28 new street, new street, Xicheng District, Beijing (Desheng Park)

Applicant before: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant