I'm looking up commands to help clean out my internal 64GB sd card ('cuz I
gave my wife my 128GB sdcard and now I'm out of space) so these may help.
:: See all mount points and their usage
adb shell df -h
:: Find the largest directories under /data (requires root or shell access)
adb shell "du -sh /data/data/* 2>/dev/null | sort -rh | head -20"
:: If you have root, check app-specific data sizes
adb shell "du -sk /data/data/* 2>/dev/null | sort -rn | head -20"
:: Clear cache for a specific app (e.g., a browser or social media app)
adb shell pm clear com.example.app
:: Or clear cache for ALL apps (system will handle it)
adb shell pm trim-caches 999999999
:: Uninstall unused apps directly
adb uninstall com.example.unused.app
:: Move apps to external storage (if supported)
adb shell pm set-install-location 2
:: Find the 20 largest app data directories (sort by KB, numeric)
adb shell "du -sk /data/data/* 2>/dev/null | sort -rn | head -20"
:: Same for all user profiles
adb shell "du -sk /data/user/* 2>/dev/null | sort -rn | head -20"
:: Find large files (>50MB) inside /data
adb shell "find /data -type f -size +50M 2>/dev/null"
:: Find large files (>100MB) inside /data
adb shell "find /data -type f -size +100M 2>/dev/null"
:: Clear the download directory
adb shell rm /storage/emulated/0/Download/*
:: Use adb install with --sdcard flag (if the APK supports install location)
adb install -s -r current.apk
Re: FAQ: PSA: Tutorial: Walk-Thru etc. Random examples of using adb with Android
- From
- Maria Sophia <mari…@comprehension.com>
- Reply-To
- pusv…@getTjewytR4so+mqe2.invalid
- Organization
- BWH Usenet Archive (https://usenet.blueworldhosting.com)
- Message-ID
- <11bg…@nnrp.usenet.blueworldhosting.com>
- Date
- Newsgroups
- comp.mobile.android