Skip to content
dirajnaik20Public

About

Debug-only inspector that lives inside your Android app: browse its database, see every API call, read logs and crashes, with AI explanations. No setup, nothing in release builds.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Tracewell logo

Tracewell

See inside your Android app while it runs: its database, API calls, logs and crashes, explained.

Maven Central CI License: Apache 2.0 Android API 24+ Kotlin 2.0+

Data tab Network tab Request detail Crash with AI explanation
Data: live database tables Network: every API call Failures in plain words Crashes, explained by AI

Tracewell is a debug-only inspector that lives inside your app. Open it from a launcher shortcut or a notification and see, while the app runs:

  • Data: the app's own database: every table, its rows, and which tables the app just changed
  • Network: every API call, with headers, bodies, timing and failures explained in plain words
  • Logs: the app's own log lines and crashes, with an optional AI explanation of what went wrong

It goes in debug builds only. A no-op twin keeps release builds free of any Tracewell code, and the build checks it.

Install

Tracewell is on Maven Central. In app/build.gradle.kts:

dependencies {
    debugImplementation("io.github.dirajnaik20:tracewell-android:0.1.0")
    releaseImplementation("io.github.dirajnaik20:tracewell-android-noop:0.1.0")   // only needed if your code calls Tracewell
}

No code is needed: Tracewell starts itself, finds the app's database and adds a "Tracewell" launcher shortcut. Tracewell.open(context) opens it from code.

Browsing the app's database

Tracewell opens the app's own SQLite database, Room or plain SQLite, right on the phone. There is no export step and no Android Studio needed.

Table list with a table marked as just changed Rows of a table, 50 per page
Every table, with the one the app just wrote to Rows, 50 per page
  • Every table and view with its row count, primary key and columns, plus the database's file, size, SQLite version and encoding. Switch between cards and a compact table view.
  • Rows, 50 at a time, with Previous and Next. Opening a table reads the rows at that moment; open it again to see newer rows.
  • Live changes. While Tracewell is open and set to Live, it checks the database about once a second. A table the app writes to updates its row count and shows "Changed 2s ago" with a live dot. Writes made while Tracewell is in the background aren't marked. Paused stops the checks.
  • Changes next to API calls. A call's detail page lists the database changes that happened while it ran, under Around this call.
  • Read-only. Tracewell opens the database with a read-only connection and never writes to it, so it can't change the app's data. A database encrypted with SQLCipher can't be opened.

With several databases, Tracewell shows the largest one that isn't made by a well-known library (WorkManager, Firebase, Chucker and similar). Pick one yourself with Tracewell.install(context, databaseName = "app.db").

Seeing API calls

The Network tab needs one line, because OkHttp has no global hook. Add the interceptor where the app builds its OkHttpClient, in debug builds only, before any interceptor that encrypts or compresses bodies:

debugImplementation("io.github.dirajnaik20:tracewell-okhttp:0.1.0")
releaseImplementation("io.github.dirajnaik20:tracewell-okhttp-noop:0.1.0")   // and the same for every other non-debug build type

OkHttpClient.Builder()
    .apply { TracewellInterceptor().takeIf { BuildConfig.DEBUG }?.let { addInterceptor(it) } }

Until it is added, the Network tab shows the code to paste. The interceptor never changes a request or a response.

  • Every call with method, URL, status, timing and size, newest first. The last 500 calls are kept in memory.
  • A summary of total calls, failures and average time, with a latency chart. Search by URL or body, and filter by method or status.
  • Failures in plain words. A 401, 404, server error, timeout, lost connection or bad certificate comes with a sentence saying what probably went wrong.
  • Headers and bodies as they were sent and received. Bodies up to 1 MB are kept as text; longer ones are cut and marked. JSON opens as a foldable tree or formatted text, with search. Tokens and cookies in headers stay masked until you reveal them.
  • cURL and Copy for AI for any call, and the log lines and database changes that happened while it ran.

Reading logs and crashes

  • The app's own log lines from logcat, read only while Tracewell is open and set to Live. It also picks up the recent history the phone kept. The newest 5,000 lines are kept, and repeated lines collapse into one with a count.
  • Filters by level (errors and warnings, info, or all), by tag, and by text. Hide system logs drops Android's own lines, such as graphics and frame timing, so the app's lines stand out.
  • Crashes. Tracewell saves the last uncaught exception before the app closes, then shows it on the next launch with the stack trace, the log lines before it, and Copy for AI. It runs before the app's own crash handler and then passes the crash on, so crash reporters keep working.

Explaining crashes and errors with AI

Tracewell ships with no AI key: each developer or tester uses their own. Create one under API Keys in Groq Console, then either:

  • Paste it in Tracewell. On the crash card (or under Explain on an error line), paste the key and tap Save. It is kept in the app's private storage on that phone only, never in the build, and needs no rebuild.

  • Or set it for the whole team's debug builds in local.properties (never commit this file):

    TRACEWELL_AI_KEY=gsk_...

    Expose it through a debug-only BuildConfig field and call Tracewell.install(context, aiKey = BuildConfig.TRACEWELL_AI_KEY) from your Application.onCreate, not from an Activity: Tracewell can be opened from its shortcut or notification without your Activity running. A key set this way is built into debug APKs, so only share those builds with people who should have the key.

A key pasted on the phone is used before the one from code. If a key is refused, Tracewell asks for a new one.

When you ask for an explanation, Tracewell sends the crash and stack trace or the selected error log line, plus up to 50 preceding log lines, to the AI provider. It masks recognizable tokens, API keys, email addresses and passwords first. The default model is openai/gpt-oss-120b on Groq.

To use another OpenAI-compatible API, pass its base URL and a model it serves:

Tracewell.install(context, aiBaseUrl = "https://api.openai.com/v1", aiModel = "gpt-4o-mini")

OpenRouter, Together and a local Ollama (http://10.0.2.2:11434/v1 from the emulator) work the same way. A plain http:// address also needs the app to allow cleartext traffic in debug builds.

Following calls in a notification

Tracewell notification with recent calls, failures and a crash banner

A silent notification shows the call count, failures, average time and the newest five calls (four when there is a crash banner). Tap a call to open it in Tracewell, or use Open and Clear. On Android 13 and newer, choose Turn on in the Network tab to grant notification permission. Call Tracewell.install(context, showNotification = false) to turn it off.

Requirements

  • compileSdk 35 or newer, and minSdk 24 or newer. Tracewell is pinned to Compose Multiplatform 1.8.2 (Compose 1.8), AndroidX activity 1.10, core 1.16 and lifecycle 2.9, which all fit compileSdk 35. The no-op artifacts have no compileSdk requirement.
  • Android Gradle Plugin 8.10 or newer. Tested with AGP 8.10.1 on Gradle 8.11.1.
  • Kotlin 2.0 or newer if the app calls Tracewell from Kotlin: the public classes are written with Kotlin 2.0 metadata. The rest is built with Kotlin 2.2 but only read at run time.
  • Compose is upgraded to 1.8.x in debug builds if the app uses an older version, because Gradle picks the highest.
  • No AndroidX Startup needed. Tracewell starts from its own ContentProvider, so apps that remove Startup's provider from their manifest still work with no extra code.

The versions behind these requirements are in gradle/libs.versions.toml. To see why a library version was chosen, look for minCompileSdk in its aar-metadata.properties.

Project layout

  • /tracewell-android: the Android library apps add as debugImplementation. It starts itself, adds the launcher shortcut, and opens Tracewell in its own task.
  • /tracewell-android-noop: the same public API with empty bodies, for releaseImplementation.
  • /tracewell-okhttp and /tracewell-okhttp-noop: the OkHttp interceptor for the Network tab and its empty twin.
  • /sdk: the screens and data engine, published as tracewell-core. It is written with Compose Multiplatform; commonMain is shared, and androidMain holds log capture and the crash hook. The iOS side only shows sample data so far and is not published.
  • /samples/android: a small app that uses all of them and checks the release build.

Building from source

Try your changes in another app on this machine by publishing to your local Maven folder (~/.m2):

./gradlew publishToMavenLocal

Add mavenLocal() to the other app's repositories in settings.gradle.kts, and use the coordinates from Install.

  • Android sample app: ./gradlew :samples:android:installDebug
  • Unit tests, as CI runs them: ./gradlew :sdk:testAndroidHostTest :tracewell-android:testDebugUnitTest :tracewell-okhttp:testDebugUnitTest
  • On a connected Android device (real SQLite and logcat): ./gradlew :sdk:connectedAndroidDeviceTest
  • Release build contains no Tracewell code: ./gradlew :samples:android:verifyReleaseHasNoTracewell
  • iOS, which is built only when asked for: ./gradlew :sdk:iosSimulatorArm64Test -Ptracewell.ios=true, or open /iosApp in Xcode.

Publishing a release to Maven Central is described in RELEASING.md.

License

Copyright 2026 Diraj Naik

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

About

Debug-only inspector that lives inside your Android app: browse its database, see every API call, read logs and crashes, with AI explanations. No setup, nothing in release builds.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages