Recorder is a tool designed for the Lynx framework to facilitate the recording and replay of page runtime states. Its core functionality involves precisely capturing the complete state of a page at a specific moment and serializing it into a portable recording file for subsequent high-fidelity replay.
Unlike traditional screen recording technologies, Recorder achieves "Deterministic Replay." During the replay process, the system not only reconstructs the complete UI hierarchy and rendering data from the time of recording but also preserves all page interactivity. Crucially, it achieves temporal consistency by hijacking and mocking time-related APIs, ensuring that time-sensitive operations within the replayed environment yield the same results as they did during the original session.
Recorder features cross-device replay capabilities. Through its integrated Replayer decoder, a recording file can be parsed and replayed on any device that supports the Lynx framework, regardless of hardware model or operating system. For instance, a session recorded on an iPad can be accurately reproduced on an iPhone, an Android device, or even on desktop and TV applications built with the same Lynx technology stack.
As an application's feature set expands, Lynx pages often become tightly coupled with the native application environment. This includes dependencies on custom NativeModules or private cloud services for data and resource management.
When diagnosing complex issues, this strong coupling becomes a major impediment to external collaboration and debugging, leading to problems such as build failures, complex authentication procedures, and inaccessible backend services. In such scenarios, traditional methods like code review are inefficient, while source-level debugging is often impractical due to environmental discrepancies. A core design objective of Recorder is to decouple the page from its private environment. A recording file encapsulates all information required for the page to run, including the view hierarchy, data state, and responses from asynchronous requests. During replay, all external dependencies are simulated using the data contained within the recording file, eliminating the need for any live network requests. This makes the debugging process entirely independent of the original production environment. Technical Advantages:
Recorder's record and replay capabilities are already integrated by default in LynxExplorer. You can follow the steps below to experience them.
Please visit LynxExplorer and follow the documentation to run LynxExplorer app locally.
It is especially important to note that, in order to ensure the completeness of the recorded page data, please make sure to click Start before navigating to the target page.
Here is a sample page that you can access by scanning the QR code or entering the link in LynxExplorer.
After stopping the record, the Recorder dashboard will automatically retrieve the recorded artifact from your device and provide a preview image to help you easily identify the target page.
The Lynx DevTool Application only provides local file hosting for each recorded artifact. If you need to share the record artifact or access it across devices, you will need to host the artifact separately.
Here is a sample recorded artifact that you can replay by scanning the QR code or entering the link in LynxExplorer.
It is especially important to note that if you are using a self-hosted artifact URL for replay, you need to append the Recorder Header to the artifact URL to indicate that the artifact is from Recorder.
Original artifact URL:
Append the Recorder Header:
LynxExplorer can fully reproduce the recorded page.
Since the record and replay process of Recorder covers the entire rendering process of Lynx and requires support from the underlying Lynx engine, we have released a separate dev version apart from the official Lynx release to prevent these record-related codes from affecting production environments. If you want to integrate Recorder, you need to change the version numbers of both Lynx and LynxDevtool in your project to the corresponding dev versions. integrate lynx dev version
The record capability can be integrated simply by using the dev version, with no additional adaptation required.
Recorder provides a highly encapsulated replay module, which is integrated into your application together with LynxDevTool. You only need to provide a simple entry point as described below.
LynxRecorder is written in Objective-C. If you want to call its methods from a Swift project, you need to provide a corresponding bridge file as described in Importing Objective-C into Swift.
Add the following content to the bridge file: