forked from AdrianDC/advanced_development_shell_tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
android_adb_shortcuts.rc
64 lines (58 loc) · 2.59 KB
/
android_adb_shortcuts.rc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
#
# Copyright 2015-2017 Adrian DC
#
# 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.
#
# === Standalone Source Helper ===
# source <(curl -Ls https://github.com/AdrianDC/android_development_shell_tools/raw/master/android_adb_shortcuts.rc)
# === ADB Regular Shortcuts ===
alias adbs='adb shell';
alias adbdf='adb shell df -H';
alias adbpo='adb shell reboot -p';
alias adbrb='adb reboot bootloader';
alias adbre='adb reboot';
function adbrh() { adb shell setprop ctl.restart zygote; }
alias adbrr='adb reboot recovery';
alias adbsl='adb shell ls -l';
alias adbslz='adb shell ls -lZ';
alias adbsc='adb shell cat';
alias adbsg='adb shell getprop';
alias adbw='adb wait-for-device';
# === ADB File Writer ===
function adbsw()
{
# Usage: adbsw <"data"> <path> (Write a string to path through adb)
# Write a string to path through adb
adbro;
adb shell "echo ${1} > ${2}";
}
# === ADB Partitions Shortcuts ===
alias adbblkp='adb shell ls -l /dev/block/bootdevice/by-name/';
alias adbfotarandom='adb root; adb shell dd if=/dev/random of=/dev/block/platform/msm_sdcc.1/by-name/FOTAKernel';
alias adbfotazero='adb root; adb shell dd if=/dev/zero of=/dev/block/platform/msm_sdcc.1/by-name/FOTAKernel';
alias adbmountcache='adb shell mount -t ext4 /dev/block/platform/msm_sdcc.1/by-name/Cache /cache';
alias adbmountdata='adb shell mount -t ext4 /dev/block/platform/msm_sdcc.1/by-name/Userdata /data';
alias adbmountmicrosd='adb shell mkdir -p /storage/ext; adb shell mount -t ext4 /dev/block/mmcblk1p1 /storage/ext';
alias adbsgdisk='adb shell sgdisk --print /dev/block/mmcblk0';
alias adbumountcache='adb shell umount /cache';
alias adbumountdata='adb shell umount /data';
alias adbumountmicrosd='adb shell umount /storage/ext';
alias adbmount='adbmountcache; adbmountdata; adbmountmicrosd';
alias adbumount='adbumountcache; adbumountdata; adbumountmicrosd';
# === ADB Advanced Shortcuts ===
alias adbinfomem='adb shell dumpsys meminfo';
alias adbrcbin='adb shell restorecon -R /sbin';
alias adbemergencycalls='adb shell setprop ril.ecclist';
alias adbemergencylist='adb shell getprop ril.ecclist';
alias adbservices='adb shell service list';