Skip to content

~/.dartServer: the Dart and Flutter analysis cache that editors fill and nothing empties

Every Dart and Flutter project you open in an editor adds analysis results to a hidden cache. How to measure it, and why it is safe to clear.

4 min read

The Dart analysis server is what gives your editor errors, completion and navigation in Dart and Flutter code. To start quickly, it stores analysis results in ~/.dartServer. Every project, every package version and every SDK version it has analysed adds to it, and nothing removes old entries.

Measure it

du -sh ~/.dartServer
du -sh ~/.dartServer/* 2>/dev/null | sort -h

Most of it is usually in a folder named .analysis-driver, which holds the cached analysis itself.

Is it safe to clear?

Yes. It is a cache. Quit your editor first (VS Code, Android Studio, IntelliJ or any other with the Dart plugin), then move the folder to the Trash. The next time you open a project, analysis takes longer while the cache rebuilds, and then it is back to normal.

rm -rf ~/.dartServer/.analysis-driver   # with editors closed

The other Flutter folders

FolderWhat it isCovered in
~/.pub-cacheDownloaded packagesFlutter taking up space
The Flutter SDKIncluding cached engine artifactsFlutter taking up space
build in each projectBuild outputFrontend build caches
iOS and Android buildsXcode and Gradle outputmobile developers' guide

Common questions

What is the .dartServer folder on a Mac?

It is the Dart analysis server's cache, used by editors for Dart and Flutter projects. It stores analysis results so projects open quickly.

Is it safe to delete .dartServer?

Yes, with your editors closed. It is a cache and is rebuilt the next time you open a project, which is slower once.

Why is .dartServer so large?

It keeps analysis results for every project, package version and SDK version it has seen, and does not remove old entries.

Read next