Git Product home page Git Product logo

logkitty's Introduction

logkitty

Version

PRs Welcome MIT License Chat Code of Conduct

Display pretty Android and iOS logs without Android Studio or Console.app, with intuitive Command Line Interface.

Demo

Installation

yarn global add logkitty

Or if you prefer having it locally:

yarn add -D logkitty
yarn logkitty --help

Usage

logkitty <platform> <command> [options]

Command line help

You can inspect available platforms, command and options for a given platform by adding -h at the end, for example:

logkitty -h # prints available platforms and global options
logkitty android -h # prints commands and options for android
logkitty android tag -h # prints tag command syntax and options for android

Commands

  • platform: android:
    • tag <tags...> - Show logs with matching tags.
    • app <appId> - Show logs from application with given identifier.
    • match <regexes...> - Show logs matching given patterns (all regexes have flags g and m).
    • custom <patterns...> - Use custom patters supported by Logcat.
    • all - Show all logs.
  • platform: ios:
    • tag <tags...> - Show logs with matching tags (where tag is usually a name of the app).
    • match <regexes...> - Show logs matching given patterns (all regexes have flags g and m).
    • all - Show all logs.

Options

  • common:

    • -h, --help - Display help
    • -v, --version - Display version
  • platform android:

    tag, app, match and all commands support additional priority filtering options (sorted by priority):

    • -U, -u - Unknown priority (lowest)
    • -v, -v - Verbose priority
    • -D, -d - Debug priority (default)
    • -I, -i - Info priority
    • -W, -w - Warn priority
    • -E, -e - Error priority
    • -F, -f - Fatal priority
    • -S, -s - Silent priority (highest)

    For example logkitty android all -W will display all logs with priority warn, error and fatal.

  • platform ios:

    tag, match and all commands support additional level filtering options:

    • -D, -d - Debug level
    • -I, -i - Info level
    • -E, -e - Error level

Examples

Show all logs with tag ReactNativeJS (and default priority - debug and above):

logkitty android tag ReactNativeJS
logkitty ios tag ReactNativeJS

Show all logs with priority info and above from application with identifier com.example.myApplication:

logkitty android app com.example.myApplication -i

Show all logs matching /CodePush/gm regex:

logkitty android match CodePush
logkitty ios match CodePush

Show all logs with priority error or fatal for Android and _error level for iOS:

logkitty android all -e
logkitty ios all -e

Show logs using custom patterns - silence all logs and display only the onces with tag my-tag and priority debug and above:

logkitty android custom *:S my-tag:D

Node API

If your building a tool and want to use Node API, head over to Node API documentation.

logkitty's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

logkitty's Issues

Roadmap

Roadmap

  • support for multiple Android devices
  • support for iOS devices

ANDROID_HOME is deprecated by Google and unclear error message

I had some trouble getting messages saying that "adb" is not a recognized internal command.

So i had to open the source code to realize that logkitty uses the "ANDROID_HOME" variable.

But according to Android site, ANDROID_HOME is now deprecated in favor of ANDROID_SDK_ROOT.

https://developer.android.com/studio/command-line/variables

Also would be good to improve the error message saying where is logkitty looking for, since google results says to set the Path variable.

huntr - RCE via insecure command formatting (Command Injection)

This issue has been generated on-behalf of Mik317 (https://huntr.dev/app/users/Mik317)

Details

I would like to report a RCE issue in the logkitty module.
It allows to execute arbitrary commands remotely inside the victim's PC

Vulnerability Description

The issue occurs because a user input is formatted inside a command that will be executed without any check. The issue arises here: https://github.com/zamotany/logkitty/blob/master/src/android/adb.ts#L55

Steps To Reproduce

  1. Check there aren't files called HACKED.
  2. Execute the following commands in another terminal:
npm i logkitty # Install affected module
logkitty android app 'test; touch HACKED' #  Note the *touch command* is inside the *'* (single quote), so it's an argument, while it will be executed anyway
  1. Recheck the files: now HACKED has been created.

Bug Bounty

We have opened up a bounty for this issue on our bug bounty platform. Want to solve this vulnerability and get rewarded 💰? Go to https://huntr.dev/

Can't select device

I can't select the device that I want to log

In the example it was a physical device and AVD emulator

✖︎ Ups, something went wrong

CODE ▶︎ ERR_ANDROID_CANNOT_GET_APP_PID
MESSAGE ▶︎ Command failed: adb shell pidof -s co.solarismobile.animal.puzzle
error: more than one device/emulator

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.