All Projects → tomoima525 → debot

tomoima525 / debot

Licence: other
A simple Android library to create Debugging menu

Programming Languages

kotlin
9241 projects
java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to debot

hugo-bare-min-theme
A bare minimum theme for Hugo (https://gohugo.io) to help develop and debug Hugo sites -- https://hugo-bare-min.netlify.com/,
Stars: ✭ 71 (-8.97%)
Mutual labels:  debug
Debloat
Remove ads, bloatware and speed up your device.
Stars: ✭ 44 (-43.59%)
Mutual labels:  debug
objprint
A library that can print Python objects in human readable format
Stars: ✭ 141 (+80.77%)
Mutual labels:  debug
Unity-File-Debug
Enhanced debug logging for Unity, with JSON/CSV export and HTML viewer.
Stars: ✭ 50 (-35.9%)
Mutual labels:  debug
go-getting-started
Develop Go Apps in Kubernetes with Okteto
Stars: ✭ 32 (-58.97%)
Mutual labels:  debug
kube-debug
一鍵調試kubernetes和docker容器的Web視覺化工具箱。A toolbox for debugging docker container and kubernetes with web UI.
Stars: ✭ 46 (-41.03%)
Mutual labels:  debug
jscodeshift-typescript-example
jscodeshift typescript codemod example
Stars: ✭ 27 (-65.38%)
Mutual labels:  debug
ignition-code-editor
Add inline code editing to your ignition page
Stars: ✭ 44 (-43.59%)
Mutual labels:  debug
XDebugger
A very lightweight library (4Kb) to create a development or production debugger with custom errors readable for humans. Includes errors in table format, logger and search methods with dynamic filters.
Stars: ✭ 18 (-76.92%)
Mutual labels:  debug
var-dumper
Helper for dumping variable for debug purposes
Stars: ✭ 13 (-83.33%)
Mutual labels:  debug
AllYourMemoriesAreBelong2iOS
💪 Simulate iOS on-device memory warnings like a hero.
Stars: ✭ 17 (-78.21%)
Mutual labels:  debug
grpcdebug
grpcdebug is a command line interface focusing on simplifying the debugging process of gRPC applications.
Stars: ✭ 25 (-67.95%)
Mutual labels:  debug
ignition-tinker-tab
An Ignition tab to tinker with your Laravel app
Stars: ✭ 30 (-61.54%)
Mutual labels:  debug
pydbg
Python implementation of the Rust `dbg` macro
Stars: ✭ 85 (+8.97%)
Mutual labels:  debug
iyov
Web proxy for http(s) for developers to analyze data between client and servers based on workerman, especailly for app developers.
Stars: ✭ 27 (-65.38%)
Mutual labels:  debug
MCUCapture
Utility for plotting array data from MCU RAM
Stars: ✭ 22 (-71.79%)
Mutual labels:  debug
state inspector
State change & method call logger. A debugging tool for instance variables and method calls.
Stars: ✭ 24 (-69.23%)
Mutual labels:  debug
xr
Lightweight debug server utility for PHP.
Stars: ✭ 116 (+48.72%)
Mutual labels:  debug
vscode-leetcode-cpp-debug
Debug support for LeetCode with C++
Stars: ✭ 14 (-82.05%)
Mutual labels:  debug
caddy-trace
Request Debugging Middleware Plugin for Caddy v2
Stars: ✭ 25 (-67.95%)
Mutual labels:  debug

Android Arsenal Circle CI

Debot

debot_logo.png
A simple Android library for Debugging menu.

Debot offers a customizable debug menu for Android app development. It does not affect production code. Developers can easily add their own custom debugging features with simple steps.

debot_4.gif

How it works

If you are using an emulator, just press command + M. If you are running your dev app on a real device, shake it. The debug menu dialog will show up.

How it looks

By default, there are debug menus below.

  • Default debugging menu
    debot-sample1.png
  • Check Density
    debot-sample4.png
  • Check App ver
    debot-sample2.png
  • Show intent and Activity Info
    debot-sample3.png
  • Dev input (Automatically adds text to EditText field )
    debot-sample5.png

Setup

Download

NOTE:

  • Debot is provided by JitPack from version 2.0.7. The groupId is changed to com.github.tomoima525.debot from this version.

Grab Debot from Gradle:

allprojects {
    repositories {
        // ...
        maven("https://jitpack.io")
    }
}

dependencies {
    debugImplementation("com.github.tomoima525.debot:debot:{latest_version}")
    releaseImplementation("com.github.tomoima525.debot:debot-no-op:{latest_version}")
}

Make sure you compile debot-no-op in the release build.

Initialization

  1. Call DebotConfigurator.configureWithDefault() at the Application's onCreate() class.
public class MyApplication extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        DebotConfigurator.configureWithDefault();
    }
}
  1. Set below to any Activity you want to show the debugging menu.
public class MainActivity extends AppCompatActivity{
    Debot debot;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        debot = Debot.getInstance();
    }
    @Override
    public boolean onKeyUp(int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_MENU) {
            debot.showDebugMenu(this);
        }
        return super.onKeyUp(keyCode, event);
    }

}    

It is preferred to put these code in your BaseActivity if you have one. That's it!

If you want the debug menu on a real device, add code below.

public class MainActivity extends AppCompatActivity{
    Debot debot;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        debot = Debot.getInstance();
        debot.allowShake(getApplicationContext()); //Make sure to use Application context, or it will leak memory
    }
    @Override
    public boolean onKeyUp(int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_MENU) {
            debot.showDebugMenu(this);
        }
        return super.onKeyUp(keyCode, event);
    }

    @Override
    protected void onResume() {
        super.onResume();
        debot.startSensor(this);
    }

    @Override
    protected void onPause() {
        super.onPause();
        debot.stopSensor();
    }
}

See the debot-sample project for more details.

Custom debugging plugins

You can create your own debugging feature by developing a class which inherits DebotStrategy.

public class MyDebotStrategy extends DebotStrategy{
    @Override
    public void startAction(@NonNull Activity activity) {
    // Do your things
    }
}

Then, at the Application class, call Debot.configureWithCustomizedMenu()

public class MyApplication extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        DebotStrategyBuilder builder = new DebotStrategyBuilder.Builder()
                .registerMenu("My debug feature", new MyDebotStrategy())
                .build();
        DebotConfigurator.configureWithCustomizedMenu(builder.getStrategyList());
    }
}

Call a specific method from your Activity

If you want to call a specific method from your Activity, annotate the method with @DebotAnnotation

//Your Activity
@DebotAnnotation("debugInput")  // A parameter for @DebotAnnotation should be same as the method's name
public void debugInput() {
    // Do things
}

Also, setup a custom debugging plugin with DebotCallActivityMethodStrategy

public class MyApplication extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        DebotStrategyBuilder builder = new DebotStrategyBuilder.Builder()
                .registerMenu("input", new DebotCallActivityMethodStrategy("debugInput"))
                .build();
        DebotConfigurator.configureWithCustomizedMenu(builder.getStrategyList());
    }
}

Usage with Kotlin project

You don't have to change any code with Kotlin project. However, you might see kotlin-stdlib error when you include Debot into your project.

Error:Conflict with dependency 'org.jetbrains.kotlin:kotlin-stdlib' in project ':app'. Resolved versions for app (1.0.2) and test app (1.1.2-4) differ. See http://g.co/androidstudio/app-test-app-conflict for 
details.

In that case, you should setup stdlib dependency explicitly. In your project's build.gradle file, add the line below:

 configurations.all {
     resolutionStrategy {
         force 'org.jetbrains.kotlin:kotlin-stdlib:{whatever the version of Kotlin you are using}'
     }
 }

See details here: https://github.com/nhaarman/mockito-kotlin/issues/146

Credit

seismic - Square, Inc.

License

Tomoaki Imai 2018
Licensed under the Apache License, Version 2.0 (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.

You agree that all contributions to this repository, in the form of fixes, 
pull-requests, new examples etc. follow the above-mentioned license.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].