> For the complete documentation index, see [llms.txt](https://docs.payments.thalescloud.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.payments.thalescloud.io/nfc-wallet-sdk-android/help/knowledge-base/retrieve-logs-from-an-android-device.md).

# Retrieve logs from an Android device

## Overview

Use Android Debug Bridge (ADB) to capture device logs (`logcat`) for troubleshooting.

If you can reproduce the issue in a controlled environment, capture logs right around the failing flow.

{% hint style="info" %}
If you need SDK runtime logs that stay inside the application sandbox, use `LogService` instead. See [Collect logs with LogService](/nfc-wallet-sdk-android/additional-features/collect-logs-with-secure-logger.md).
{% endhint %}

## Prerequisites

Before you can retrieve the log files from an Android device, ensure that you have done the following setup:

* Install Android Debug Bridge (ADB) on the host machine.
* Enable **USB debugging** on the device under test.
* Connect the Android device to the host machine using a USB cable.
* Install the device USB driver on Windows (if required).

To verify the setup, run:

```bash
adb devices
```

The device is reachable when you see an entry with status `device`:

```
List of devices attached
228b0e100d047ece device
```

If you do not see the device, re-check the prerequisites. For ADB setup and troubleshooting, see the official Android documentation: [Android Debug Bridge (adb)](https://developer.android.com/tools/adb).

{% hint style="warning" %}
Some devices require enabling device logging in a vendor-specific menu.

For example, on some Huawei devices you can access the menu by dialing `*#*#2846579#*#*`. See [Huawei logcat not showing the log for my app](https://stackoverflow.com/questions/18124334/huawei-logcat-not-showing-the-log-for-my-app) for context.
{% endhint %}

## Capture logs (recommended)

1. Clear device log buffers:

   ```bash
   adb logcat -b all -c
   ```
2. Start capturing logs (millisecond timestamps, all priorities):

   ```bash
   adb logcat -v threadtime -b all *:V > TestLogFileName.txt
   ```
3. Reproduce the issue in your **digital wallet application**.
4. Stop capture and collect the file:
   * Press `CTRL+C`.
   * Retrieve `TestLogFileName.txt` from the folder where you ran the command.

{% hint style="info" %}
For the most detailed logs, reproduce using a build of your **digital wallet application** that integrates the NFC Wallet SDK `dev` build.

See [Deliverables](/nfc-wallet-sdk-android/general/deliverables.md) for supported build types.

Capture logs only around the failing flow. Start right before the steps. Stop right after.
{% endhint %}

{% hint style="warning" %}
Avoid [logcat filters](https://developer.android.com/studio/command-line/logcat#filteringOutput). They often hide the lines needed for root-cause analysis.
{% endhint %}

## Verifying the setup

You can verify the setup by running a flow that calls the SDK API, for example **Retrieve card list** in [Display digital cards](/nfc-wallet-sdk-android/implement-nfc-wallet/manage-digital-cards/display-digital-cards.md#retrieve-card-list).

With the recommended command, the log file should have:

* A timestamp with millisecond precision on each line.
* Log priority letters up to `V` (Verbose) after the PID and TID fields.
* A line containing `PublicAPI::Start of DigitalizedCardManager.getAllCards`.

The following example shows the log snippet demonstrating such features:

```
08-06 17:11:21.790 14171 14171 D SDK_ENTRY_POINT: PublicAPI::Start of DigitalizedCardManager.getAllCards
08-06 17:11:21.790 14171 14171 D SDK_ENTRY_POINT: PublicAPI::Start of SDKController.getInstance
08-06 17:11:21.791 14171 14171 D SDK_ENTRY_POINT: PublicAPI::Start of SDKController.getService
08-06 17:11:21.791 14171 14171 V util.h.xy.by.mb: Attempting to retrieve service with name: DigitalizedCardBuinsessService
08-06 17:11:21.791 14171 14171 D util.h.xy.by.mb: business service = util.h.xy.l.a@f9a06e1
08-06 17:11:21.791 14171 14171 V util.h.xy.l.a: getAllCards is called
08-06 17:11:21.791 14171 14171 D util.h.xy.aj.b: [DCM.getAllCards].increment
08-06 17:11:21.791 14171 14171 V util.h.xy.aj.b: [DCM.getAllCards]Ops left is 1
08-06 17:11:21.792 14171 18982 I util.h.xy.n.mb: -----------------------------------------------------------------------GET_ALLCARDS-START----------------------------------------------------------------------

```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.payments.thalescloud.io/nfc-wallet-sdk-android/help/knowledge-base/retrieve-logs-from-an-android-device.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
