Abstract
Bugs that surface in mobile applications can be difficult to reproduce and fix due to several confounding factors including the highly GUI-driven nature of mobile apps, varying contextual states, differing platform versions and device fragmentation. It is clear that developers need support in the form of automated tools that allow for more precise reporting of application defects in order to facilitate more efficient and effective bug fixes. In this paper, we present a tool aimed at supporting application testers and developers in the process of On-Device Bug Reporting. Our tool, called ODBR, leverages the uiautomator framework and low-level event stream capture to offer support for recording and replaying a series of input gesture and sensor events that describe a bug in an Android application.
Introduction
Reproducing a bug in a mobile application is often significantly more challenging than fixing the underlying code. Mobile development faces a "reproducibility crisis" driven by extreme device fragmentation, varying sensor inputs, and complex graphical user interface (GUI) interactions. Traditional bug reports often lack the precision required for debugging, frequently consisting of vague descriptions like "the app crashed when I swiped."
Existing solutions typically fall into two categories: commercial libraries that capture screenshots but lack fine-grained interaction data, and automated testing tools that find crashes but miss subtle logic bugs. To address this gap, we introduce ODBR (On-Device Bug Reporter), an open-source tool designed to transform vague user reports into precise, replayable data. ODBR allows testers to record bug reports directly on an Android device without a tethered computer, capturing low-level touch events, sensor data, and UI hierarchies.
System Architecture and Methodology
The ODBR architecture is bifurcated into an Android recording application and a Java-based web application for reporting. The system manages the lifecycle of a bug report from initial capture to final visualization.
The on-device recording phase relies on four specialized managers:
- GetEvent Manager: Acts as a "black box" recorder by reading raw input streams directly from
/dev/input/. This enables the capture of every tap, swipe, and hardware button press with micro-second precision. - UI-Hierarchy Manager: Utilizes the
uiautomatorframework to take XML layout snapshots for every user action. This provides semantic context (e.g., "the Login button") rather than just raw coordinates. - Sensor Event Manager: Samples data from device sensors (accelerometer, GPS, etc.) to capture the environmental context.
- Screenshot Manager: Captures a visual frame for every interaction using the Android
screencaputility.
Once recording is complete, the data is bundled into a JSON document and transmitted to a CouchDB server. The Java web application then parses this document to generate human-readable reports and replayable scripts.
Actionable Bug Reporting
The primary output of ODBR is a rich, actionable bug report. Unlike standard screen recordings, ODBR provides a hybrid data set that combines low-level event data for machine replay with high-level UI hierarchy data for human interpretation.
The web interface presents:
- Rich HTML Reports: Step-by-step screenshots accompanied by natural language descriptions of user actions (e.g., "User swiped from point A to B").
- Replayable Scripts: Scripts compatible with
adbor thesendeventutility, allowing developers to recreate the exact interaction sequence on a target device automatically. - Sensor Traces: Synchronized logs of sensor data to diagnose bugs triggered by environmental changes.
Discussion and Limitations
A key innovation of ODBR is its standalone capability. Unlike previous research prototypes, ODBR does not require a USB connection during recording, allowing testers to capture bugs "in the wild" during natural usage. However, a significant limitation is that ODBR requires a rooted Android device. This requirement is necessary to access the restricted /dev/input/ event stream, which limits the tool's current application primarily to professional QA environments.
Conclusion
ODBR provides a robust framework for bridging the gap between manual bug reporting and automated reproduction. By capturing both the "what" (UI hierarchy) and the "how" (low-level events), it empowers developers with the precise context needed to resolve complex mobile application defects. Future work involves integrating ODBR with automated bug-fixing tools to verify patches using the generated replayable scripts.
Summary updated