CN108153531A - A kind of method that compiling automatically based on Android UiAutomator tools quickly runs - Google Patents

A kind of method that compiling automatically based on Android UiAutomator tools quickly runs Download PDF

Info

Publication number
CN108153531A
CN108153531A CN201711459623.5A CN201711459623A CN108153531A CN 108153531 A CN108153531 A CN 108153531A CN 201711459623 A CN201711459623 A CN 201711459623A CN 108153531 A CN108153531 A CN 108153531A
Authority
CN
China
Prior art keywords
compiling
build
uiautomator
test
android
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.)
Withdrawn
Application number
CN201711459623.5A
Other languages
Chinese (zh)
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.)
Shenzhen Soling Industrial Co Ltd
Original Assignee
Shenzhen Soling Industrial 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 Shenzhen Soling Industrial Co Ltd filed Critical Shenzhen Soling Industrial Co Ltd
Priority to CN201711459623.5A priority Critical patent/CN108153531A/en
Publication of CN108153531A publication Critical patent/CN108153531A/en
Withdrawn legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3624Software debugging by performing operations on the source code, e.g. via a compiler
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3644Software debugging by instrumenting at runtime

Abstract

The invention discloses a kind of methods that compiling automatically based on Android UiAutomator tools quickly runs, it is characterised in that:This method integrates the action of entire compilation run, greatly shortens the time for compiling packing in exploitation, so as to fulfill quick compiling and debugging;Particularly Resealed by way of secondary encapsulation function for specific equipment, the readability of code in this way greatly enhances, this technology is intended to integrate the action of entire compilation run, greatly shorten the time for compiling packing in exploitation, so as to fulfill quick compiling and debugging, shorten the time of developer's running tool and the readability of enhancing test code, be conducive to the maintenance of later stage code, there is extensive market economy value.

Description

What a kind of automatic compiling based on Android UiAutomator tools was quickly run Method
Technical field
The present invention relates to a kind of methods that automatic compiling is quickly run, specially a kind of to be based on Android UiAutomator tools compile the method quickly run automatically.
Background technology
UiAutomator is a for testing the automated test frame of Android system, is that a Java that is used for is compiled The UI test frames write.Since this tool is had to operate in certain environment (Ecplise, Android Studio), by Apache-ant tools generate jar testing results codes, therefore from compile, be packaged, push it is whole into Android system, operation etc. A process is very cumbersome, and often changes, runs primary test code, will again perform whole flow process one time, greatly wave Take the time of developer.
Invention content
The purpose of the present invention is to provide a kind of quick operations of automatic compiling based on Android UiAutomator tools Method, to realize that operational process mentioned above in the background art is very cumbersome, and often change, run primary test generation Code will again perform whole flow process one time, the problems such as time of significant wastage developer.
To achieve the above object, the present invention provides following technical solution:One kind is based on Android UiAutomator tools Compile the method quickly run automatically, it is characterised in that:This method integrates the action of entire compilation run, greatly shortens The time of packing is compiled in exploitation, so as to fulfill quick compiling and debugging;The particularly needle by way of secondary encapsulation function Specific equipment is Resealed, the readability of such code greatly enhances, and can be very good maintenance test code;
Specific steps are as follows:
Step 1: write test case:Test class in UiAutomator will inherit UiAutomatorTestCase, The method name of the method for each test case will be started with test;
Step 2: create build files:Androidcreateuitest-project-n<prjname>-t< Android-sdk-ID>-p<workspace path>
- n is engineering name, and (order line runs Android list to the id that-p is SDK used in engineered paths-t is, looks into See the corresponding id of api level that needs compile);
Step 3: modification build files:Engineering catalogue is opened, finds build.xml files, the help of the 2nd row is changed For build;
Step 4: starting to compile, using ant, generation jar is packaged by build.xml
Ant-buildfile<Build.xml file paths>
Step 5: push jar packets are to mobile phone
Adb push<project.jar>/data/local/tmp/
Step 6: testing results
Adb shell uiatumator runtest<project.jar>-c<Packet name>.<Class name>[#test name]
Step 7: the operating procedure based on above-mentioned UiAutomator, the step of being repeated using script two ..., step 6 was sealed It loads.
Step 8: using existing wscript.exe UiAutomatorhelper, it is automatic perform from create build files to A series of actions of Run Script;The directly operation and debugging script on ECLipese again later (script is shown in Figure of description 1).
Compared with prior art, the beneficial effects of the invention are as follows:This is automatic based on Android UiAutomator tools The method quickly run is compiled, since the Uiautomator API that official of Google releases can when writing automatic test code Read property than relatively low, can be Resealed by way of secondary encapsulation function for specific equipment, such code can The property read greatly enhances, and can be very good maintenance test code;This technology is intended to integrate the action of entire compilation run, greatly It is big to shorten the time for compiling packing in exploitation, so as to fulfill quick compiling and debugging, shorten developer's running tool when Between and enhancing test code readability, be conducive to the maintenance of later stage code, have extensive market economy value.
Description of the drawings
Fig. 1 is script schematic diagram of the present invention;
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present invention, the technical solution in the embodiment of the present invention is carried out clear, complete Site preparation describes, it is clear that described embodiment is only part of the embodiment of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, those of ordinary skill in the art are obtained every other without making creative work Embodiment shall fall within the protection scope of the present invention.
Referring to Fig. 1, the present invention provides a kind of technical solution:It is a kind of based on Android UiAutomator tools from It is dynamic to compile the method quickly run, it is characterised in that:This method integrates the action of entire compilation run, greatly shortens and is developing The time that middle compiling is packaged, so as to fulfill quick compiling and debugging;Particularly for spy by way of secondary encapsulation function Fixed equipment is Resealed, and the readability of such code greatly enhances, and can be very good maintenance test code;
Specific steps are as follows:
Step 1: write test case:Test class in UiAutomator will inherit UiAutomatorTestCase, The method name of the method for each test case will be started with test;
Step 2: create build files:Androidcreateuitest-project-n<prjname>-t< Android-sdk-ID>-p<workspace path>
- n is engineering name, and (order line runs Android list to the id that-p is SDK used in engineered paths-t is, looks into See the corresponding id of api level that needs compile);
Step 3: modification build files:Engineering catalogue is opened, finds build.xml files, the help of the 2nd row is changed For build;
Step 4: starting to compile, using ant, generation jar is packaged by build.xml
Ant-buildfile<Build.xml file paths>
Step 5: push jar packets are to mobile phone
Adb push<project.jar>/data/local/tmp/
Step 6: testing results
Adb shell uiatumator runtest<project.jar>-c<Packet name>.<Class name>[#test name]
Step 7: the operating procedure based on above-mentioned UiAutomator, the step of being repeated using script two ..., step 6 was sealed It loads.
Step 8: using existing wscript.exe UiAutomatorhelper, it is automatic perform from create build files to A series of actions of Run Script;The directly operation and debugging script on ECLipese again later (script is shown in Figure of description 1).
Compared with prior art, the beneficial effects of the invention are as follows:This is automatic based on Android UiAutomator tools The method quickly run is compiled, since the Uiautomator API that official of Google releases can when writing automatic test code Read property than relatively low, can be Resealed by way of secondary encapsulation function for specific equipment, such code can The property read greatly enhances, and can be very good maintenance test code;This technology is intended to integrate the action of entire compilation run, greatly It is big to shorten the time for compiling packing in exploitation, so as to fulfill quick compiling and debugging, shorten developer's running tool when Between and enhancing test code readability, be conducive to the maintenance of later stage code, have extensive market economy value.
Although the present invention is described in detail referring to the foregoing embodiments, for those skilled in the art, It still can modify to the technical solution recorded in foregoing embodiments or which part technical characteristic is carried out etc. With replacing, all within the spirits and principles of the present invention, any modification, equivalent replacement, improvement and so on should be included in this Within the protection domain of invention.

Claims (1)

1. a kind of method that compiling automatically based on Android UiAutomator tools quickly runs, it is characterised in that:We Method integrates the action of entire compilation run, greatly shortens the time for compiling packing in exploitation, so as to fulfill quick compiling and Debugging;Particularly Resealed by way of secondary encapsulation function for specific equipment, such code it is readable Property greatly enhances, and can be very good maintenance test code;
Specific steps are as follows:
Step 1: write test case:Test class in UiAutomator will inherit UiAutomatorTestCase, each The method name of the method for test case will be started with test;
Step 2: create build files:
Androidcreateuitest-project-n<prjname>-t<Android-sdk-ID>-p<workspace path >
- n is engineering name, and (order line runs Android list to the id that-p is SDK used in engineered paths-t is, checking needs The corresponding id of api level to be compiled);
Step 3: modification build files:Engineering catalogue is opened, build.xml files is found, the help of the 2nd row is revised as build;
Step 4: starting to compile, using ant, generation jar is packaged by build.xml
Ant-buildfile<Build.xml file paths>
Step 5: push jar packets are to mobile phone
Adb push<project.jar>/data/local/tmp/
Step 6: testing results
Adb shell uiatumator runtest<project.jar>-c<Packet name>.<Class name>[#test name]
Step 7: the operating procedure based on above-mentioned UiAutomator, the step of being repeated using script two ..., step 6 encapsulated Come.
Step 8: using existing wscript.exe UiAutomatorhelper, it is automatic to perform from build files are created to operation A series of actions of script;The directly operation and debugging script on ECLipese again later (script is shown in Figure of description 1).
CN201711459623.5A 2017-12-28 2017-12-28 A kind of method that compiling automatically based on Android UiAutomator tools quickly runs Withdrawn CN108153531A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711459623.5A CN108153531A (en) 2017-12-28 2017-12-28 A kind of method that compiling automatically based on Android UiAutomator tools quickly runs

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711459623.5A CN108153531A (en) 2017-12-28 2017-12-28 A kind of method that compiling automatically based on Android UiAutomator tools quickly runs

Publications (1)

Publication Number Publication Date
CN108153531A true CN108153531A (en) 2018-06-12

Family

ID=62462412

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711459623.5A Withdrawn CN108153531A (en) 2017-12-28 2017-12-28 A kind of method that compiling automatically based on Android UiAutomator tools quickly runs

Country Status (1)

Country Link
CN (1) CN108153531A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110554959A (en) * 2019-08-16 2019-12-10 苏州浪潮智能科技有限公司 apache Ant integration method, system, terminal and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104035873A (en) * 2014-06-30 2014-09-10 青岛海信电器股份有限公司 Method and device for generating testing codes
CN104331363A (en) * 2014-10-17 2015-02-04 上海斐讯数据通信技术有限公司 Automatic testing method for Android device
CN104572237A (en) * 2015-01-19 2015-04-29 上海动联信息技术股份有限公司 Automatic quick generation system and method for UKey installation package
CN106681925A (en) * 2017-01-04 2017-05-17 广州四三九九信息科技有限公司 UIAutomator-based automatic testing method and device
US20170147324A1 (en) * 2015-11-20 2017-05-25 Google Inc. Dynamic update of an application in compilation and deployment with cold-swapping
CN107193748A (en) * 2017-06-01 2017-09-22 网易(杭州)网络有限公司 Program file performs method, device, storage medium and processor

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104035873A (en) * 2014-06-30 2014-09-10 青岛海信电器股份有限公司 Method and device for generating testing codes
CN104331363A (en) * 2014-10-17 2015-02-04 上海斐讯数据通信技术有限公司 Automatic testing method for Android device
CN104572237A (en) * 2015-01-19 2015-04-29 上海动联信息技术股份有限公司 Automatic quick generation system and method for UKey installation package
US20170147324A1 (en) * 2015-11-20 2017-05-25 Google Inc. Dynamic update of an application in compilation and deployment with cold-swapping
CN106681925A (en) * 2017-01-04 2017-05-17 广州四三九九信息科技有限公司 UIAutomator-based automatic testing method and device
CN107193748A (en) * 2017-06-01 2017-09-22 网易(杭州)网络有限公司 Program file performs method, device, storage medium and processor

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
时光FLY: "Android UiAutomator环境配置与编译运行", 《HTTPS://BLOG.CSDN.NET/FENGSHIGUANG2012/ARTICLE/DETAILS/52787889》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110554959A (en) * 2019-08-16 2019-12-10 苏州浪潮智能科技有限公司 apache Ant integration method, system, terminal and storage medium

Similar Documents

Publication Publication Date Title
CN107832619B (en) Automatic application program vulnerability mining system and method under Android platform
CN104834590B (en) Method for testing software and system
CN103177210B (en) A kind of method implanting dynamic stain analysis module in Android
CN106933609B (en) Android application program installation package generation method and device
CN105260315A (en) Method for debugging log in embedded system process
CN103577324A (en) Static detection method for privacy information disclosure in mobile applications
US20150040112A1 (en) Enabling Interoperability Between Software Applications By Utilizing Partial Binaries
CN102662648B (en) A kind of embedded software developing emulation platform of communicating terminal and application thereof
CN111045668B (en) Cross-platform mobile terminal system development method and device
CN104462943A (en) Non-intrusive performance monitoring device and method for service system
CN104035778A (en) Android application program development method
CN104375938A (en) Dynamic behavior monitoring method and system for Android application program
CN105591779A (en) Method and device for inspecting network element
CN103399814A (en) Automated testing method and automated testing device
CN104991810B (en) Method and processing system in automatic addition APK to Android system
CN104102581A (en) Method and device for implementing unit testing
CN116974620A (en) Application program generation method, operation method and corresponding device
CN103699478A (en) Test case generation system and test case generation method
CN102609354A (en) C++ program remote debugging method based on GNU (GNU&#39;s Not Unix) open source software
CN108153531A (en) A kind of method that compiling automatically based on Android UiAutomator tools quickly runs
CN103455337A (en) Method for using dynamic library under Android development environment
KR101416096B1 (en) A highly compatible plug-in system for developing hybrid web applications
CN106547537B (en) Method for realizing assembled electric power application software based on QML technology
JP4836412B2 (en) Method and apparatus for generating a graphical user interface
CN110196744A (en) A method of mobile phone screen is still synchronized to the end PC after realizing App disabling screenshotss

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
WW01 Invention patent application withdrawn after publication

Application publication date: 20180612

WW01 Invention patent application withdrawn after publication