Skip to content

Commit

Permalink
Merge branch 'main' into devx-2561-explain-env-flag
Browse files Browse the repository at this point in the history
  • Loading branch information
tianfeng92 authored Sep 25, 2023
2 parents b75c94a + 5ca26f3 commit 2cdcb04
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 9 deletions.
53 changes: 44 additions & 9 deletions docs/mobile-apps/features/mobile-app-diagnostics/app-crash-logs.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ sidebar_label: App Crash Logs

import useBaseUrl from '@docusaurus/useBaseUrl';

The App Crash Logs feature allows for the automatic capture and display of crash data during both live and automated testing on Sauce Labs' Real Device Cloud (RDC) platform, eliminating the need for integrating an SDK or connecting crash reporting tools to our system.
The App Crash Logs feature on Sauce Labs' Real Device Cloud (RDC) platform facilitates the automatic capture and display of crash data, both during live and automated testing. This eliminates the necessity to integrate an SDK or connect crash reporting tools to our system.

The App Crash Logs feature provides a centralized view and a wide range of app diagnostic signals to help teams speed up their debugging process and reduce the time it takes to resolve issues. Our goal is to create faster feedback loops for developers so that they can identify risks and ensure coverage early on in the development cycle. With our new capability, teams can prioritize errors, crashes, and test failures with complete data and context, focusing on the ones that matter the most.

Our tool is capable of detecting and recording fatal errors (crashes) that occur during testing of iOS and Android apps. The call stack details are then stored in a crash.log file along with the test results. Additionally, all non-fatal errors and warnings originating from the native application are also made visible through our interface. This allows for easy debugging and integration with other Mobile App Diagnostics components, allowing you to identify and resolve issues more efficiently.
Through the App Crash Logs feature, users gain access to a centralized view encompassing an array of app diagnostic signals. This expedites the debugging process for teams and reduces issue resolution time. Our primary objective is to establish expedited feedback loops for developers, enabling the early identification of risks and ensuring comprehensive coverage within the development cycle. With this enhanced capability, teams can effectively prioritize errors, crashes, and test failures based on complete data and context, focusing their efforts on the most critical issues.

Our tool has the capability to detect and record fatal errors (crashes) that occur during the testing of both iOS and Android apps. Specifically for Android apps, this information is sent to [Error Reporting](/error-reporting/getting-started/), enabling the viewing of detailed call stack information. Furthermore, our interface also renders all non-fatal errors and warnings originating from the native application visible. This feature streamlines debugging and facilitates seamless integration with other Mobile App Diagnostics components, ultimately enhancing issue identification and resolution efficiency.

## What You'll Need

Expand All @@ -21,15 +20,47 @@ Our tool is capable of detecting and recording fatal errors (crashes) that occur

## Viewing the App Crash Logs for Real Devices​

The App Crash logs feature is automatically enabled when the instrumentation feature is enabled. Whenever a crash is detected, our system will display an App Crashed label for the corresponding test result, regardless of the test's status.
The App Crash Logs feature is automatically activated when the [Instrumentation feature](/mobile-apps/features/mobile-app-diagnostics/interactions/#using-interactions-for-real-devices) is enabled. Upon detecting a crash, our system will exhibit an `App Crashed` label for the corresponding test result, regardless of the test's status.

<br/><img src={useBaseUrl('img/mobile-apps/app-crash-scr1.png')} alt="Mobile app settings navigation" width="900"/>

When you navigate to the [Live Test Results](/mobile-apps/live-testing/live-mobile-app-testing/) or [Automated Test Results](/mobile-apps/automated-testing/) page, you can view all the collected crashes in a centralized location. The collected crashes are presented in the context of their respective test cases, videos, and interactions. This centralized view is designed to enable efficient collaboration within your team and improve time to resolution for any issues that may arise.
When you navigate to the [Live Test Results](/mobile-apps/live-testing/live-mobile-app-testing/) or [Automated Test Results](/mobile-apps/automated-testing/) page, you can view the collected crashes in the Crashes tab. The collected crashes are presented in the context of their respective test cases, videos, and interactions. This centralized view is designed to enable efficient collaboration within your team and improve time to resolution for any issues that may arise.

### Viewing the App Crash in the Crashes Tab

<img src={useBaseUrl('img/mobile-apps/app-crash-scr2.png')} alt="Mobile app settings navigation" width="800"/>

The `crash.log` file provides information on the stack trace, methods, classes, and lines of code that were being executed before the fatal error occurred. This information facilitates the identification of the root cause of the crash, enabling your team to address the underlying issues in a timely and effective manner.

In the Crashes tab, you will also find a **View Crash in Error Reporting** link, which directs you to [Error Reporting](/error-reporting/getting-started/) for a detailed view of the crash logs.

Similarly, in the Automated Test section, the Commands tab includes a label directly linked to the Error Reporting.

<img src={useBaseUrl('/img/mobile-apps/rdc-er-integration/crashes-link.png')} alt="view crash in error reporting link in Crashes tab" width="700" />

### Viewing the App Crashes in Error Reporting

While the Crashes Tab contains the stack trace, which can be useful for initial debugging of the root cause, more comprehensive insights are available within Error Reporting. Moreover, Error Reporting is the sole location to access callstack details for native crashes.

<img src={useBaseUrl('/img/mobile-apps/rdc-er-integration/interactions-link.png')} alt="view crash in error reporting link in Interactions tab" width="700"/><br/><br/>

<br/><img src={useBaseUrl('img/mobile-apps/app-crash-scr2.png')} alt="Mobile app settings navigation" width="900"/>
Inside the Interactions tab, clicking on the **View Crash in Error Reporting** link will seamlessly direct you to the Error Reporting Debug view, specifically tailored to that session. Here, Error Reporting furnishes you with extensive information, encompassing threads and callstack specifics. This approach streamlines troubleshooting by grouping similar errors, thus avoiding repetitive debugging of identical issues.

The crash.json log provides detailed information on the stack trace, methods, classes, and lines of code that were being executed before the fatal error occurred. This detailed information facilitates the identification of the root cause of the crash, enabling your team to address the underlying issues in a timely and effective manner.
<img src={useBaseUrl('/img/mobile-apps/rdc-er-integration/debug-view.png')} alt="Debug view in Error Reporting" width="750"/>

An alternative method for accessing the Backtrace instance to review the crash report is by clicking the Error Reporting link in the Sauce Labs sidebar.

<img src={useBaseUrl('/img/mobile-apps/rdc-er-integration/error-reporting-link.png')} alt="Debug view in Error Reporting" width="200"/>

Hovering over the warning icon adjacent to the function name reveals the underlying cause, and further clarity can be gained by clicking the arrow in the popup to reveal associated details.

<img src={useBaseUrl('/img/mobile-apps/rdc-er-integration/callstack-error-details.png')} alt="failure details" width="750"/><br/>

<img src={useBaseUrl('/img/mobile-apps/rdc-er-integration/error-details-more.png')} alt="more details" width="750"/>

Live sessions may entail multiple crashes. To streamline the identification of crashes occurring during RDC testing, the **Attributes** Tab presents designated attributes labeled as `sauce.<someattribute>`.

<img src={useBaseUrl('/img/mobile-apps/rdc-er-integration/sauce-attributes.png')} alt="view crash in error reporting link in Crashes tab" width="750"/>

## Downloading the App Crash Log

Expand All @@ -39,17 +70,21 @@ You can download the crash log as a text file to save and share with Sauce Labs

:::note
You can also download the results using the API call below and send it to your development team:

```java
curl --compressed \
-O https://{SAUCE_USERNAME}:{SAUCE_ACCESS_KEY}@{DATA_CENTER}.saucelabs.com/v1/rdc/jobs/{JOB_ID}/crash.log`
```

:::

## Limitations

:::note
- Does not capture hangs and cross-platform development frameworks.

- Does not capture hangs and cross-platform development frameworks, like React Native and .NET MAUI
- Emulators/Simulators are not supported.
- If you have a native crash reporting SDK in your application (including Backtrace), this feature will override it; therefore, you will not see the crash report in your existing system.

:::

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2cdcb04

Please sign in to comment.