Skip to content

docs: Add comprehensive Logcat setup and debugging instructions for Android - #21984

Merged
MartinZikmund merged 19 commits into
masterfrom
copilot/add-android-debugging-logcat-instructions
May 6, 2026
Merged

MartinZikmund merged 19 commits into
masterfrom
copilot/add-android-debugging-logcat-instructions

Conversation

Copilot AI commented Nov 26, 2025 •

Copy link
Copy Markdown
Contributor

Summary


Add comprehensive Android Logcat setup and debugging instructions (Visual Studio, Rider, and VS Code) to the repro guide.

Changes Made

  • Fixed Prerequisites list: Changed stray 3. to 1. and removed empty 4. line
  • Fixed Option 2 list: Changed explicit numbers to auto-numbering (1.)
  • Fixed Best Practices list: Closed unclosed code block and restored missing items 4 and 5
  • Verified all code blocks are balanced (14 markers = 7 pairs)

Details

Prerequisites Section (Lines 118-119):

  • Removed incorrect numbering (was 3. and 4.)
  • Changed to auto-numbering with 1.

Option 2 Section (Lines 165, 171):

  • Changed explicit numbers 2. and 4. to auto-numbering 1.
  • Follows markdown best practice for auto-numbered lists

Best Practices Section (Lines 281-298):

  • Closed unclosed code block after line 284
  • Restored missing list items:
    • Item 4: "Filter to relevant logs"
    • Item 5: "Include essential context"
  • Fixed list structure with proper indentation

All changes follow the pattern suggested in the code review to use 1. for auto-numbering to avoid unnecessary changes in future PRs.

Original prompt

Summary

Add comprehensive Logcat setup and access instructions for Android debugging across VS Code, JetBrains Rider, and Visual Studio to the "How to Create a Repro" documentation.

What

This change adds a new "Android Debugging with Logcat" section to doc/articles/uno-howto-create-a-repro.md with:

  • IDE-specific tabs for Visual Studio, Rider, and VS Code
  • Step-by-step Logcat access instructions for each IDE
  • VS Code setup with both manual ADB and extension options
  • Common filtering tips and best practices
  • Code examples for enabling verbose Uno logging
  • Cross-reference from the debugging tips section

Why

The existing documentation lacks essential Logcat setup instructions, making it difficult for developers to debug Android issues when creating reproducible examples. This is especially important for:

  • New developers getting started with Uno Platform on Android
  • Creating high-quality bug reports with proper logs
  • Debugging Android-specific issues across different IDEs

Which issue

Fixes #18515

Related to #21977

Changes Required

1. Update doc/articles/uno-howto-create-a-repro.md

Insert after line 41 (in the debugging tips section):

Add a new section titled "## Android Debugging with Logcat" with three IDE-specific tabs:

Visual Studio Tab

  • Accessing the Device Log window
  • Filtering by process name, log level, and search terms
  • Tips for clearing, pausing, copying, and saving logs

Rider Tab

  • Accessing the Logcat tool window
  • Using log level filters and regex patterns
  • Keyboard shortcuts and export options
  • Prerequisites for Android SDK configuration

VS Code Tab

  • Prerequisites: Android SDK installation and ADB verification
  • Option 1: Using Terminal with manual ADB commands including:
    • Basic logcat commands
    • Filtering by package name, priority, and tags
    • Saving logs to file
  • Option 2: Using VS Code extensions (Android, ADB Interface, Android iOS Emulator)
  • Useful ADB command reference with examples
  • Tips for effective filtering with grep/findstr

Common Tips Section (All IDEs)

  • Code example for enabling verbose Uno logging in App.xaml.cs
  • Key search terms for Logcat (Exception, Error, Crash, AndroidRuntime, etc.)
  • Uno-specific log tags to filter on
  • Best practices when reporting issues:
    • Clear old logs
    • Reproduce the issue
    • Capture and filter relevant logs
    • Include essential context
  • Links to additional resources (Android Logcat docs, Uno logging guide, ADB reference)

Update line 36 to add cross-reference:
Change the bullet point about analyzing logs to include:

- Analyze device and app logs for clues about the control's behavior. For Android-specific logging, see [Android Debugging with Logcat](#android-debugging-with-logcat) below.

Complete Section Content

## Android Debugging with Logcat

When debugging Android-specific issues, Logcat provides essential device and application logs. Here's how to access Logcat in different development environments:

### [**Visual Studio**](#tab/vs)

Visual Studio provides built-in Logcat support through the **Device Log** window.

**Accessing Logcat:**
1. Deploy your app to an Android device or emulator
2. Navigate to **View** → **Other Windows** → **Device Log**
3. Select your target device from the dropdown menu
4. The logs will automatically stream from the selected device

**Filtering Logs:**
- Filter by **Process Name**: Enter your app's package name
- Filter by **Log Level**: Choose from Verbose, Debug, Info, Warn, Error, or Fatal
- Use the **Search box** to find specific terms like "Uno", "Exception", or error messages
- Click the **Filter** dropdown to apply multiple filters simultaneously

**Useful Tips:**
- Right-click in the Device Log window and select **Clear All** before reproducing an issue for cleaner logs
- Use the **Pause** button in the toolbar to freeze log output for easier reading
- Select relevant log entries, right-click, and choose **Copy** to share specific logs
- Save logs via the toolbar save button for later analysis

### [**JetBrains Rider**](#tab/rider)

Rider provides Logcat access through the **Logcat** tool window with advanced filtering capabilities.

**Accessing Logcat:**
1. Deploy your app to an Android device or emulator
2. Navigate to **View** → **Tool Windows** → **Logcat**
   - Alternatively, press **Alt+6** (Windows/Linux) or **Γîÿ6** (macOS)
3. Select your device from the device dropdown in the toolbar
4. Select your app's process from the process filter dropdown

**Filtering and Searching:**
- Use the **log level filter** buttons in the toolbar (Verbose, Debug, Info, Warn, Error, Assert)
- Enter search terms in the **filter bar** at the top
- Use **regex patterns** for advanced filtering (e.g., `Uno.*Exception`)
- Click the **filter settings** icon to configure column visibility and formatting

**U...

</details>

*This pull request was created as a result of the following prompt from Copilot chat.*
> ## Summary
> 
> Add comprehensive Logcat setup and access instructions for Android debugging across VS Code, JetBrains Rider, and Visual Studio to the "How to Create a Repro" documentation.
> 
> ## What
> 
> This change adds a new "Android Debugging with Logcat" section to `doc/articles/uno-howto-create-a-repro.md` with:
> - IDE-specific tabs for Visual Studio, Rider, and VS Code
> - Step-by-step Logcat access instructions for each IDE
> - VS Code setup with both manual ADB and extension options
> - Common filtering tips and best practices
> - Code examples for enabling verbose Uno logging
> - Cross-reference from the debugging tips section
> 
> ## Why
> 
> The existing documentation lacks essential Logcat setup instructions, making it difficult for developers to debug Android issues when creating reproducible examples. This is especially important for:
> - New developers getting started with Uno Platform on Android
> - Creating high-quality bug reports with proper logs
> - Debugging Android-specific issues across different IDEs
> 
> ## Which issue
> 
> Fixes https://github.com/unoplatform/uno/issues/18515
> 
> Related to https://github.com/unoplatform/uno/issues/21977
> 
> ## Changes Required
> 
> ### 1. Update `doc/articles/uno-howto-create-a-repro.md`
> 
> **Insert after line 41** (in the debugging tips section):
> 
> Add a new section titled "## Android Debugging with Logcat" with three IDE-specific tabs:
> 
> #### Visual Studio Tab
> - Accessing the Device Log window
> - Filtering by process name, log level, and search terms
> - Tips for clearing, pausing, copying, and saving logs
> 
> #### Rider Tab  
> - Accessing the Logcat tool window
> - Using log level filters and regex patterns
> - Keyboard shortcuts and export options
> - Prerequisites for Android SDK configuration
> 
> #### VS Code Tab
> - Prerequisites: Android SDK installation and ADB verification
> - **Option 1**: Using Terminal with manual ADB commands including:
>   - Basic logcat commands
>   - Filtering by package name, priority, and tags
>   - Saving logs to file
> - **Option 2**: Using VS Code extensions (Android, ADB Interface, Android iOS Emulator)
> - Useful ADB command reference with examples
> - Tips for effective filtering with grep/findstr
> 
> #### Common Tips Section (All IDEs)
> - Code example for enabling verbose Uno logging in `App.xaml.cs`
> - Key search terms for Logcat (Exception, Error, Crash, AndroidRuntime, etc.)
> - Uno-specific log tags to filter on
> - Best practices when reporting issues:
>   - Clear old logs
>   - Reproduce the issue
>   - Capture and filter relevant logs
>   - Include essential context
> - Links to additional resources (Android Logcat docs, Uno logging guide, ADB reference)
> 
> **Update line 36** to add cross-reference:
> Change the bullet point about analyzing logs to include:
> ```markdown
> - Analyze device and app logs for clues about the control's behavior. For Android-specific logging, see [Android Debugging with Logcat](#android-debugging-with-logcat) below.
> ```
> 
> ## Complete Section Content
> 
> ````markdown
> ## Android Debugging with Logcat
> 
> When debugging Android-specific issues, Logcat provides essential device and application logs. Here's how to access Logcat in different development environments:
> 
> ### [**Visual Studio**](#tab/vs)
> 
> Visual Studio provides built-in Logcat support through the **Device Log** window.
> 
> **Accessing Logcat:**
> 1. Deploy your app to an Android device or emulator
> 2. Navigate to **View** → **Other Windows** → **Device Log**
> 3. Select your target device from the dropdown menu
> 4. The logs will automatically stream from the selected device
> 
> **Filtering Logs:**
> - Filter by **Process Name**: Enter your app's package name
> - Filter by **Log Level**: Choose from Verbose, Debug, Info, Warn, Error, or Fatal
> - Use the **Search box** to find specific terms like "Uno", "Exception", or error messages
> - Click the **Filter** dropdown to apply multiple filters simultaneously
> 
> **Useful Tips:**
> - Right-click in the Device Log window and select **Clear All** before reproducing an issue for cleaner logs
> - Use the **Pause** button in the toolbar to freeze log output for easier reading
> - Select relevant log entries, right-click, and choose **Copy** to share specific logs
> - Save logs via the toolbar save button for later analysis
> 
> ### [**JetBrains Rider**](#tab/rider)
> 
> Rider provides Logcat access through the **Logcat** tool window with advanced filtering capabilities.
> 
> **Accessing Logcat:**
> 1. Deploy your app to an Android device or emulator
> 2. Navigate to **View** → **Tool Windows** → **Logcat**
>    - Alternatively, press **Alt+6** (Windows/Linux) or **Γîÿ6** (macOS)
> 3. Select your device from the device dropdown in the toolbar
> 4. Select your app's process from the process filter dropdown
> 
> **Filtering and Searching:**
> - Use the **log level filter** buttons in the toolbar (Verbose, Debug, Info, Warn, Error, Assert)
> - Enter search terms in the **filter bar** at the top
> - Use **regex patterns** for advanced filtering (e.g., `Uno.*Exception`)
> - Click the **filter settings** icon to configure column visibility and formatting
> 
> **Useful Tips:**
> - Right-click in the Logcat window and select **Clear** to remove previous logs
> - Use **Ctrl+F** (Windows/Linux) or **ΓîÿF** (macOS) to open the find dialog for searching within logs
> - Export logs using **Right-click** → **Export to Text File**
> - Configure log colors in **File** → **Settings** → **Editor** → **Color Scheme** → **Logcat**
> 
> **Prerequisites:**
> - Ensure Android SDK is configured: **File** → **Settings** → **Appearance & Behavior** → **System Settings** → **Android SDK**
> - Verify ADB connection by checking if your device appears in the device dropdown
> - If the device doesn't appear, run `adb devices` in the terminal to troubleshoot
> 
> ### [**VS Code**](#tab/vscode)
> 
> VS Code requires manual ADB setup or extensions for Logcat viewing.
> 
> **Prerequisites:**
> 1. **Install Android SDK** (if not already installed):
>    - Windows: Typically located at `C:\Users\<username>\AppData\Local\Android\Sdk`
>    - macOS: `~/Library/Android/sdk`
>    - Linux: `~/Android/Sdk`
> 
> 2. **Verify ADB Installation:**
>    - ADB is located in `<Android-SDK>/platform-tools/adb`
>    - Add ADB to your system PATH or note its full path
>    - Test by running: `adb version`
> 
> **Option 1: Using Terminal (Manual ADB)**
> 
> 1. Open VS Code's integrated terminal: **View** → **Terminal** or press **Ctrl+`** (Windows/Linux) or **⌘`** (macOS)
> 2. Ensure your device or emulator is running and connected
> 3. Verify device connection:
>    ```bash
>    adb devices
>    ```
> 4. Start viewing logs:
>    ```bash
>    # View all logs (verbose)
>    adb logcat
>    
>    # Clear previous logs first
>    adb logcat -c
>    
>    # Filter by your app's package name
>    adb logcat | grep "com.yourcompany.yourapp"
>    
>    # Filter by log priority (E=Error, W=Warn, I=Info, D=Debug, V=Verbose)
>    adb logcat *:E
>    
>    # Filter by tag (show only Uno logs)
>    adb logcat Uno:* *:S
>    
>    # Combination: Show Uno debug logs and all errors
>    adb logcat Uno:D *:E
>    
>    # Save logs to file
>    adb logcat > android-logs.txt
>    
>    # Dump existing logs without continuous streaming
>    adb logcat -d
>    ```
> 
> **Option 2: Using VS Code Extensions**
> 
> 1. Open the Extensions view: **View** → **Extensions** or press **Ctrl+Shift+X** (Windows/Linux) or **⌘⇧X** (macOS)
> 2. Search for and install one of these extensions:
>    - **"Android"** by adelphes
>    - **"ADB Interface for VSCode"** by vincenthage
>    - **"Android iOS Emulator"** by DiemasMichiels
> 3. Follow the extension-specific instructions to:
>    - Configure the Android SDK path in VS Code settings
>    - Open the Logcat view (usually in the sidebar or via command palette)
>    - Connect to your device/emulator
> 
> **Useful ADB Commands:**
> 
> ```bash
> # List connected devices
> adb devices
> 
> # Kill and restart ADB server (if device not detected)
> adb kill-server
> adb start-server
> 
> # Filter logs by multiple tags
> adb logcat -s Uno:D Microsoft:D AndroidRuntime:E
> 
> # View logs with timestamps
> adb logcat -v time
> 
> # View logs with thread IDs
> adb logcat -v threadtime
> 
> # Follow logs in real-time with color (Linux/macOS)
> adb logcat -v color
> 
> # Clear logs and start fresh
> adb logcat -c && adb logcat
> ```
> 
> **Tips for Effective Filtering:**
> - Use `grep` (Linux/macOS) or `findstr` (Windows) to filter output:
>   ```bash
>   # Linux/macOS
>   adb logcat | grep -i "exception"
>   
>   # Windows PowerShell
>   adb logcat | Select-String "exception"
>   ```
> 
> ---
> 
> ### Common Logcat Tips (All IDEs)
> 
> **Enable Verbose Uno Logging:**
> 
> Add this code to your `App.xaml.cs` constructor to increase Uno-specific logging detail:
> 
> ```csharp
> #if __ANDROID__
> using Microsoft.Extensions.Logging;
> 
> public App()
> {
>     // Enable verbose logging for Uno Platform
>     Uno.UI.Adapter.Microsoft.Extensions.Logging.LoggingAdapter.MinimumLevel = LogLevel.Trace;
>     
>     this.InitializeComponent();
> }
> #endif
> ```
> 
> **Key Search Terms for Logcat:**
> 
> When analyzing logs, search for these keywords to quickly identify issues:
> - `Exception` - Catch any exceptions thrown
> - `Error` - Application errors
> - `Crash` - Fatal crashes
> - `AndroidRuntime` - Native Android runtime errors
> - `FATAL EXCEPTION` - Critical app crashes
> - `Uno` - Uno Platform-specific logs
> - `Microsoft.UI.Xaml` - WinUI/XAML-related logs
> - `mono-rt` - Mono runtime messages
> 
> **Uno-Specific Log Tags:**
> 
> Filter for these tags to focus on Uno Platform logs:
> - `Uno.*` - All Uno-related logs
> - `Windows.UI.Xaml` - XAML framework logs
> - `Microsoft.UI.Xaml` - WinUI framework logs
> - `UnoViewGroup` - Android view hierarchy logs
> - `Uno.UI.Controls` - Control-specific logs
> 
> **Best Practices When Reporting Issues:**
> 
> 1. **Clear old logs:**
>    ```bash
>    adb logcat -c
>    ```
> 
> 2. **Reproduce the issue** immediately after clearing logs
> 
> 3. **Capture logs** during the issue:
>    ```bash
>    adb logcat > issue-reproduction.txt
>    ```
> 
> 4. **Filter to relevant logs** before sharing:
>    - Focus on the timeframe when the issue occurred
>    - Include 10-20 lines before and after the error
>    - Remove sensitive information (API keys, user data, etc.)
> 
> 5. **Include essential context:**
>    - Uno Platform version
>    - Android version and device/emulator details
>    - Steps to reproduce
>    - Expected vs actual behavior
> 
> **Additional Resources:**
> - [Android Logcat Documentation](https://developer.android.com/studio/command-line/logcat)
> - [Uno Platform Logging Guide](xref:Uno.Development.Logging)
> - [ADB Command Reference](https://developer.android.com/studio/command-line/adb)
> 
> ---
> ````
> 
> ## Formatting Requirements
> 
> - Use the existing tab structure format consistent with the rest of the document
> - Maintain proper markdown syntax for headers, code blocks, and lists
> - Ensure code blocks use appropriate language syntax (bash, csharp)
> - Follow the document's existing spacing and indentation patterns
> 
> ## Testing
> 
> The PR should ensure:
> - Markdown renders correctly in the docs site
> - Tab navigation works between IDE sections
> - All ADB commands are accurate
> - Code examples have proper syntax highlighting
> - All links are valid
> - Follows existing documentation formatting
> 
> ## Commit Message
> 
> ```
> docs: Add Logcat setup instructions for VS Code, Rider, and Visual Studio
> 
> - Add comprehensive Android Logcat access guide for three IDEs
> - Include step-by-step setup for VS Code with manual ADB and extensions
> - Document Logcat access in Rider and Visual Studio
> - Add common filtering tips and best practices
> - Include code examples for enabling verbose Uno logging
> 
> Fixes https://github.com/unoplatform/uno/issues/18515
> ```
> 

<!-- START COPILOT CODING AGENT TIPS -->
---

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.

@CLAassistant

CLAassistant commented Nov 26, 2025 •

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
2 out of 3 committers have signed the CLA.

✅ Jen-Uno
✅ agneszitte
❌ Copilot
You have signed the CLA already but the status is still pending? Let us recheck it.

Copilot AI changed the title [WIP] Add Logcat setup and access instructions for Android debugging docs: Add comprehensive Logcat setup and debugging instructions for Android Nov 26, 2025
Copilot AI requested a review from Jen-Uno November 26, 2025 21:42
@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 185284 has failed on Uno.UI - docs.

@Jen-Uno
Jen-Uno marked this pull request as ready for review November 27, 2025 17:22
Copilot AI review requested due to automatic review settings November 27, 2025 17:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

@Jen-Uno
Jen-Uno requested a review from agneszitte November 27, 2025 18:34
@github-actions

Copy link
Copy Markdown
Contributor

This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or it will be closed in 10 days.

@github-actions github-actions Bot added the stale This item has been marked as stale and will be closed if there is no activity. label Jan 27, 2026
@Jen-Uno
Jen-Uno requested a review from Copilot February 3, 2026 19:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Jen-Uno
Jen-Uno enabled auto-merge February 3, 2026 19:22
@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 194499 has failed on Uno.UI - docs.

@mergify

mergify Bot commented Feb 26, 2026

Copy link
Copy Markdown
Contributor

rebase

✅ Branch has been successfully rebased

Copilot AI review requested due to automatic review settings February 26, 2026 20:00
@agneszitte
agneszitte force-pushed the copilot/add-android-debugging-logcat-instructions branch from 06d2e1b to 97b1f7b Compare February 26, 2026 20:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@unodevops

Copy link
Copy Markdown
Contributor

Copilot AI review requested due to automatic review settings February 27, 2026 14:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@unodevops

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or it will be closed in 10 days.

@github-actions github-actions Bot added the stale This item has been marked as stale and will be closed if there is no activity. label Apr 29, 2026
@MartinZikmund
MartinZikmund merged commit cc16882 into master May 6, 2026
14 checks passed
@MartinZikmund
MartinZikmund deleted the copilot/add-android-debugging-logcat-instructions branch May 6, 2026 07:04
@MartinZikmund MartinZikmund removed the stale This item has been marked as stale and will be closed if there is no activity. label Jul 2, 2026
@mergify

mergify Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

rebase

☑️ Nothing to do, the required conditions are not met

Details
  • -closed [📌 rebase requirement]
  • any of:
    • #commits-behind > 0 [📌 rebase requirement]
    • -linear-history [📌 rebase requirement]
  • -conflict [📌 rebase requirement]
  • queue-position = -1 [📌 rebase requirement]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/build Categorizes an issue or PR as relevant to build infrastructure kind/documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Docs] Missing Logcat Setup/Details documentation for VS Code, Rider, and Visual Studio

8 participants