Some useful scripts for Android.
Find below some details how to use the scripts.
Useful scripts for application developer (software).
Easy way to generate images to all resolutions.
Pre condition:
- You must have ImageMagick installed in your computer. More details about ImageMagick here.
- The script uses images from 3 folders:
- resources - contains all xxhdpi resources
- actionbar - contains all xxhdpi resources releated to action bar
- actionbar_land - contains all xxhdpi landscape resources related to action bar
HOW TO USE
Move the script to folder that contains 3 folders mentioned before and run:
~$ ./genimgs
And voilà, the script will generate images to all resolutions. So, you just need move all folder from out to your Android project.
Easy way to get WI-FI password from Android phone.
Attention: Only works when android phone is rooted.
HOW TO USE
~$ ./getwifi
Easy way to run monkey test. If you are interested to know more about monkey test, please see this link.
HOW TO USE
Commands:
~$ ./monkey [PACKAGE] [optional: NUMBER_OF_EVENTS (default: 720000)] [optional: ROUND (default: 1)] [optional: SEED]
Example :
~$ ./monkey com.itspen.app
~$ ./monkey com.itspen.app 5000000 3 345
Easy way to take Android phone screenshoot and grab in your computer.
HOW TO USE
~$ ./screenshot
Easy way to convert Unix time (seconds) to UTC time.
HOW TO USE
Commands:
~$ ./todate [seconds]
Example:
~$ ./todate 1476676336
Easy way to convert Unix time (milliseconds) to UTC time.
HOW TO USE
Commands:
~$ ./todate [milliseconds]
Example:
~$ ./todate 1476676336400
Easy way to convert decimal number to hexadecimal. I usually use to convert alpha to hex.
HOW TO USE
Commands:
~$ ./tohex [0-100]
Example :
~$ ./tohex 67
Easy way to convert all png files to jpg in a folder
HOW TO USE
Commands:
~$ ./tojpg [folder_path] [optinal: output_folder_path]
Example :
~$ ./tojpg resources
~$ ./tojpg resources resources_jpg
Easy way unlock your Android phone.
Attention: You phone must allow install unknown source.
HOW TO USE
~$ ./unlock
Easy way to extract phone information.
HOW TO USE
Commands:
~$ ./getprop
Easy way to check hardcoded strings.
HOW TO USE
~$ ./hardcoded
Easy way to perform infinite scroll (crtl+C to stop)
HOW TO USE
~$ ./iscroll
Useful scripts for framework developer (middleware).
Easy way to enable log on device with verbose priority. If you are interested to know more about monkey test, please see this link.
HOW TO USE
Commands:
~$ ./setlocalprop [TAG] [TAG] [TAG]..
Example :
~$ ./setlocalprop ZenModeHelper ZenModePanel ZenModeController VolumeUI ManagedServices
Easy way to enable log on systemui without reboot.
HOW TO USE
TAG - tag name, e.g. ZenModePanel, usually it is class name. priority - the priority of log, could be (default: V):
- v - Verbose (lowest priority)
- d - Debug
- i - Info
- w - Warning
- e - Error
- f - Fatal
- s - Silent (highest priority, on which nothing is ever printed) Commands:
~$ ./systemuilog [TAG] [priority]
Example 1:
~$ ./systemuilog ZenModePanel
Example 2:
~$ ./systemuilog ZenModePanel w
Translate sysui log codes into strings. Following the filters:
- sysui_view_visibility
- sysui_action
- sysui_count
- sysui_histogram
HOW TO USE
Return all filters:
~$ ./sysui [aplogcat-events.txt path]
~$ adb logcat -b events | ./sysui
Return a specific filter:
~$ ./sysui [aplogcat-events.txt path] | grep sysui_view_visibility Filtered by sysui_view_visibility
~$ ./sysui [aplogcat-events.txt path] | grep sysui_action Filtered by sysui_action
~$ ./sysui [aplogcat-events.txt path] | grep sysui_count Filtered by sysui_count
~$ ./sysui [aplogcat-events.txt path] | grep sysui_histogram Filtered by sysui_histogram
Download the scripts and add bash script folder to path. Please see below the steps:
- Open .bashrc file, for example:
zhenlei@zenbook:~$ nano .bashrc
- Add bash script folder to path:
export PATH=$PATH:/home/zhenlei/git/AndroidScripts
And voilà! All script in AndroidScripts folder will be recognized by command line.
ATTENTION
Bear in mind that genimgs script must be moved to specific folder that contains 3 folders mentioned (resources, actionbar, actionbar_land) before to run. The reason to do that is, the script was used for UI/UX team that does not know using script well, and by that just click in the script to run.
Copyright 2016 Zhenlei Ji
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.