Coder Social home page Coder Social logo

fab-android-scripts's Introduction

devtools

Do you use the developer options on your android device? Like "show overdraw" or "show layout bounds"? Wouldn't it be handy to switch those tools on and off via command line? via devtools you can switch:

  • date (manipulating the date and time)
  • gfx (profile gpu rendering)
  • layout (show layout bounds)
  • overdraw
  • updates (show screen updates) on and off via command line. Works on emulators and devices. And, yes: it will control multiple devices at once.

Usage

devtools [-d | -e | -s <serialNumber>] command [command-options]

Options

-d                      Direct an adb command to the only attached USB device.
                        Returns an error if more than one USB device is attached.

-e                      Direct an adb command to the only running emulator instance.
                        Returns an error if more than one emulator instance is running.

-s <serialNumber>       Direct an adb command a specific emulator/device instance, referred to by its adb-assigned serial number.
                        Directing Commands to a Specific Emulator/Device Instance.

-v                      Print additional details about the results of your command.

Commands

date

Set the device date and time using +FORMAT or reset options

Usage

devtools [-d | -e | -s <serialNumber>] date options

Options

date reset to set the device date and time to now

date +[0-99]d will add the specified number of days to the device date

date -[0-99]d will subtract the specified number of days from the device date

date +[0-99]h will add the specified number of hours to the device time

date -[0-99]h will subtract the specified number of hours from the device time

date +[0-99]m will add the specified number of minutes to the device time

date -[0-99]m will subtract the specified number of minutes from the device time

date +[0-99]s will add the specified number of seconds to the device time

date -[0-99]s will subtract the specified number of seconds from the device time

Examples

Example with reset command

devtools [-d | -e | -s <serialNumber>] date reset

Example with date command

devtools [-d | -e | -s <serialNumber>] date +1d -7h +5m +60s

The order of date options doesn't affect the result

Check the video:

IMAGE ALT TEXT HERE

adbwifi

Do you use adb-wifi connections? tired of figuring out the ip of your phone and typing it in?

This script tries to solve that.

Usage

Connect your phone via USB (in best case with WiFi switched on) and run the script. Wait until it tells you to disconnect and press enter.

Sample output

$> src/adbwifi.groovy
WLAN IP 192.168.178.44
mobile ip on WLAN: 192.168.178.44
now disconnect your phone and press enter

List of devices attached
192.168.178.44:5555	unauthorized

$> adb shell
shell@hammerhead:/ $

adbscreenrecord

Will execute screenrecord on your API Level 19+ device and will pull the file automatically after you finish the screenrecording.

adbscreenrecord <filename.mp4, optional>

Install

Just checkout or download the scrips to your system. Make sure you have groovy installed, and adb-executeable in your PATH

On mac with brew just run:

brew tap thefabulous/fab-android-scripts [email protected]:thefabulous/fab-android-scripts.git
brew update
brew install fab-android-scripts

You can use devtools with adb-wrapper https://github.com/zielmicha/adb-wrapper

curl https://raw.githubusercontent.com/zielmicha/adb-wrapper/master/adb_wrapper.sh > /usr/local/bin/adb-wrapper.sh
alias adb=/usr/local/bin/adb-wrapper.sh

Troubleshooting

If you have issues installing fab-android-scripts via brew as described above try:

brew install https://raw.githubusercontent.com/thefabulous/fab-android-scripts/master/fab-android-scripts.rb

fab-android-scripts's People

Contributors

aminezghidi avatar dhelleberg avatar aminelaadhari avatar chrjsorg avatar

Watchers

James Cloos avatar dev.with avatar

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.