Ultimate Guide: ADB Commands for Android Phone Optimization and Maintenance

Ultimate Guide: ADB Commands for Android Phone Optimization and Maintenance

Transform your Android device into a speed demon with these powerful ADB commands and expert optimization techniques.

Table of Contents

  1. Introduction
  2. Prerequisites and Setup
  3. Performance Optimization Commands
  4. Cache Management and Cleanup
  5. Background Process Management
  6. Bloatware Removal and App Management
  7. Battery Optimization Commands
  8. Device Information and Monitoring
  9. Additional Android Optimization Techniques
  10. Regular Maintenance Schedule
  11. Audio Enhancement
  12. Important Safety Notes
  13. Conclusion

Introduction

Is your Android phone running slower than it used to? Are you experiencing lag, poor battery life, or storage issues? You’re not alone. Over time, every Android device accumulates digital clutter, unnecessary background processes, and system inefficiencies that can significantly impact performance.

The good news? You don’t need to root your device or spend money on expensive optimization apps. With Android Debug Bridge (ADB) commands and some built-in Android features, you can transform your sluggish smartphone into a speed demon.

This comprehensive guide will walk you through proven ADB commands and advanced optimization techniques that can dramatically improve your Android device’s performance, extend battery life, and free up valuable storage space – all without requiring root access.

Prerequisites and Setup

Before diving into optimization, ensure you have the following setup:

Essential Requirements

  • ADB installed on your computer – Download from Android SDK Platform Tools
  • USB Debugging enabled on your Android device
  • Proper USB drivers installed for your device
  • USB cable for connecting your device to computer
  • Basic understanding of command-line interface

Enabling USB Debugging

  1. Go to SettingsAbout Phone
  2. Tap Build Number 7 times to enable Developer Options
  3. Return to Settings → Developer Options
  4. Enable USB Debugging
  5. Connect your device via USB and authorize the computer when prompted

Testing ADB Connection

Open command prompt/terminal and run:

adb devices

You should see your device listed. If not, check drivers and USB debugging settings.

Performance Optimization Commands

Animation and UI Speed Enhancement

Animations significantly impact perceived device speed and battery consumption. These commands can make your device feel 2-3x faster instantly:

Disable Window Animations:

adb shell settings put global window_animation_scale 0.0

Disable Transition Animations:

adb shell settings put global transition_animation_scale 0.0

Disable Animator Duration:

adb shell settings put global animator_duration_scale 0.0

Alternative: Speed Up Animations (instead of disabling):

adb shell settings put global window_animation_scale 0.5
adb shell settings put global transition_animation_scale 0.5
adb shell settings put global animator_duration_scale 0.5

App Launch Speed Optimization

These commands optimize the app startup process and reduce launch times:

adb shell settings put system rakuten_denwa 0
adb shell settings put system send_security_reports 0
adb shell settings put secure send_action_app_error 0
adb shell settings put global activity_starts_logging_enabled 0

For Samsung devices, disable Game Optimizing Service (GOS):

adb shell settings put secure gamesdk_version 0
adb shell settings put secure game_home_enable 0
adb shell settings put secure game_bixby_block 1
adb shell settings put secure game_auto_temperature_control 0
adb shell pm clear --user 0 com.samsung.android.game.gos

Display and Performance Settings

Adjust Refresh Rate (for supported devices):

adb shell settings put system peak_refresh_rate 120.0
adb shell settings put system min_refresh_rate 120.0

Note: Adjust values based on your device’s capabilities (60.0, 90.0, 120.0)

Disable Window Blur and Transparency:

adb shell settings put global disable_window_blurs 1
adb shell settings put global accessibility_reduce_transparency 1

Enable Fixed Performance Mode:

adb shell cmd power set-fixed-performance-mode-enabled true

This prevents thermal throttling and maintains consistent performance

Touchscreen Responsiveness

Improve touch response times and reduce input lag:

adb shell settings put secure long_press_timeout 250
adb shell settings put secure multi_press_timeout 250
adb shell settings put secure tap_duration_threshold 0.0
adb shell settings put secure touch_blocking_period 0.0

System Performance Optimization

Force GPU Rendering for smoother graphics:

adb shell setprop debug.force-opengl 1

Enable Multicore Packet Scheduler:

adb shell settings put system multicore_packet_scheduler 1

Enhanced CPU Responsiveness:

adb shell settings put global sem_enhanced_cpu_responsiveness 1

Disable RAM Plus (for Samsung devices):

adb shell settings put global zram_enabled 0
adb shell settings put global ram_expand_size_list 0

Cache Management and Cleanup

Clear All App Caches

The most effective single command to clear all app caches:

adb shell pm trim-caches 128G

This command works by specifying a target size larger than your device storage, forcing Android to clear all available caches.

Clear Specific App Cache and Data

Clear both cache and data for a specific app:

adb shell pm clear <package-name>

Example:

adb shell pm clear com.facebook.katana

Clear cache and data for ALL apps:

adb shell cmd package list packages|cut -d":" -f2|while read package ;do pm clear $package;done

Warning: This will reset all app data and settings

System Cache Management

Clear system cache partition (where available):
Access through recovery mode on devices with traditional partitions. Note that many newer devices use A/B partitions where system cache clearing is handled automatically.

Background Process Management

Stop Background Processes

List all running processes:

adb shell ps

Check memory usage by process:

adb shell top -s 6

Check CPU usage by process:

adb shell top -s 9

Kill specific process by PID:

adb shell kill <PID>

Prevent Apps from Running in Background

Stop specific app from running in background:

adb shell cmd appops set <package-name> RUN_IN_BACKGROUND ignore

Force stop an app:

adb shell am force-stop <package-name>

Example – Stop Facebook from running in background:

adb shell cmd appops set com.facebook.katana RUN_IN_BACKGROUND ignore

Bloatware Removal and App Management

List Installed Packages

List all packages:

adb shell pm list packages

List third-party packages only:

adb shell pm list packages -3

List system packages only:

adb shell pm list packages -s

Search for specific app:

adb shell pm list packages | grep <search-term>

Uninstall/Disable System Apps

Uninstall system app (user-level, can be restored):

adb shell pm uninstall --user 0 <package-name>

Disable system app:

adb shell pm disable-user --user 0 <package-name>

Re-enable disabled app:

adb shell pm enable <package-name>

Common bloatware packages to remove:

  • com.samsung.android.bixby.agent – Bixby Assistant
  • com.facebook.system – Facebook App Manager
  • com.netflix.mediaclient – Netflix (if pre-installed)
  • com.microsoft.office.excel – Pre-installed Office apps

Battery Optimization Commands

Enable Power Saving Features

Enable battery saver mode:

adb shell settings put global low_power 1

Disable battery saver mode:

adb shell settings put global low_power 0

Enable automatic power saving:

adb shell settings put global automatic_power_save_mode 1
adb shell settings put global dynamic_power_savings_enabled 1

Sleep and Power Management

Disable intelligent sleep mode:

adb shell settings put system intelligent_sleep_mode 0

Disable adaptive sleep:

adb shell settings put secure adaptive_sleep 0

Enable app restriction for better battery:

adb shell settings put global app_restriction_enabled true

Device Information and Monitoring

Memory Information

Check memory usage for specific app:

adb shell dumpsys meminfo <package-name>

Check overall device memory:

adb shell dumpsys meminfo

Get available memory:

adb shell cat /proc/meminfo

Battery Information

Check battery status:

adb shell dumpsys battery

Check battery statistics:

adb shell dumpsys batterystats

Set battery level for testing:

adb shell dumpsys battery set level <percentage>
adb shell dumpsys battery reset

Additional Android Optimization Techniques

Developer Options Tweaks

Beyond ADB commands, several built-in Android settings can significantly boost performance:

1. Background Process Limit

  • Go to Developer OptionsBackground Process Limit
  • Set to “At most 2 processes” or “At most 1 process”
  • This prevents excessive background app activity

2. Animation Scales (Alternative to ADB method)

  • Window animation scale: Set to 0.5x or Off
  • Transition animation scale: Set to 0.5x or Off
  • Animator duration scale: Set to 0.5x or Off

3. Hardware Acceleration

  • Enable “Force GPU rendering”
  • Enable “Disable HW overlays”
  • These force GPU acceleration for smoother performance

System Settings Optimization

1. Reduce Visual Effects

  • Disable Live Wallpapers
  • Use Static Wallpapers instead
  • Disable Transition Effects in launcher settings

2. Notification Management

  • Disable notifications for unnecessary apps
  • Use Do Not Disturb modes effectively
  • Limit apps with notification access

3. Location Services

  • Set location accuracy to “Device only” when high precision isn’t needed
  • Disable “Google Location History”
  • Turn off “Wi-Fi scanning” and “Bluetooth scanning”

Storage Management

1. Smart Storage Cleanup

  • Use built-in “Smart Switch” or “Device Care” features
  • Enable “Auto-delete backed up photos”
  • Regularly clear Downloads folder

2. App Data Management

  • Use “Lite” versions of apps when available
  • Move large apps to SD card (if supported)
  • Regularly clear app caches through Settings

Regular Maintenance Schedule

Daily Tasks (Automated where possible)

  • Restart device once every 2-3 days
  • Check and close unnecessary background apps
  • Monitor battery usage for abnormal drain

Weekly Tasks

  • Clear app caches using ADB or built-in tools
  • Review and remove unused apps
  • Check storage space and clean up files
  • Update apps to latest versions

Monthly Tasks

  • Run full device optimization using built-in tools
  • Review and adjust Developer Options settings
  • Check for system updates
  • Backup important data before major changes

Quarterly Tasks

  • Factory reset if device performance significantly degrades
  • Review and update ADB optimization commands
  • Clean physical device (charging port, speakers, etc.)

Audio Enhancement

Enhance audio quality and processing:

adb shell settings put system k2hd_effect 1
adb shell settings put system tube_amp_effect 1

Dolby Atmos (for supported devices):

adb shell settings put system dolby_enable 1

Important Safety Notes

Before You Begin

  1. Create a Full Backup: Always backup your device before making system-level changes
  2. Research Package Names: Never uninstall system apps without knowing their function
  3. Start Small: Test one change at a time to identify any issues
  4. Keep Recovery Options Ready: Know how to factory reset your device if needed

Recovery Methods

If something goes wrong:

  • Factory Reset: Restores all system apps and settings
  • Safe Mode: Boot device in safe mode to troubleshoot
  • ADB Restore: Re-enable disabled apps using adb shell pm enable <package-name>

Best Practices

  • Test commands individually before running batch scripts
  • Document changes you make for future reference
  • Monitor device behavior after implementing changes
  • Reboot device after making significant changes

Warning Signs to Watch For

  • Unexpected crashes or system instability
  • Missing essential functions (calls, SMS, camera)
  • Excessive battery drain after optimization
  • Boot loops or startup issues

Conclusion

With these comprehensive ADB commands and optimization techniques, you now have the power to transform your Android device’s performance without spending a penny on new hardware or premium apps. The key to successful optimization lies in systematic implementation and regular maintenance.

Key Takeaways

  • Start with animation disabling for immediate perceived speed improvements
  • Use cache clearing commands regularly to maintain optimal storage
  • Monitor background processes and disable unnecessary ones
  • Implement a regular maintenance schedule to prevent performance degradation
  • Always prioritize safety by backing up and testing changes incrementally

Expected Results

Following this guide should result in:

  • 30-50% improvement in app launch times
  • Significantly smoother user interface interactions
  • Extended battery life through optimized background processes
  • More available storage through systematic cache management
  • Overall enhanced user experience comparable to a newer device

Remember, optimization is an ongoing process. Regular maintenance using these techniques will keep your Android device running at peak performance for years to come. Whether you’re using a budget device or a flagship smartphone, these commands and techniques will help you unlock your device’s full potential.

Happy optimizing! Your Android device will thank you for the performance boost, and you’ll enjoy a smoother, faster mobile experience without the need for expensive upgrades.

1 Comment

  1. c0de.breaker

    You should also mentioned and add to the list

    Full AOT (Ahead-Of-Time) Compilation with flag -speed (all instructions from app compile to native binary code for CPU)

    adb shell cmd package compile -m speed -a -f

    This command make force all apps on Android to compile to native binary code for CPU (without JiT Bytecode Translator)

    It makes everything fast and response because everything talks to the CPU in his native language (zero and one)

    Without parameter -f you make only compile apps to native code who don’t have speed flag (for example after update from Google Play Store)

Leave a Reply

Your email address will not be published. Required fields are marked *