🍼Debug Bottle is an Android runtime debug / develop tools written using kotlin language.

Overview
build:created version:maven-central

🇨🇳 中文 / 🇯🇵 日本語 / 🇬🇧 English

🍼 Debug Bottle

An Android debug / develop tools written using Kotlin language. All the features in Debug bottle are only available on debug build version with your app, it doesn't has an impact on release version.

Demo App is now available at Google Play:

Get it on Google Play

What can I do with Debug Bottle?

OkHttp Sniffer

Enable "Network Listener" at Settings, then you can see all network traffics what requested by your app.

Scalpel Viewer

Enable "3D View", then you can view your Activity. When interaction is enabled the following gestures are supported:

  • Single touch: Controls the rotation of the model.
  • Two finger vertical pinch: Adjust zoom.
  • Two finger horizontal pinch: Adjust layer spacing.

Shared Preferences editor

Preview and edit the Shared Preferences of app more simply.

Strict Mode

Enable or disable Android strict mode at runtime. StrictMode is a developer tool which detects things you might be doing by accident and brings them to your attention so you can fix them. StrictMode is most commonly used to catch accidental disk or network access on the application's main thread, where UI operations are received and animations take place. For more information, see Android Developers.

Crash Log

List all crash stacktrace logs.

Leak Canary

Leak Canary is fully imported. Leak Canary is a memory leak detection library for Android and Java. More about using Leak Canary by visiting Leak Canary wiki.

Block Canary

Detect UI blocks at runtime.

Development Entries

Launch any Activity with custom Intents, or Runnable you want.

How do I use it?

After installing Debug Bottle Demo app, you'll find there are two app icons appears to launcher. Click bottle icon to run Debug Bottle.

Setting up

1. Configure your Gradle project

Add snapshot of maven central repository to primary Gradle file:

allprojects {
    repositories {
        ...
        mavenCentral()
    }
}

Edit and add dependencies in your app module:

dependencies {
    debugCompile 'com.exyui.android:debug-bottle-runtime:1.1.1'

    // Use this in your Java project
    releaseCompile 'com.exyui.android:debug-bottle-noop-java:1.1.1'
    testCompile 'com.exyui.android:debug-bottle-noop-java:1.1.1'

    // Use this in your Kotlin project
    releaseCompile 'com.exyui.android:debug-bottle-noop-kotlin:1.1.1'
    testCompile 'com.exyui.android:debug-bottle-noop-kotlin:1.1.1'

    compile 'com.android.support:appcompat-v7:23.2.0+'
}

Specially, Debug Bottle not only support API 23+, but also 22. To support API 22, please add dependencies like this:

dependencies {
    debugCompile 'com.exyui.android:debug-bottle-runtime:1.0.6-support22'

    // Use this in your Java project
    releaseCompile 'com.exyui.android:debug-bottle-noop-java:1.0.6-support22'
    testCompile 'com.exyui.android:debug-bottle-noop-java:1.0.6-support22'

    // Use this in your Kotlin project
    releaseCompile 'com.exyui.android:debug-bottle-noop-kotlin:1.0.6-support22'
    testCompile 'com.exyui.android:debug-bottle-noop-kotlin:1.0.6-support22'

    compile 'com.android.support:appcompat-v7:22+'
}

To support API 23, add dependencies like this:

dependencies {
    debugCompile 'com.exyui.android:debug-bottle-runtime:1.0.6-support23'

    // Use this in your Java project
    releaseCompile 'com.exyui.android:debug-bottle-noop-java:1.0.6-support23'
    testCompile 'com.exyui.android:debug-bottle-noop-java:1.0.6-support23'

    // Use this in your Kotlin project
    releaseCompile 'com.exyui.android:debug-bottle-noop-kotlin:1.0.6-support23'
    testCompile 'com.exyui.android:debug-bottle-noop-kotlin:1.0.6-support23'

    compile 'com.android.support:appcompat-v7:23+'
}

2. Edit Manifest

Add Debug Bottle main Activity in your Manifest:

<activity
    android:name="com.exyui.android.debugbottle.components.DTDrawerActivity"
    android:theme="@style/Theme.AppCompat.Light"
    android:label="The Name You Like"/>

The value of tag label, will display to your android launch pad.

3. Inject Debug Bottle into your Application

First, you may implement Block Canary Context:

public class AppBlockCanaryContext extends BlockCanaryContext {...}

Now you could inject Debug Bottle in your Application like:

public class MyApplication extends Application{
    @Override
    public void onCreate() {
        super.onCreate();
        DTInstaller.install(this)
            .setBlockCanary(new AppBlockCanaryContext(this))
            .setOkHttpClient(httpClient)
            .setInjector("your.package.injector.ContentInjector")
            .setPackageName("your.package")
            .enable()
            .run();
    }
}

Or if you use Kotlin, you can inject like:

class MyApplication: Application() {
    override fun onCreate() {
        super.onCreate()
        DTInstaller.install(this)
            .setBlockCanary(AppBlockCanaryContext(this))
            .setOkHttpClient(httpClient)
            .setInjector("your.package.injector.ContentInjector")
            .setPackageName("your.package")
            .enable()
            .run()
    }
}

Links

License

Debug Bottle

Copyright 2016 Yuriel (http://exyui.com).

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.

Debug Bottle required features are based on or derives from projects below:

You might also like...
KaMP Kit by Touchlab is a collection of code and tools designed to get your mobile team started quickly with Kotlin Multiplatform.
KaMP Kit by Touchlab is a collection of code and tools designed to get your mobile team started quickly with Kotlin Multiplatform.

KaMP Kit Welcome to the KaMP Kit! About Goal The goal of the KaMP Kit is to facilitate your evaluation of Kotlin Multiplatform (aka KMP). It is a coll

LifecycleMvp 1.2 0.0 Kotlin  is MVP architecture implementation with Android Architecture Components and Kotlin language features
LifecycleMvp 1.2 0.0 Kotlin is MVP architecture implementation with Android Architecture Components and Kotlin language features

MinSDK 14+ Download Gradle Add to project level build.gradle allprojects { repositories { ... maven { url 'https://jitpack.io' }

An awesome list that curates the best KMM libraries, tools and more.

Awesome KMM Kotlin Multiplatform Mobile (KMM) is an SDK designed to simplify creating cross-platform mobile applications. With the help of KMM, you ca

ATH Sample is a sample Authentication and Authorization Application with Kotlin Language and MVVM architecture.
ATH Sample is a sample Authentication and Authorization Application with Kotlin Language and MVVM architecture.

ATH Sample ATH Sample is a sample Authentication and Authorization Application with Kotlin Language and MVVM architecture. Overview ATH Sample is a sa

An under development minecraft plugin (1.8.8) to learning Kotlin language

CorePlus CorePlus is a minecraft plugin coded with Kotlin language. Still under development CorePlus will be an essential for each minecraft servers !

Kotlin DALL·E 2 is a new AI system that can create realistic images and art from a description in natural language.
Kotlin DALL·E 2 is a new AI system that can create realistic images and art from a description in natural language.

OpenAI Dall•E AI Kotlin Mobile App OpenAI Dall•E Application Build With Kotlin MVVM (Model - View - ViewModel) Clean Architecture, Beautiful Design UI

RoomJetpackCompose is an app written in Kotlin and shows a simple solution to perform CRUD operations in the Room database using Kotlin Flow in clean architecture.
RoomJetpackCompose is an app written in Kotlin and shows a simple solution to perform CRUD operations in the Room database using Kotlin Flow in clean architecture.

RoomJetpackCompose is an app written in Kotlin and shows a simple solution to perform CRUD operations in the Room database using Kotlin Flow in clean architecture.

Metremenqeemi - Android/iOS app to teach the Coptic Language

ⲙⲉⲧⲣⲉⲙⲛ̀ⲭⲏⲙⲓ The Open Source Android/iOS app to learn how to read and understand the Coptic Language Join our Discord Channel About the Curriculum The

fusion4j - declarative rendering language for the JVM based on Neos.Fusion

fusion4j - declarative rendering language for the JVM based on Neos.Fusion Supports the Neos Fusion syntax/semantic as described in the official Neos

Comments
  • 设置了OkhttpClient,运行报找不到类的错误

    设置了OkhttpClient,运行报找不到类的错误

    DTInstaller.install(application) .setBlockCanary(AppBlockCanaryContext(application)) .setOkHttpClient(RetrofitManager.client) .setInjector(ContentInjector()) .enable() .run() val client: OkHttpClient by lazy { createOkHttpClient() }

    private fun createOkHttpClient(): OkHttpClient { val httpLoggingInterceptor = HttpLoggingInterceptor() httpLoggingInterceptor.level = HttpLoggingInterceptor.Level.BODY

        return OkHttpClient.Builder()
                .addInterceptor(createTokenInterceptor())
                .addInterceptor(createBodyInterceptor())
                .addInterceptor(httpLoggingInterceptor)
                .connectTimeout(30L, TimeUnit.SECONDS)
                .readTimeout(30L, TimeUnit.SECONDS)
                .writeTimeout(30L, TimeUnit.SECONDS)
                .build()
    }
    

    08-16 15:09:57.377 28075-28075/com.xd.demi.todo I/art: Rejecting re-init on previously-failed class java.lang.Class<com.exyui.android.debugbottle.components.okhttp.LoggingInterceptor>: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/squareup/okhttp/Interceptor; at void com.exyui.android.debugbottle.components.DTInstaller.run() (DTInstaller.kt:218) Caused by: java.lang.ClassNotFoundException: Didn't find class "com.squareup.okhttp.Interceptor" on path: DexPathList[[zip file "/data/app/com.xd.demi.todo-1/base.apk", zip file "/data/app/com.xd.demi.todo-1/split_lib_dependencies_apk.apk", zip file "/data/app/com.xd.demi.todo-1/split_lib_slice_0_apk.apk", zip file "/data/app/com.xd.demi.todo-1/split_lib_slice_1_apk.apk", zip file "/data/app/com.xd.demi.todo-1/split_lib_slice_2_apk.apk", zip file "/data/app/com.xd.demi.todo-1/split_lib_slice_3_apk.apk", zip file "/data/app/com.xd.demi.todo-1/split_lib_slice_4_apk.apk", zip file "/data/app/com.xd.demi.todo-1/split_lib_slice_5_apk.apk", zip file "/data/app/com.xd.demi.todo-1/split_lib_slice_6_apk.apk", zip file "/data/app/com.xd.demi.todo-1/split_lib_slice_7_apk.apk", zip file "/data/app/com.xd.demi.todo-1/split_lib_slice_8_apk.apk", zip file "/data/app/com.xd.demi.todo-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.xd.demi.todo-1/lib/arm64, /data/app/com.xd.demi.todo-1/base.apk!/lib/arm at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:56) at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:380) at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312) at void com.exyui.android.debugbottle.components.DTInstaller.run() (DTInstaller.kt:218) at void com.xd.demi.TDLApplication.initDeBugBottle() (TDLApplication.kt:64) at void com.xd.demi.TDLApplication.onCreate() (TDLApplication.kt:47) at void android.app.Instrumentation.callApplicationOnCreate(android.app.Application) (Instrumentation.java:1027)

    我看了下是run方法中 调用了OkHttpLoader的load方法,load()中new了一个LoggingInterceptor(),这个是com.squareup.okhttp.Interceptor包里的 现在都是 com.squareup.okhttp3.Interceptor了

    opened by Demidong 0
  • AS 3.1中编译失败

    AS 3.1中编译失败

    在AS 3.1.0 中,添加依赖之后,Sync成功,编译失败,这是相关日志 Exception in thread "main" java.lang.NullPointerException: Couldn't find outer class com/exyui/android/debugbottle/components/DTDrawerActivity$infoLayout$2$1$1 of com/exyui/android/debugbottle/components/DTDrawerActivity$infoLayout$2$1$1$1 at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:1079) at com.google.devtools.build.android.desugar.ClassVsInterface.isOuterInterface(ClassVsInterface.java:56) at com.google.devtools.build.android.desugar.InterfaceDesugaring.visitOuterClass(InterfaceDesugaring.java:246) at org.objectweb.asm.ClassReader.accept(ClassReader.java:638) at org.objectweb.asm.ClassReader.accept(ClassReader.java:500) at com.google.devtools.build.android.desugar.Desugar.desugarClassesInInput(Desugar.java:477) at com.google.devtools.build.android.desugar.Desugar.desugarOneInput(Desugar.java:361) at com.google.devtools.build.android.desugar.Desugar.desugar(Desugar.java:314) at com.google.devtools.build.android.desugar.Desugar.main(Desugar.java:711)

    opened by chenfei0928 3
  • about version 1.1

    about version 1.1

    I found this project updated okhttp3.0 component yesterday, when it can be used?Readme now seems to be 1.0.6,and there is no getOkHttp3Interceptor method in 1.0.6!so sad!

    opened by ClownQiang 0
Releases(v1.0.4)
An example for who are all going to start learning Kotlin programming language to develop Android application.

Kotlin Example Here is an example for who are all going to start learning Kotlin programming language to develop Android application. First check this

Prabhakar Thota 56 Sep 16, 2022
Android MVVM framework write in kotlin, develop Android has never been so fun.

KBinding 中文版 Android MVVM framework write in kotlin, base on anko, simple but powerful. It depends on my another project AutoAdapter(A library for sim

Benny 413 Dec 5, 2022
An experimental tool for building console UI in Kotlin using the Jetpack Compose compiler/runtime

An experimental tool for building console UI in Kotlin using the Jetpack Compose compiler/runtime

Jake Wharton 1.4k Dec 28, 2022
This is a Kotlin multiplatform template project used to generate and deploy a natively compiled AWS lambda function using the custom runtime.

Overview This is a Kotlin multiplatform template project used to generate and deploy a natively compiled AWS Lambda function using a custom runtime. U

Greg Steckman 5 Jun 25, 2022
Develop an API that moves a rover around on a grid

Mars Rover Kata Develop an API that moves a rover around on a grid. Rules: You are given the initial starting 2D point (x,y) of a rover and the direct

Alvaro Martin Rodriguez 1 Dec 17, 2021
A furry-themed assembly language and interpreter written in Kotlin.

A furry-themed assembly language and interpreter written in Kotlin. Inspired by Furcode, the Synacor challenge, and JVM bytecode. I spent multiple hou

Maow 9 Nov 22, 2021
Kotlin Multiplatform runtime infix expressions evaluator.

Kotlin multiplatform expressions evaluator This is a kotlin multiplatform runtime infix expressions evaluator. Overview Operators The library supports

Azamat Murzagalin 13 Dec 30, 2022
Lambda-snake.kt - Snake Game Implementation for Web using Kotlin programming language compiled for Javascript

Projeto da disciplina de Linguagem de Programação Funcional 2021.1 (jan/2022) ??

Alex Candido 3 Jan 10, 2022
FaceTimeClone app that implements Coroutines , mvvm architecture , clean architecture , navigation component , hilt , etc.... using kotlin language

This repository contains a FaceTimeClone app that implements Coroutines , mvvm architecture , clean architecture , navigation component , hilt , etc.... using kotlin language

null 17 Dec 13, 2022
📒 NotyKT is a complete 💎Kotlin-stack (Backend + Android) 📱 application built to demonstrate the use of Modern development tools with best practices implementation🦸.

NotyKT ??️ NotyKT is the complete Kotlin-stack note taking ??️ application ?? built to demonstrate a use of Kotlin programming language in server-side

Shreyas Patil 1.4k Jan 4, 2023