Monday, November 6, 2017

Android Development Shell Tools: Handy Shortcuts for ROM Developers

As any Android ROM developer would know, most of the time is spent in the shell. Be it to build the ROM, merge and keep track of changes, or to debug issues, the shell is the ROM developer’s home. With that in mind, it only makes sense to customize it to be as comfortable as possible for frequent tasks.

XDA Recognized Developer AdrianDC set out with this goal in mind two years ago, customizing his shell little by little to make his tasks easier. As the project grew, it made more sense to open it up to anyone who might be interested. It is now a publicly available set of tools that can be easily installed and configured by any developer, and has become a massive project containing more than 650 functions to ease general Android development, as well as ADB, Git and Gerrit usage.


Available Tools & Documentation

There are too many features for us to list, but here’s a quick sneak peek:

  • Advanced Gerrit SSH Interface: an easy to use SSH interface for Gerrit, which makes code review a breeze from your terminal.

Advanced Gerrit SSH Interface

  • Repo diff toolrepochanges is a handy function to detect and show differences between all local repos and their remotes.

Repo diff tool

  • Advanced ADB push helperadbp <file_to_push> will make pushing files easier by automatically figuring out where a file or directory should be pushed to. For example, adbp system/lib/hw/lights.msm8960.so will push the file to its appropriate location directly, without you having to type its directory manually. Highly useful for development when a few files need to be quickly updated to test something out.

Advanced ADB push helper

  • Git log and search helpers: several shortcuts are provided to make viewing and searching git commits (gitlogitlodgitloo) and history (gitlos) a breeze. Many other Git functions and helpers are also provided.

Git log and search helpers

  • A lot more! There really are a lot of handy shortcuts and functions in the project, too many for us to list. Which you find useful is also likely dependent on your usage, but you’ll find many helpers for Git, ADB and general Android development.

You’re encouraged to look at the project’s documentation page, which is automatically generated and kept up to date for available functionality. Search your way for anything you might be interested in.


Shell Tools Installation

Installing Android Development Shell Tools is as easy as cloning the Git repo and sourcing the main shell script:

$ git clone http://ift.tt/2y5nRE8 -b master
$ source android_development_shell_tools/android_development_shell_tools.rc

To automatically load the scripts whenever you open the shell, you can edit your shell’s startup file (usually ~/.bashrc or ~/.zshrc, depending on your shell):

To permanently load the scripts in your Shell terminals, open the ~/.bashrc file, adapt and add the following lines:

export ANDROID_DEV_DRIVE=/media/../AndroidDev;
source “/…/android_development_shell_tools.rc”;

The ANDROID_DEV_DRIVE variable is a reference folder I use for all Android projects, repositories, kernels and ROMs.
You do not need it, but a few functions rely on it to ease things.

The local copy can be updated at any time by simply running the provided shtoolssync function from your shell.

Note that some scripts can also be imported on their own as they do not depend on anything else. You’ll find these scripts in the project’s documentation, starting with source <(curl -Ls....


Make sure to visit the Android Development Shell Tools forum thread for more info on installing and using the project, as well as usage previews and examples.

Android Development Shell Tools XDA Forum Thread

Share with short URL:

GET 25$ WITH MASTERCARD

Popular Posts