http://www.robotium.cn/archives/995
The method of recording playback is probably understood below, the general realization principle is:
1. Based on the coordinate implementation, Monkeyrunner is the main representative. By capturing the screen, zooming and parsing the action point, the Monkeyrunner method is less efficient, and the root phone can be improved using patterns like Gsnap, In addition, the Python script adds additional language complexity to the Java-developed Android. There are also different phone devices that have an irregular response time, which results in poor script execution lines. But you can record across apps.
2. Use ASJECTJ for recording. Through the weaving of the class file, to monitor similar onclick and other events and record, for the active code of the app is easier to implement, compile the apk when the weaving can be. Only apk mode, The jar needs to be disassembled, and then the jar is weaving and then compiled back to the APK implementation, for cannot decompile the jar, cannot use. True for a single app.
3. Get event information resolved through GetEvent. By parsing the event type, you can monitor the phone's operation or across apps. The implementation form is also resolved into coordinate points, which is another way to obtain coordinate points.
4. By modifying the event-handling Baidu Cafe, intercept all events and add log records.
5. Also see the data that JDPA monitor VM StackFrame resolved.
Go Android Recording Playback principle