an android library for debugging what we care about directly in app.

Overview

EN | 中文

Pandora is a tool box that allows you to inspect and modify what includes networks, databases, UIs, etc. directly in your application. It is suitable for rapid position of various problems in the development and testing stages.

Demo

Feature

Network logs

  • Check the detailed logs of network requests, such as headers, body, error messages, and so on.
  • Support all network libraries based on OKHTTP and Android native HttpURLConnection, covering most network development situations.

Sandbox

  • View the app's private storage directory, and can export files to SDcard.
  • Supports browsing and editing SQLite databases, SharedPref files.

UI:Select、Hierarchy、Baseline、Gridline

  • View and modify properties of any Widget, such as the widget's size, color, text content, and so on.
  • Grab and move any widget, view the boundaries and relative distance between widgets, detect alignment, layout and other issues.
  • View the hierarchy of any UI, support Activity, Dialog, PopupWindow, etc.

Other tools

  • Show the current Activity in real time.
  • Supports recording crash, compatible with third-party Crash libraries.
  • You can add shortcut to Pandora.
  • You can open any Activity of your app.
  • You can view the lifecycle history of Activities.

Usage

  1. Declare Jitpack repository and add dependencies:

    // android-support
    debugImplementation 'com.github.whataa:pandora:v${RELEASE}'
    // or androidX
    debugImplementation 'com.github.whataa:pandora:androidx_v${RELEASE}'
    
    // No matter android-support or AndroidX
    releaseImplementation 'com.github.whataa:pandora-no-op:v${RELEASE}'
    
    library version
    pandora Release
    pandora-no-op Release
  2. (Optional)If your project use OKHttp as a network library, interceptor can be injected into OKhttp by pandora-plugin Download

    // in your project's gradle
    buildscript {
        dependencies {
            ...
            classpath 'com.github.whataa:pandora-plugin:1.0.0'
        }
    }
    
    // in your app's gradle
    apply plugin: 'com.android.application'
    apply plugin: 'pandora-plugin'
    
  3. Grant permission to "Overlay Windows" and shake your device.

Feature APIs and Problems

Thanks

Pandora was developed on the shoulders of giants. Thanks to the following open source projects or person:

  • Logo and Icon are produced by the designer Zularizal.

  • Inspired by Flipboard's open source iOS platform debugging tool FLEX

  • Project database module ideas and part of the source code from Facebook's open source project stetho

  • The idea of selecting views in the UI module of the project and part of the source code from eleme's open source project UETool

  • The request API in the Demo module comes from jgilfelt's open source project chuck

License

Apache-2.0

Comments
  • 空指针异常

    空指针异常

    按照文档集成到项目中,运行后直接崩溃 java.lang.RuntimeException: Unable to get provider tech.linjiang.pandora.Pandora: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference at android.app.ActivityThread.installProvider(ActivityThread.java:5363) at android.app.ActivityThread.installContentProviders(ActivityThread.java:4881) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4815) at android.app.ActivityThread.access$1600(ActivityThread.java:168) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1440) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:150) at android.app.ActivityThread.main(ActivityThread.java:5659) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:822) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:712) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference at tech.linjiang.pandora.util.ViewKnife.getResouces(ViewKnife.java:37) at tech.linjiang.pandora.util.ViewKnife.getString(ViewKnife.java:53) at tech.linjiang.pandora.FuncController$1.getName(FuncController.java:137) at tech.linjiang.pandora.FuncController.addFunc(FuncController.java:45) at tech.linjiang.pandora.FuncController.addDefaultFunctions(FuncController.java:129) at tech.linjiang.pandora.FuncController.<init>(FuncController.java:39) at tech.linjiang.pandora.Pandora.init(Pandora.java:39) at tech.linjiang.pandora.Pandora.onCreate(Pandora.java:33) at android.content.ContentProvider.attachInfo(ContentProvider.java:1748) at android.content.ContentProvider.attachInfo(ContentProvider.java:1723) at android.support.v4.content.FileProvider.attachInfo(FileProvider.java:382) at android.app.ActivityThread.installProvider(ActivityThread.java:5360) at android.app.ActivityThread.installContentProviders(ActivityThread.java:4881)  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4815)  at android.app.ActivityThread.access$1600(ActivityThread.java:168)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1440)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:150)  at android.app.ActivityThread.main(ActivityThread.java:5659)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:822)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:712) 

    opened by KaelInvoker 13
  • Attempt to invoke virtual method 'android.view.Window android.app.Activity.getWindow()'

    Attempt to invoke virtual method 'android.view.Window android.app.Activity.getWindow()'

    2019-06-19 19:32:00.284 13279-13279/com.tencent.igame E/MtaSDK.CaughtExp: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.Window android.app.Activity.getWindow()' on a null object reference
            at tech.linjiang.pandora.util.ViewKnife.tryGetTheFrontView(ViewKnife.java:258)
            at tech.linjiang.pandora.inspector.ElementHoldView.tryGetFrontView(ElementHoldView.java:103)
            at tech.linjiang.pandora.ui.fragment.ViewFragment.getLayoutView(ViewFragment.java:53)
            at tech.linjiang.pandora.ui.fragment.BaseFragment.onCreateView(BaseFragment.java:109)
            at android.support.v4.app.Fragment.performCreateView(Fragment.java:2439)
            at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1460)
            at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1784)
            at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1852)
            at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:802)
            at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2625)
            at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2411)
            at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2366)
            at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2273)
            at android.support.v4.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3273)
            at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:3229)
            at android.support.v4.app.FragmentController.dispatchActivityCreated(FragmentController.java:201)
            at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:620)
            at android.support.v7.app.AppCompatActivity.onStart(AppCompatActivity.java:178)
            at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1419)
            at android.app.Activity.performStart(Activity.java:7457)
    
    opened by bravekingzhang 9
  • Compatibility issues in latest version (from v2.0.3 to v2.0.6)

    Compatibility issues in latest version (from v2.0.3 to v2.0.6)

    Latest versions cause a startup crash when using Android R build tools (preview). They also have considerably increase the minimum Android API required to use Pandora to API 21 but the minSdkVersion flag of this library still allowing API 14.

    Android R problem:

    1. Update Android Studio to latest version (3.6.1).
    2. Create a new app project targeting Android R, it will automatically have:
    android {
        compileSdkVersion 'android-R'
        buildToolsVersion "29.0.3"
        defaultConfig {
            minSdkVersion 'R'
            targetSdkVersion 'R'
        }
    }
    
    1. Add jitpack and dependencies to the latest Pandora versions (v2.0.6)
    2. App builds but crash on initialisation with different outputs per versions

    Pandora v2.0.6: FATAL EXCEPTION: java.lang.ExceptionInInitializerError at okhttp3.OkHttpClient.(OkHttpClient.kt:211)...

    Pandora v2.0.3, v2.0.4 and v2.0.5: FATAL EXCEPTION: java.lang.NoSuchMethodError: No static method metafactory(...)Ljava/lang/invoke/CallSite; in class Ljava/lang/invoke/LambdaMetafactory; or its super classes (...) at okhttp3.internal.Util.(Util.java:87)...

    Pandora v2.0.2: Ok!

    API<21 problem

    Apps also crash if using latest versions in devices with API between 14 and 20:

    Pandora v2.0.3, v2.0.4, v2.0.5 and v2.0.6: FATAL EXCEPTION: java.lang.ExceptionInInitializerError at okhttp3.OkHttpClient.(OkHttpClient.kt:211)... Caused by: java.lang.IllegalStateException: Expected Android API level 21+ but was 19.

    Cause

    I believe all this issues are caused by the upgrade to Okhttp to v4.0.1 performed in Pandora v2.0.3.

    Temporarily solution

    We have downgrade Pandora to v2.0.2 and Retrofit to v2.3.0 (both using OkHttp 3.9.0). We can now run our app without problem from API 14 to latest API R (both included).

    opened by rafaco 7
  • Logo Design For Pandora

    Logo Design For Pandora

    Hi @whataa , I'm a graphic designer after I review your project, I'm interested in your project and I want to create a unique and modern logo for your project. You can see the logo that I have designed in the previous projects.

    Best Regards, Zularizal

    opened by zularizal 7
  • 新建BuildTypes的时候,启动黑屏。

    新建BuildTypes的时候,启动黑屏。

    buildTpyes中多加了一个类型debugTest,使用这个运行就会出问题。 gradle中的配置如下:

    buildTypes {
        release {
            debuggable false
            minifyEnabled true
            shrinkResources true
            zipAlignEnabled true
            signingConfig signingConfigs.release
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            // 是否处于调试状态
            buildConfigField("boolean", "IS_DEBUGING", "false")
            // 服务器IP端口前缀等的配置
            buildConfigField("String", "ENVIROMENT", "\"pro\"")
        }
        debugTest.initWith(release)
        debugTest {
            // 可调试
            debuggable true
            // LogUtils 是否打印日志
            buildConfigField("boolean", "IS_DEBUGING", "true")
            buildConfigField("String", "ENVIROMENT", "\"test\"")
            // App版本号后缀
            versionNameSuffix ".test"
            // 执行构建这个编译版本时,如果某个子模块中没有 debugTest 这个版本
            // Gradle 3.X 会一一按照你指定的 matchingFallbacks 从前往后依次寻找,直到类型匹配
            matchingFallbacks = ['debugTest', 'release', 'debug']
        }
    }
    
    dependencies {
        // Pandora 调试用
        debugImplementation 'com.github.whataa:pandora:v2.0.0'
        debugTestImplementation 'com.github.whataa:pandora-no-op:v2.0.1'
        // 这里如果想开启Pandora功能的话,启动会黑屏,没有主进程,只有其他进程
        //debugTestImplementation 'com.github.whataa:pandora:v2.0.0'
        releaseImplementation 'com.github.whataa:pandora-no-op:v2.0.1'
    }
    
    opened by NevermoreNevermore 6
  • 添加依赖后会崩溃

    添加依赖后会崩溃

    2019-05-05 18:17:08.308 30725-30725/com.mobile.wx E/AndroidRuntime: FATAL EXCEPTION: main Process: com.mobile.wx, PID: 30725 Theme: themes:{default=, iconPack:com.gometheme.defaulttheme} java.lang.NullPointerException: Attempt to invoke virtual method 'void java.lang.reflect.AccessibleObject.setAccessible(boolean)' on a null object reference at com.mobile.wx.ui.MeHomeFragment.setIndicator(MeHomeFragment.java:228)

    opened by xiecai1234 5
  • How to close it programmatically?

    How to close it programmatically?

    I found it's possible to close with EntranceView.close().

    However, my project will not compile trying to generate the release version, since EntranceView it's not part of the pandora-no-op.

    Would it be possible to add it, even if close method is completely empty? I just want it to compile, I have pandora disabled for release mode.

    Or is it a different way to hide the pandora bar?

    opened by amanzan 5
  • 冲突问题

    冲突问题

    debugApi ('com.github.whataa:pandora:v2.0.4') { exclude group: 'com.android.support' exclude group: 'com.squareup.okhttp3' } releaseApi ('com.github.whataa:pandora-no-op:v2.0.3') { exclude group: 'com.android.support' exclude group: 'com.squareup.okhttp3' }

    之前只需要排除support 今天升级2.0.4连okhttp也要排除了 建议想办法处理下 今天也推荐了给了个朋友使用 他也是因为报冲突 老项目又不敢轻易动之前的 最后放弃使用了

    opened by joker-fu 4
  • NullPointerException

    NullPointerException

    CrashReport: java.lang.NullPointerException: interceptor com.hyhs.oa.framework.network.HttpLoggingInterceptor@5d7b7d returned null at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:157) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at tech.linjiang.pandora.network.OkHttpInterceptor.intercept(OkHttpInterceptor.java:64) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200) at okhttp3.RealCall$AsyncCall.execute(RealCall.java:147) at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) at java.lang.Thread.run(Thread.java:764)

    bug 
    opened by joker-fu 4
  • Android 9.0 can not open activity

    Android 9.0 can not open activity

    device: Google Pixel2 system: Android 9

    E/AndroidRuntime: FATAL EXCEPTION: main
        Process: com.echatsoft.nativesdkdemo, PID: 17203
        android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity  context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
            at android.app.ContextImpl.startActivity(ContextImpl.java:912)
            at android.app.ContextImpl.startActivity(ContextImpl.java:888)
            at android.content.ContextWrapper.startActivity(ContextWrapper.java:379)
            at tech.linjiang.pandora.ui.Dispatcher.start(Dispatcher.java:41)
            at tech.linjiang.pandora.ui.connector.OnEntranceClick.onClick(OnEntranceClick.java:37)
            at tech.linjiang.pandora.Pandora$2.onClick(Pandora.java:69)
            at tech.linjiang.pandora.ui.connector.OnEntranceClick.onClick(OnEntranceClick.java:21)
            at tech.linjiang.pandora.ui.view.EntranceView.onClick(EntranceView.java:189)
            at android.view.View.performClick(View.java:6597)
            at android.view.View.performClickInternal(View.java:6574)
            at android.view.View.access$3100(View.java:778)
            at android.view.View$PerformClick.run(View.java:25885)
            at android.os.Handler.handleCallback(Handler.java:873)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:193)
            at android.app.ActivityThread.main(ActivityThread.java:6669)
            at java.lang.reflect.Method.invoke(Native Method)
            at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
    
    opened by xuhaoyang 4
  • 期望加入的功能

    期望加入的功能

    position功能点击某个view的时候,可以显示是哪个Activity的View或者是哪个Activity下的Fragment的View 例如:MainActivity->HomeFragment->TextView->@app:id/tv_content 这样可以利用Android Studio的全局搜索功能快速定位到所要定位的页面及要修改view 应用页面太多了,会经常用到这个命令,查找Activity,如果应用本身就有这个功能就太好了 adb shell dumpsys window windows | grep -E 'mCurrentFocus|mFocusedApp' --color=always

    enhancement 
    opened by zzyyppqq 4
  • Is it possible to use pandora in release mode?

    Is it possible to use pandora in release mode?

    I'd like to use pandora in release mode. I know it's supposed to be used in debug builds, but I have a published app in Google Play in a closed testing track, and I'd like to use it here.

    Is it possible? I have this gradle import, but it only works for debug builds:

    implementation 'com.github.whataa:pandora:androidx_v2.1.0'
    
    opened by amanzan 0
  • 添加okhttp plugin,启动后崩溃

    添加okhttp plugin,启动后崩溃

    崩溃报interceptor == null,于是去掉plugin,手动在Okhttp初始化处加入 OkHttpClient.Builder builder = new OkHttpClient.Builder(); builder.dns(new HttpDns()) .addInterceptor(new OkHttpInterceptor()) .retryOnConnectionFailure(true); 报factory already defined

    opened by KaelInvoker 0
  • Bug in English translation of permission request string

    Bug in English translation of permission request string

    The permission request popup in English includes "%s" -- I assume it was originally supposed to be replaced at runtime with another string. It can just be removed if string replacement no longer needed.

    device-2021-01-07-105956

    Screenshot 2021-01-07 at 10 38 36

    opened by jhavatar 0
  • Android 10.0  FileProvider导致运行就闪退

    Android 10.0 FileProvider导致运行就闪退

    版本信息: com.github.whataa:pandora-plugin:1.0.1 com.github.whataa:pandora:androidx_v2.1.0 com.github.whataa:pandora-no-op:v2.0.3

    com.android.tools.build:gradle:3.5.4 https://services.gradle.org/distributions/gradle-6.5-all.zip

    image

    image

    opened by Khaos116 3
  • 使用Android Studio gradle build tools 3.6以上安装到手机上打开崩溃找不到R$drawable

    使用Android Studio gradle build tools 3.6以上安装到手机上打开崩溃找不到R$drawable

    Caused by: java.lang.ClassNotFoundException: Didn't find class "tech.linjiang.pandora.core.R$drawable"

    当升级到 Android Studio gradle build tools 3.6 直接运行到手机上,无法启动, 此类错误在realm的issues中也找到类似的了,人家已经解决了, 参考连接:https://github.com/realm/realm-java/issues/6531 参考连接:https://issuetracker.google.com/issues/130965921#comment14

    opened by cocowobo 1
Releases(v2.1.0)
Owner
linjiang
linjiang
A small library to help with Realm.IO integration in Android apps

Android Realm Asset Helper A small library of methods to help with Realm.IO integration in Android apps Copies a realm database from a the assets fold

Quality Mobile Puzzle Apps 29 Dec 28, 2021
Pref-DB - Android SharedPreferences alternative library

Pref-DB Android SharedPreferences alternative library.

M.Fakhri 5 Sep 14, 2022
A helper library to help using Room with existing pre-populated database [].

Room now supports using a pre-packaged database out of the box, since version 2.2.0 https://developer.android.com/jetpack/androidx/releases/room#2.2.0

Ibrahim Eid 136 Nov 29, 2022
A library for reading Shared Preferences and Database values within the application.

AppDataReader A library for reading and writing Shared Preferences and Database values of the application within the device. Advantages of using this

Anshul Jain 124 Nov 25, 2022
A quick and easy database manager plugin library for your DBFlow databases.

DBFlowManager A quick and easy database manager and viewer plugin library for your DBFlow databases to view, insert, delete, update the tables directl

Wajahat Karim 26 Oct 21, 2022
An Android helper class to manage database creation and version management using an application's raw asset files

THIS PROJECT IS NO LONGER MAINTAINED Android SQLiteAssetHelper An Android helper class to manage database creation and version management using an app

Jeff Gilfelt 2.2k Jan 7, 2023
A wrapper around Android's SQLiteDatabase with restoring capability

Restorable SQLiteDatabase RestorableSQLiteDatabase is a wrapper to replicate android's SQLiteDatabase class with restoring capability. This wrapper ma

Navid 21 Oct 21, 2022
A simple NoSQL client for Android. Meant as a document store using key/value pairs and some rudimentary querying. Useful for avoiding the hassle of SQL code.

SimpleNoSQL A simple NoSQL client for Android. If you ever wanted to just save some data but didn't really want to worry about where it was going to b

Colin Miller 389 Sep 25, 2022
A key-value database for Android

SnappyDB SnappyDB is a key-value database for Android it's an alternative for SQLite if you want to use a NoSQL approach. It allows you to store and g

Nabil Hachicha 1.8k Dec 28, 2022
Insanely easy way to work with Android Database.

Sugar ORM Insanely easy way to work with Android databases. Official documentation can be found here - Check some examples below. The example applicat

null 2.6k Dec 16, 2022
Android Database Performance Benchmarks

ℹ Check out our new performance test app that includes ObjectBox. Android Database Performance Benchmark This project evaluates Android databases and

Markus Junginger 80 Nov 25, 2022
Core Data for Android

NexusData Core Data for Android NexusData is an object graph and persistence framework for Android. It allows for organizing and managing relational d

Dia Kharrat 71 Nov 11, 2022
🧬 Android DataBinding kit for notifying data changes from Model layers to UI layers on MVVM architecture.

?? Android DataBinding kit for notifying data changes from Model layers to UI layers on MVVM architecture.

Jaewoong Eum 276 Jan 5, 2023
Kodein-DB is a Kotlin/Multiplatform embedded NoSQL database that works on JVM, Android, Kotlin/Native and iOS.

Kodein-DB is a Kotlin/Multiplatform embedded NoSQL database that works on JVM, Android, Kotlin/Native and iOS. It is suited for client or mobile applications.

null 277 Dec 3, 2022
Test any type of cloud database on Android apps. No need of a dedicated backend.

Test any type of cloud database on Android apps. No need of a dedicated backend.

Arjun 9 May 9, 2022
Android with Real-time Database

Android with Real-time Database It was too much effort to build my own real-time database, but the result really satisfying, so it was worth it. Note

null 4 Jun 14, 2022
A library for debugging android databases and shared preferences - Make Debugging Great Again

Android Debug Database Android Debug Database is a powerful library for debugging databases and shared preferences in Android applications Android Deb

AMIT SHEKHAR 8.1k Dec 29, 2022
Pixplicity 915 Nov 8, 2022
An elegant context-care loading placeholder for Android

FiftyShadesOf An elegant context-care loading placeholder for Android Usage FiftyShadesOf.with(context) .on(view1, view2, view3)

Florent CHAMPIGNY 1.1k Nov 21, 2022
TakeNotes, taking care of your tasks and your health

Take Notes - Para tornar sua rotina mais Saudável TakeNotes, cuidando de suas tarefas e de sua saúde Sobre • Funcionalidades • Layout • Como executar

null 0 Dec 7, 2021