Skip to content

A customizable debug drawer for Android apps that overlays your app in debug builds and provides useful debugging tools for developers.

License

Notifications You must be signed in to change notification settings

mabualzait/Android-Debug-Drawer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

37 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Android Debug Drawer

License: MIT CI JitPack ktlint Android Kotlin

A comprehensive, production-ready debug drawer for Android apps that provides developers with powerful debugging tools directly within their applications.

Stop switching between your app and external debugging tools. This library gives you everything you need for debugging right inside your app - real-time logcat streaming, network request monitoring, feature flag toggles, app inspection, and more. Perfect for QA testing, development debugging, and production troubleshooting.

Built by developers, for developers. Created by Malik Abualzait with a focus on simplicity, performance, and extensibility.

๐ŸŽฏ Why Android Debug Drawer?

  • ๐Ÿš€ Zero Setup - Get started in minutes with minimal configuration
  • ๐Ÿ”ง Modular Design - Add or remove debugging modules as needed
  • ๐Ÿ“ฑ Production Ready - Automatically disabled in release builds
  • ๐ŸŽจ Beautiful UI - Clean, intuitive interface following Material Design principles
  • โšก High Performance - Lightweight with minimal impact on app performance
  • ๐Ÿงช Well Tested - Comprehensive test coverage with CI/CD pipeline

โšก Quick Start

Want to try it right now? Download the latest APK and install it on your device:

Download APK

  1. Click the button above โ†’ Go to latest workflow run โ†’ Download APK artifact
  2. Install on your Android device
  3. Open the app and tap "Toggle Debug Drawer"
  4. Explore all the debugging modules!

๐ŸŒŸ Features

๐Ÿ”ง Modular Architecture

Pick and choose only the debugging tools you need. Each module is independent and can be added/removed dynamically.

๐Ÿ“ฑ Built-in Debug Modules

  • ๐Ÿ“ฑ App & Device Info - View app version, device model, Android version, and build details
  • ๐ŸŒ Network Monitoring - Real-time HTTP request/response logging with headers, timing, and status codes
  • ๐Ÿ“‹ Advanced Logcat Viewer - Stream system and app logs with real-time filtering, search, and export
  • ๐Ÿšฉ Feature Flags - Toggle features at runtime with persistent storage across app restarts
  • โš™๏ธ Settings Override - Modify app settings on-the-fly for testing different configurations
  • ๐Ÿ“‹ Clipboard Tools - Copy/paste utilities for testing text input scenarios

๐Ÿš€ Developer Experience

  • Zero Performance Impact - Automatically disabled in release builds
  • Real-time Updates - Live log streaming and network monitoring
  • Easy Integration - Works with existing Hilt/DI setup
  • Extensible - Create custom modules for your specific needs

๐Ÿ› ๏ธ Tech Stack

  • Language: Kotlin
  • UI: Traditional Android Views (XML + Kotlin)
  • Dependency Injection: Hilt
  • Networking: Retrofit + OkHttp (for request logging)
  • Persistence: DataStore (feature flags & settings)
  • Testing: JUnit, Mockito, Robolectric, Espresso
  • Code Quality: ktlint, detekt

๐Ÿ“ Architecture

  • Library Module (debugdrawer) โ†’ reusable across projects
  • Sample App Module (sampleapp) โ†’ demonstrates usage
  • Modular Design: Each widget = independent module that can be added dynamically to the drawer

๐Ÿ“– User Manual

Getting Started

The Android Debug Drawer is designed to be simple to integrate and use. Follow these steps to get started:

1. Installation

๐Ÿš€ JitPack (Recommended)

Add to your project's build.gradle.kts (project level):

allprojects {
    repositories {
        google()
        mavenCentral()
        maven { url = uri("https://jitpack.io") }
    }
}

Add to your app's build.gradle.kts:

dependencies {
    debugImplementation("com.github.mabualzait:Android-Debug-Drawer:1.2.5")
}

Available versions:

  • 1.2.5 - Latest stable release โœ… (JitPack auto-detection working)
  • main-SNAPSHOT - Latest development version

๐Ÿ”ง Local Development (Clone as Module)

For contributing or custom modifications:

  1. Clone and integrate:

    git clone https://github.com/mabualzait/Android-Debug-Drawer.git
    # Copy debugdrawer folder to your project root
  2. Add to settings.gradle.kts:

    include(":debugdrawer")
  3. Add dependency:

    dependencies {
        debugImplementation project(":debugdrawer")
    }

2. Setup

๐Ÿš€ Super Simple Integration (Recommended)

Step 1: Add Hilt to your project (if not already added):

plugins {
    id("com.google.dagger.hilt.android")
    id("kotlin-kapt")
}

dependencies {
    implementation("com.google.dagger:hilt-android:2.48")
    kapt("com.google.dagger:hilt-compiler:2.48")
}

Step 2: Update your Application class:

@HiltAndroidApp
class MyApplication : com.abualzait.debugdrawer.DebugDrawerApplication() {
    // That's it! No additional code needed!
}

Step 3: Your MainActivity requires ZERO debug drawer code:

@AndroidEntryPoint
class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        // No debug drawer setup needed!
    }
}

๐ŸŽ‰ Done! The debug drawer is now automatically available with:

  • Gesture activation: Long press or double tap anywhere on screen
  • All modules included: App info, network monitoring, logcat, feature flags, settings, clipboard
  • Auto-initialization: Works across all activities
  • Zero boilerplate: No manual setup required

โœจ What Changed - Developer Experience Revolution

Before (Old Way) After (New Way)
โŒ 6+ @Inject declarations โœ… 0 declarations needed
โŒ Manual initialization โœ… Automatic initialization
โŒ Manual module registration โœ… Auto-registered modules
โŒ Manual cleanup in onDestroy โœ… Automatic cleanup
โŒ 20+ lines of setup code โœ… 1 line: extend DebugDrawerApplication
โŒ Button required for activation โœ… Gesture-based activation
โŒ Complex integration โœ… True plug-and-play

๐Ÿ”ง Advanced Integration (Optional)

If you need custom control, you can still use the traditional approach:

@HiltAndroidApp
class MyApplication : Application() {
    @Inject
    lateinit var debugDrawerInitializer: com.abualzait.debugdrawer.DebugDrawerInitializer

    override fun onCreate() {
        super.onCreate()
        debugDrawerInitializer.initializeIfEnabled(this)
    }
}

๐ŸŽฎ Manual Control (When Needed)

// Show/hide programmatically
com.abualzait.debugdrawer.DebugDrawerUtils.toggle(context)
com.abualzait.debugdrawer.DebugDrawerUtils.show(context)
com.abualzait.debugdrawer.DebugDrawerUtils.hide(context)

// Check visibility
val isVisible = com.abualzait.debugdrawer.DebugDrawerUtils.isVisible(context)

3. Usage

๐ŸŽฎ Activation Methods

Automatic Gestures (Zero Code Required):

  • Long press anywhere on the screen
  • Double tap anywhere on the screen

Programmatic Control (When Needed):

// Show/hide programmatically
com.abualzait.debugdrawer.DebugDrawerUtils.toggle(context)
com.abualzait.debugdrawer.DebugDrawerUtils.show(context)
com.abualzait.debugdrawer.DebugDrawerUtils.hide(context)

// Check visibility
val isVisible = com.abualzait.debugdrawer.DebugDrawerUtils.isVisible(context)

UI Button (Optional):

findViewById<Button>(R.id.btn_toggle_debug)?.setOnClickListener {
    com.abualzait.debugdrawer.DebugDrawerUtils.toggle(this)
}

Module Overview

Module Purpose Key Features
๐Ÿ“ฑ App Info App & device inspection Version, package, device model, Android version
๐ŸŒ Network HTTP monitoring Request/response logging, timing, status codes
๐Ÿ“‹ Logcat Real-time log streaming Live filtering, search, export, auto-scroll
๐Ÿšฉ Feature Flags Runtime feature toggles Persistent storage, A/B testing support
โš™๏ธ Settings Configuration override Runtime settings modification
๐Ÿ“‹ Clipboard Text utilities Copy/paste for testing scenarios

Real-world Use Cases

๐Ÿ” Development Debugging:

  • Monitor network requests during API development
  • Stream logs in real-time without switching to external tools
  • Toggle features instantly for testing different flows

๐Ÿงช QA Testing:

  • Inspect app version and device info for bug reports
  • Test feature combinations with flag toggles
  • Override settings to test edge cases

๐Ÿ› Production Troubleshooting:

  • Enable debug drawer in debug builds for customer support
  • Export logs for analysis
  • Monitor network issues in real-time

4. Advanced Usage

Module Management

// Add/remove modules dynamically
debugDrawer.addModule(customModule)
debugDrawer.removeModule(logsModule)

// Check drawer state
if (debugDrawer.isVisible()) {
    // Handle visibility
}

Network Monitoring Setup

@Module
@InstallIn(SingletonComponent::class)
object NetworkModule {
    @Provides
    @Singleton
    fun provideOkHttpClient(networkInterceptor: NetworkInterceptor): OkHttpClient {
        return OkHttpClient.Builder()
            .addInterceptor(networkInterceptor)
            .build()
    }
}

Feature Flags Integration

@Inject
lateinit var featureFlagsModule: com.abualzait.debugdrawer.modules.FeatureFlagsModule

// Check feature state
lifecycleScope.launch {
    val isEnabled = featureFlagsModule.isFeatureEnabled("new_feature")
    if (isEnabled) {
        // Enable new feature
    }
}

Custom Modules

class CustomModule @Inject constructor(
    private val context: Context
) : DebugModule {
    
    override val name = "custom"
    override val title = "Custom Module"
    override val description = "My custom debugging tool"
    
    override fun createView(): View {
        return LayoutInflater.from(context)
            .inflate(R.layout.custom_module_layout, null)
    }
}

๐Ÿ“ Project Structure

android-debug-drawer/
โ”œโ”€โ”€ debugdrawer/                    # Library module
โ”‚   โ”œโ”€โ”€ src/main/java/com/debugdrawer/
โ”‚   โ”‚   โ”œโ”€โ”€ DebugDrawer.kt         # Main debug drawer class
โ”‚   โ”‚   โ”œโ”€โ”€ modules/               # Debug modules
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ AppInfoModule.kt
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ NetworkModule.kt
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ com.abualzait.debugdrawer.modules.FeatureFlagsModule.kt
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ LogsModule.kt
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ com.abualzait.debugdrawer.modules.SettingsModule.kt
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ ClipboardModule.kt
โ”‚   โ”‚   โ”œโ”€โ”€ utils/                 # Utility classes
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Logger.kt
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ NetworkInterceptor.kt
โ”‚   โ”‚   โ””โ”€โ”€ di/                    # Dependency injection
โ”‚   โ”‚       โ””โ”€โ”€ DebugDrawerModule.kt
โ”‚   โ””โ”€โ”€ src/main/res/layout/       # Layout files
โ”‚       โ”œโ”€โ”€ module_app_info.xml
โ”‚       โ”œโ”€โ”€ module_network.xml
โ”‚       โ””โ”€โ”€ ...
โ”œโ”€โ”€ sampleapp/                     # Sample application
โ”‚   โ”œโ”€โ”€ src/main/java/com/debugdrawer/sampleapp/
โ”‚   โ”‚   โ”œโ”€โ”€ MainActivity.kt
โ”‚   โ”‚   โ”œโ”€โ”€ SampleApplication.kt
โ”‚   โ”‚   โ””โ”€โ”€ network/
โ”‚   โ”‚       โ””โ”€โ”€ SampleNetworkClient.kt
โ”‚   โ””โ”€โ”€ src/main/res/
โ”œโ”€โ”€ .github/workflows/             # CI/CD workflows
โ”‚   โ””โ”€โ”€ ci.yml
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ build.gradle.kts
โ””โ”€โ”€ settings.gradle.kts

๐Ÿงช Testing

The project includes comprehensive testing:

Unit Tests

./gradlew test

Instrumented Tests

./gradlew connectedAndroidTest

Code Coverage

./gradlew jacocoTestReport

Code Quality

./gradlew ktlintCheck
./gradlew detekt

๐Ÿ“Š Code Quality

This project maintains high code quality standards:

  • ktlint for code formatting
  • detekt for static analysis
  • Unit tests with JUnit, Mockito, and Robolectric
  • Integration tests with Espresso
  • Code coverage reporting with JaCoCo

๐Ÿš€ CI/CD

The project uses GitHub Actions for continuous integration:

  • Code Quality Checks - ktlint, detekt
  • Unit Tests - JUnit, Mockito, Robolectric
  • Instrumented Tests - Espresso on Android emulator
  • Build Verification - Debug and release APK builds
  • Code Coverage - JaCoCo reports uploaded to Codecov

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿค Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ“ž Support

If you have any questions or need help, please:

  1. Check the Issues page
  2. Create a new issue if your question isn't already answered
  3. Join our discussions for general questions

๐ŸŽฌ Demo

Check out the sample app included in this repository to see the Android Debug Drawer in action:

  1. Clone the repository
  2. Open in Android Studio
  3. Run the sampleapp module
  4. Tap "Toggle Debug Drawer" to see all features

๐Ÿ“ธ Screenshots

Main Interface

Debug Drawer Main Menu Main debug drawer interface with module selection grid

Logcat Viewer

Logcat Viewer Enhanced logcat viewer with real-time streaming and filtering

Network Monitoring

Network Module Network request monitoring and logging

App Information

App Info Module App and device information display

๐Ÿš€ Roadmap

  • JitPack integration for easy dependency management
  • More built-in modules (Database Inspector, Performance Monitor)
  • Custom theme support
  • Gesture-based activation (shake to open)
  • Export functionality for logs and settings
  • Plugin system for third-party modules

๐Ÿ™ Acknowledgments

  • Material Design for the UI components
  • Hilt for dependency injection
  • Retrofit for networking
  • DataStore for data persistence
  • Special thanks to the Android development community for inspiration and feedback

Developer: Malik Abualzait - Android Developer & Open Source Contributor


Made with โค๏ธ by Malik Abualzait for the Android development community

About

A customizable debug drawer for Android apps that overlays your app in debug builds and provides useful debugging tools for developers.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages