,

Optimize Windows Laptop for Flutter & Android Emulator

Posted by

Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now

1. Free Up C: Drive Space Using Disk Cleanup

Steps:

  1. Press Windows + R, type cleanmgr, and press Enter.
  2. Select C: drive.
  3. Click on “Clean up system files”.
  4. Check the following:
    • Downloaded Program Files
    • Temporary Internet Files
    • Windows Update Cleanup
    • Delivery Optimization Files
    • Temporary Files
    • Thumbnails
    • Recycle Bin (if safe to delete)
  5. Click OK, then Delete Files.

Tip: This frees up system cache without touching your Flutter, VS Code, or project files.


2. Move Android SDK & Emulator Files to D: Drive

Why:

Flutter and Android emulators use space on C: by default. Moving these to D: can free up 10โ€“20 GB and reduce disk I/O lag.

Steps:

  1. Close VS Code and Android Studio.
  2. Copy these folders to D:
    • From C:\Users\<YourName>\.android to D:\Android\.android
    • From C:\Users\<YourName>\AppData\Local\Android to D:\Android\sdk
  3. Set environment variables:
    • Press Windows + R, type sysdm.cpl, go to Advanced > Environment Variables
    • Add or update these user variables:
      • ANDROID_SDK_ROOT = D:\Android\sdk
      • ANDROID_AVD_HOME = D:\Android\.android\avd
  4. Restart your PC.

3. Exclude Heavy Folders from VS Code File Watcher

Why:

VS Code watches all files by default, causing CPU/RAM usage to spike with large folders like build, node_modules, and .gradle.

Steps:

  1. Open VS Code.
  2. Press Ctrl + Shift + P โ†’ “Preferences: Open Settings (JSON)”
  3. Paste this inside your JSON file:
"files.watcherExclude": {
  "**/.git/objects/**": true,
  "**/.git/subtree-cache/**": true,
  "**/.hg/store/**": true,
  "**/.dart_tool/**": true,
  "**/build/**": true,
  "**/.gradle/**": true,
  "**/android/.gradle/**": true,
  "**/android/app/build/**": true,
  "**/ios/Flutter/Flutter.framework/**": true,
  "**/ios/Pods/**": true,
  "**/.idea/**": true,
  "**/.vscode/**": true,
  "**/node_modules/**": true
}

4. Reduce Flutter Analyzer & Debug Load in VS Code

Add this to the same settings.json file to improve performance further:

"dart.previewFlutterUiGuides": false,
"dart.previewFlutterUiGuidesCustomTracking": false,
"dart.debugSdkLibraries": false,
"dart.debugExternalLibraries": false,
"dart.analysisExcludedFolders": [
  "build",
  ".dart_tool",
  ".idea",
  ".vscode",
  "android/app/build"
]

5. Disable Unwanted Startup Applications

Steps:

  1. Press Ctrl + Shift + Esc to open Task Manager.
  2. Go to the Startup tab.
  3. Disable items you don’t need on boot like Teams, Discord, OneDrive, etc.

6. Set Windows to High Performance Mode

Steps:

  1. Go to Settings > System > Power & Battery > Power Mode.
  2. Set to Best Performance.
  3. If youโ€™re on a laptop, ensure itโ€™s plugged in while emulating.

7. Keep Drivers and Firmware Updated

Use Intel Driver & Support Assistant to check and install the latest:

  • Intel Graphics Driver
  • Chipset
  • BIOS (via manufacturer)

Also ensure:

  • Windows 11 is fully updated (Settings > Windows Update)
  • Flutter SDK and Dart SDK are on the latest stable version

8. Optional: Use Physical Android Device

Running your app on a real Android device is faster and more stable than using an emulator.

Steps:

  1. Enable Developer Options on your phone.
  2. Turn on USB Debugging.
  3. Connect via USB.
  4. In VS Code, run: flutter devices flutter run

Summary of Improvements

TaskImpactRisk Level
Disk CleanupHighSafe
Move SDK/AVD to D:HighSafe
Watcher Exclude in VS CodeMediumSafe
Disable Startup AppsMediumSafe
Set Best Performance ModeMediumSafe
Use Physical DeviceHighSafe

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x