adb shell cmd package compile -p PRIORITY_INTERACTIVE_FAST --force-merge-profile --full -a -r cmdline -m speed
adb shell cmd package compile -p PRIORITY_INTERACTIVE_FAST --force-merge-profile --full -a -r cmdline -m speed-profile -f
adb shell am broadcast -a android.intent.action.ACTION_OPTIMIZE_DEVICE
adb shell am broadcast -a com.android.systemui.action.CLEAR_MEMORY
adb shell cmd activity kill-all
adb shell pm bg-dexopt-job
adb shell cmd stats clear-puller-cache
adb shell cmd wifi set-verbose-logging disabled
adb shell cmd voiceinteraction set-debug-hotword-logging false
adb shell cmd looper_stats disable
adb shell cmd display ab-logging-disable
adb shell cmd display dwb-logging-disable
adb shell cmd activity idle-maintenance
adb shell sm idle-maint run
adb shell cmd netpolicy set restrict-background true
adb shell cmd content_capture destroy sessions
mkdir -p ~/.ssh
chmod 700 ~/.ssh
# Generate SSH key if not exists
if [ ! -f ~/.ssh/id_rsa ]; then
ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa -N ""
echo "SSH key generated at ~/.ssh/id_rsa"
fi
# ADB shortcuts
alias adbs='adb shell'
alias adbd='adb devices'
alias adbr='adb reboot'
alias adbw='adb tcpip 5555'
# Function to quickly connect to wireless ADB
adb-connect() {
if [ -z "$1" ]; then
echo "Usage: adb-connect <device-ip>"
return 1
fi
adb connect $1:5555
}
# Function to start SSH server
ssh-start() {
sshd
echo "SSH server started on port 8022"
echo "Connect using: ssh -p 8022 $(whoami)@<device-ip>"
}
# Function to stop SSH server
ssh-stop() {
pkill sshd
echo "SSH server stopped"
}