Created
March 24, 2020 05:00
-
-
Save Ricky-Wilson/a81e05627ee70f68f1416890057f3a70 to your computer and use it in GitHub Desktop.
Android ADB Helpers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
ip=$( adb shell ifconfig wlan0 | cut -f 3 -d ' ' ) | |
port=5555 | |
adb tcpip $port | |
adb connect $ip:$port |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
adb backup -apk -shared -all -f $1 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
adb shell input keyevent 220 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
adb shell input keyevent 221 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
adb shell am start \ | |
-a android.intent.action.CALL -d \ | |
tel:+$1 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
packages=`adb shell cmd package list packages | awk -F : '{print $2}' | sort` | |
for p in $packages; do | |
echo "Clearing data from: $p" | |
adb shell pm clear $p | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
adb shell dumpsys window windows | grep -E 'mCurrentFocus|mFocusedApp' | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Launch Developer Options. | |
adb shell am start -a android.settings.APPLICATION_DEVELOPMENT_SETTINGS | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
adb shell am start \ | |
-W -c android.intent.category.HOME \ | |
-a android.intent.action.MAIN |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# List the app that is in focus. | |
adb shell dumpsys window windows | grep -E 'mFocusedApp'| cut -d / -f 1 | cut -d " " -f 7 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
adb install $1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#packages=`adb shell cmd package list packages | awk -F : '{print $2}' | sort` | |
for file in $1/*.apk | |
do | |
echo "Installing: $file\n" | |
adb install $file | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
packages=`adb shell pm list packages` | |
for p in $packages | |
do | |
echo "Killing $p" | |
adb shell am force-stop $p | |
adb shell am stopservice $p | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
adb shell am force-stop `bash infocus.sh` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Get mac address | |
adb shell cat /sys/class/net/wlan0/address |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
adb shell dumpsys meminfo | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
adb shell input keyevent 27 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
adb shell dumpsys package packages |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
OUTPUT_DIR=$1 | |
# Create the output directory | |
# if it does not exists | |
if [[ ! -d "$OUTPUT_DIR" ]] | |
then | |
mkdir "$OUTPUT_DIR" | |
fi | |
# Reomove leading slash / | |
[[ "${OUTPUT_DIR}" == */ ]] && STR="${OUTPUT_DIR: : -1}" | |
packages=$(adb shell pm list packages | tr -d '\r' | sed 's/package://g') | |
for package in $packages | |
do | |
apk=$(adb shell pm path $package | tr -d '\r' | sed 's/package://g') | |
echo "Pulling $apk" | |
output_file=$OUTPUT_DIR"/$package".apk | |
if [[ ! -f "$output_file" ]] | |
then | |
adb pull -p $apk $output_file | |
else | |
echo "$output_file Already Exists" | |
fi | |
done | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
adb shell getprop ro.build.version.release |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
packages=`adb shell cmd package list packages | | |
awk -F : '{print $2}' | sort | grep -i "$1"` | |
for p in $packages; do | |
echo "Uminstalling: $p\n" | |
adb uninstall --user 0 $p | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rm -rf /system/app/CarHomeGoogle.apk | |
rm -rf /system/app/ChromeBookmarksSyncAdapter.apk | |
rm -rf /system/app/ConfigUpdater.apk | |
rm -rf /system/app/FaceLock.apk | |
rm -rf /system/app/GenieWidget.apk | |
rm -rf /system/app/Gmail.apk | |
rm -rf /system/app/GmsCore.apk | |
rm -rf /system/app/GoogleBackupTransport.apk | |
rm -rf /system/app/GoogleCalendar.apk | |
rm -rf /system/app/GoogleCalendarSyncAdapter.apk | |
rm -rf /system/app/GoogleContactsSyncAdapter.apk | |
rm -rf /system/app/GoogleFeedback.apk | |
rm -rf /system/app/GoogleLoginService.apk | |
rm -rf /system/app/GoogleNow.apk | |
rm -rf /system/app/GoogleNowVoiceSearch.apk | |
rm -rf /system/app/GooglePartnerSetup.apk | |
rm -rf /system/app/GoogleQuickSearchBox.apk | |
rm -rf /system/app/GoogleServicesFramework.apk | |
rm -rf /system/app/GoogleTTS.apk | |
rm -rf /system/app/LatinImeTutorial.apk | |
rm -rf /system/app/LatinImeDictionaryPack.apk | |
rm -rf /system/app/MarketUpdater.apk | |
rm -rf /system/app/MediaUploader.apk | |
rm -rf /system/app/NetworkLocation.apk | |
rm -rf /system/app/OneTimeInitializer.apk | |
rm -rf /system/app/Phonesky.apk | |
rm -rf /system/app/PlayStore.apk | |
rm -rf /system/app/SetupWizard.apk | |
rm -rf /system/app/Talk.apk | |
rm -rf /system/app/Talkback.apk | |
rm -rf /system/app/Vending.apk | |
rm -rf /system/app/VoiceSearch.apk | |
rm -rf /system/app/VoiceSearchStub.apk | |
rm -rf /system/etc/permissions/com.google.android.maps.xml | |
rm -rf /system/etc/permissions/com.google.android.media.effects.xml | |
rm -rf /system/etc/permissions/com.google.widevine.software.drm.xml | |
rm -rf /system/etc/permissions/features.xml | |
rm -rf /system/etc/preferred-apps/google.xml | |
rm -rf /system/etc/g.prop | |
rm -rf /system/addon.d/70-gapps.sh | |
rm -rf /system/framework/com.google.android.maps.jar | |
rm -rf /system/framework/com.google.android.media.effects.jar | |
rm -rf /system/framework/com.google.widevine.software.drm.jar | |
rm -rf /system/lib/libfilterpack_facedetect.so | |
rm -rf /system/lib/libfrsdk.so | |
rm -rf /system/lib/libgcomm_jni.so | |
rm -rf /system/lib/libgoogle_recognizer_jni.so | |
rm -rf /system/lib/libgoogle_recognizer_jni_l.so | |
rm -rf /system/lib/libfacelock_jni.so | |
rm -rf /system/lib/libfacelock_jni.so | |
rm -rf /system/lib/libgtalk_jni.so | |
rm -rf /system/lib/libgtalk_stabilize.so | |
rm -rf /system/lib/libjni_latinimegoogle.so | |
rm -rf /system/lib/libflint_engine_jni_api.so | |
rm -rf /system/lib/libpatts_engine_jni_api.so | |
rm -rf /system/lib/libspeexwrapper.so | |
rm -rf /system/lib/libvideochat_stabilize.so | |
rm -rf /system/lib/libvoicesearch.so | |
rm -rf /system/lib/libvorbisencoder.so | |
rm -rf /system/lib/libpicowrapper.so |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
adb shell wm size reset | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
######################################## | |
# Uninstall any package from Android. # | |
######################################## | |
adb shell cmd package uninstall --user 0 $1 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
adb shell wm size |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
adb shell wm density $1 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
adb shell wm size $1x$2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
adb shell am start -a \ | |
android.intent.action.SENDTO \ | |
-d sms:+$1 --es sms_body \ | |
"Test --ez" \ | |
exit_on_sent false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
packages=$(adb shell pm list packages -3 | tr -d '\r' | sed 's/package://g') | |
for package in $packages; do | |
echo "Uninstalling: $package" | |
adb uninstall $package | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment