Code Monkey home page Code Monkey logo

galileo's Introduction

picture

Galileo

Android library that helps you to debug applications directly from your android device. Just shake your device to get Galileo to work for you!

By default, Galileo shows three features: SharedPreferences edition, logcat analysis and network requests tracking. Besides that, it allows you to dump the state of your application to a txt file.

gif

Usage

It is as easy as adding this line to your onCreate Application method. In kotlin:

Galileo(this)

Or Java:

new Galileo(this);

If you want to track your network requests you must add GalileoInterceptor to your OkHttpClient.

OkHttpClient.Builder()
            .addInterceptor(Galileo.interceptor)
            .build()

Plugins

Preferator

An adaptation from Preferator which shows all app preferences files and allows you to edit or delete them.

Be careful with changing third-parties preferences. Some well known third-party libraries won't be shown by default in order to avoid undesired behaviours. You can find them here

Feel free to open a PR to add yours 😄

Thanks to Sloy for Preferator lib!!

Lynx

A wrapper for Lynx which shows your adb traces. Lynx is a well-known library in Android world that allows you to filter by TraceLevel and/or by a custom text.

Thanks to pedrovgs for Lynx lib!!

Chuck

An adaptation from Chuck which shows your HTTP requests and responses. With chuck you can track your network requests, see your backend responses and generate a share info text from request and response, or generate a curl command from that request.

Thanks to jgilfelt for Chuck lib!!

Snapshot file

Galileo allows you to generate a snapshot file with your application state. This txt file could be sent by email to you or your teammates.

This file is something like this:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%   PREFERATOR   %%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

===================================================
===================================================

SAMPLEACTIVITY 


some_int --> 42
some_boolean --> true
some_string --> a string value
some_long --> 1538218852181
some_set --> [a, b, c]
some_float --> 3.14

===================================================
===================================================


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%   LYNX   %%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Trace{level=DEBUG, message='09-29 12:59:45.939 OkHttp  (21743): <-- 401 UNAUTHORIZED https://httpbin.org/basic-auth/me/pass (112ms)'}
Trace{level=DEBUG, message='09-29 12:59:45.939 OkHttp  (21743): Connection: keep-alive'}
Trace{level=DEBUG, message='09-29 12:59:45.939 OkHttp  (21743): Server: gunicorn/19.9.0'}
Trace{level=DEBUG, message='09-29 12:59:45.939 OkHttp  (21743): Date: Sat, 29 Sep 2018 10:59:44 GMT'}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%   CHUCK   %%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

===================================================
===================================================

URL: https://httpbin.org/post
Method: POST
Protocol: http/1.1
Status: Complete
Response: 200 OK
SSL: Yes

Request time: Sat Sep 29 13:00:52 GMT+02:00 2018
Response time: Sat Sep 29 13:00:52 GMT+02:00 2018
Duration: 575 ms

Request size: 18 B
Response size: 421 B
Total size: 439 B

---------- REQUEST ----------

{
  "thing": "posted"
}

---------- RESPONSE ----------

Connection: keep-alive
Server: gunicorn/19.9.0
Date: Sat, 29 Sep 2018 11:00:51 GMT
Content-Type: application/json
Content-Length: 421
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Via: 1.1 vegur

{
  "args": {},
  "data": "{\"thing\":\"posted\"}",
  "files": {},
  "form": {},
  "headers": {
    "Accept-Encoding": "gzip",
    "Connection": "close",
    "Content-Length": "18",
    "Content-Type": "application/json; charset\u003dUTF-8",
    "Host": "httpbin.org",
    "User-Agent": "okhttp/3.11.0"
  },
  "json": {
    "thing": "posted"
  },
  "origin": "81.37.166.176",
  "url": "https://httpbin.org/post"
}

===================================================
===================================================

A complete example created with galileo-sample is tracked in galileo-sample/snapshot.txt.

Add it to your project

By now we are using Jitpack to deploy Galileo artifacts. Add these lines to your build.gradle file:

repositories {
    maven { url 'https://jitpack.io' }
  }
debugImplementation "com.github.josedlpozo.Galileo:galileo-android:0.0.4"
releaseImplementation "com.github.josedlpozo.Galileo:galileo-no-op:0.0.4"

Libraries used in this project

License

Copyright (C) 2018 josedlpozo

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.

galileo's People

Contributors

josedlpozo avatar vicfran avatar fr4nk1 avatar

Stargazers

David Navarro avatar Marcos Calvo García avatar Miguel Torres avatar Matej Kondrot avatar Toni avatar Jesus Alonso avatar Oscar Hellsten avatar Guillermo Cique avatar Jesús Alonso García avatar  avatar  avatar  avatar

Watchers

James Cloos avatar  avatar  avatar  avatar

Forkers

vicfran tubbz-alt

galileo's Issues

Add ColorPicker and GridView

Galileo needs some plugins to be a full debug library also for designers. ColorPicker and GridView will be useful for developing UI views pixel-perfect.

Add more than 5 plugins to Galileo

By now Galileo uses BottomNavigationView from Support library and with this view when we add more than 5 items to it, it throws an IllegalStateException.

We need to be capable of adding more than 5 items without a crash. We don't want to change our BottomNavigationView or use one view from a third-party library in Github.

We should be able to use a Galileo plugin for this feature. This plugin will have the plugins added to Galileo that sum more than 5. It will show a list of plugins and when click one of them, it will open a new Activity with the plugin clicked inside.

ActivitiesEvent plugin

Galileo will support a new plugin which is capable of register which activities have user opened and with which parameters send via Intent.

This plugin should show each events of activity lifecycle and list them to improve readibilty. Also this list should be tracked in Snapshot file.

Migrate RealmBrowser to Kotlin

Galileo wants to be a Kotlin-library for Android developers. We need to migrate RealmBrowser code to Kotlin 😄

Also, we should improve that code and add tests.

Crash in Preferator plugin

When there are no preferences files in the app Preferator plugin crashes. It is why this returns null:

File(context.applicationInfo.dataDir + "/shared_prefs")

Generate realm-browser snapshot

realm-browser plugin hasn't a snapshot yet. It's needed to genereate a snapshot for it in order to include it in the general snapshot of the library.

In order to write the snapshot, I first thought something like:

There are N Realm databases used by this app

Database database_name has n tables
table_name has n columns and n rows
| column_1_name || column_2_name | ...
colum_1_value colum_2_value
...

@josedlpozo what do you think

Crash when moving from landscape to portrait

04-04 16:45:29.679 28740 28740 E Report ::: java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.

04-04 16:45:29.679 28740 28740 E Report :::

04-04 16:45:29.679 28740 28740 E Report :::     android.view.ViewGroup.addViewInner(ViewGroup.java:5034)

04-04 16:45:29.679 28740 28740 E Report :::     android.view.ViewGroup.addView(ViewGroup.java:4865)

04-04 16:45:29.679 28740 28740 E Report :::     android.view.ViewGroup.addView(ViewGroup.java:4837)

04-04 16:45:29.679 28740 28740 E Report :::     com.android.internal.policy.PhoneWindow.addContentView(PhoneWindow.java:470)

04-04 16:45:29.679 28740 28740 E Report :::     com.josedlpozo.galileo.common.BaseFloatItem.onResume(BaseFloatItem.kt:20)

04-04 16:45:29.679 28740 28740 E Report :::     com.josedlpozo.galileo.common.GalileoApplicationLifeCycle.onActivityResumed(GalileoApplicationLifeCycle.kt:26)

04-04 16:45:29.679 28740 28740 E Report :::     android.app.Application.dispatchActivityResumed(Application.java:239)

04-04 16:45:29.679 28740 28740 E Report :::     android.app.Activity.onResume(Activity.java:1343)

04-04 16:45:29.679 28740 28740 E Report :::     androidx.fragment.app.FragmentActivity.onResume(FragmentActivity.java:441)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.