Accessing the Caches Directory

Accessing the caches directory via an Xcode Project.

let cachesDir = FileManager.default.urls(for: .cachesDirectory, in: .userDomainMask).first!


// file:///Users/your-mac-username-here/Library/Caches/

With the path from the printed path above you will now be able to search using the Finder app or (command, space bar) on your mac for the particular cache folder you are interested in.

For example, if you’re interested in accessing the “XCTest” cache folder, the name would be

A possible full path for depending on your mac’s configuration and using Finder or (command, space bar) could be: file:///Users/your-mac-username-here/Library/Caches/

Being able to isolate the caching system during TDD is a flow I’ve acquired from the iOS Lead Essential Developer program.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s