Giter VIP home page Giter VIP logo

shellcommand's Introduction

Shell Command

A wonderfully easy to use tool for adding command-line interactivity to your app.

Most physical android devices use 10.0.2.2 as localhost.

App Usage

Arguments are broken up into an array after taking into account single and double quotes. Integers and doubles are appropriately cast into their respective types. It's up to you to validate/check this array for arguments your app cares about.

Use the command "exit" to leave the interactive shell. The socket will remain up and available for the next connection.

Limited formatting is supported in ShellCommandFormatters, sample calls are shown in MyActivity.

An executor service runs every 10 minutes checking whether the socket is still up, it will restart it if it is not.

Command-Line Usage

Use netcat (available on the Android emulator) or telnet to connect to the server socket. For example, to connect on your emulator you would call

nc 127.0.0.1 8000 

The sample activity should be ready to go, just load it into your emulator and enter your emulator's shell via ./adb shell. If you have more than device use the -s flag:

./adb -s [deviceName] shell. 

You can find your emulator's device name by using

./adb devices.

If ShellCommand stops and you need to restart it remotely, you can broadcast an Intent with an optional port as an extra. Example:

am broadcast -a com.aleross.shellcommand.START -e PORT 8002    

Requirements

Note that Activity's implementing ShellCommand must include the uses INTERNET statement in their AndroidManifest.xml.

<uses-permission android:name="android.permission.INTERNET"/>

shellcommand's People

Stargazers

Roman avatar 我只是习惯了沉默 avatar Rob Patershuk avatar  avatar  avatar

Forkers

sypha0x yukunsun

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.