Application Support is a directory in the iOS app sandbox designed for storing auxiliary data needed for the app to function, but not created directly by the user. According to Apple File System Basics (2024), this directory is optimal for configuration files, Core Data SQLite databases, cached documents, and other data that the app generates on its own. Unlike the Documents Directory, Application Support does not appear in iTunes File Sharing and the user has no direct access to it, which protects service data from accidental deletion.
Key Takeaways
Application Support is a directory in the iOS app sandbox designed for storing data that the app creates and uses for its work, but which is not user documents. This is the primary location for configurations, databases, cached metadata, and other auxiliary files.
iOS designates Application Support as an intermediate layer between Documents (user data) and Caches (temporary data). Files in Application Support can be relatively permanent, but the user should not have direct access to them — this distinguishes it from the Documents Directory.
According to Apple Developer Documentation (2024), Application Support is the recommended location for storing Core Data SQLite databases, Realm files, configurations in JSON/plist format, downloaded reference materials, and other data that the app uses but the user did not explicitly create.
Important: by default, Application Support is included in iCloud and iTunes backup. If the app stores large amounts of data in this directory that can be recreated (e.g., downloaded guides), you must set the isExcludedFromBackup flag for the relevant files.
In Swift, the path to the Application Support Directory is obtained via FileManager.urls(for: .applicationSupportDirectory). Apple recommends creating a subdirectory with the app name inside Application Support for data isolation.
import Foundation
let fileManager = FileManager.default
guard let appSupportURL = fileManager.urls(
for: .applicationSupportDirectory,
in: .userDomainMask
).first else { return }
// Create app subdirectory
let bundleID = Bundle.main.bundleIdentifier ?? "com.example.app"
let appDir = appSupportURL.appendingPathComponent(bundleID)
try fileManager.createDirectory(
at: appDir,
withIntermediateDirectories: true
)
Objective-C uses NSSearchPathForDirectoriesInDomains with NSApplicationSupportDirectory. As with Swift, it is recommended to create a child directory with the app name.
@import Foundation;
NSArray *paths = NSSearchPathForDirectoriesInDomains(
NSApplicationSupportDirectory,
NSUserDomainMask,
YES
);
NSString *appSupportPath = paths.firstObject;
NSString *appDir = [appSupportPath stringByAppendingPathComponent:@"com.example.app"];
On first launch, the Application Support directory may not exist — it must be created using createDirectory(at:withIntermediateDirectories:). This distinguishes it from the Documents Directory, which is created automatically by the system.
Application Support is suitable for a wide range of data that the app uses for its work. Choosing the right data for this directory improves file system organization and simplifies backup.
SQLite files of Core Data are created in Application Support by default. Realm also recommends placing databases in this directory. This isolates user documents from the app's internal databases.
JSON, plist, XML files with app settings, Feature Flags, cached user metadata (but not authentication tokens — use Keychain for those).
| Data Type | Application Support | Alternative |
|---|---|---|
| SQLite Core Data | Yes (default) | — |
| Configurations .plist / .json | Yes | UserDefaults (for simple ones) |
| Downloaded reference materials | Yes | Documents (if for user) |
| App logs | Conditionally | Caches (for logs) |
| Auth tokens | No | Keychain |
Selection criteria: if the data is created and used by the app, not the user, and should persist between launches — its place is in Application Support.
Core Data is one of the main consumers of Application Support. When creating an NSPersistentContainer, Core Data automatically places SQLite files in Library/Application Support with a unique name based on the model name.
Understanding where Core Data stores files is critical for migrations, backup, and debugging. Main files: .sqlite (data), .sqlite-wal (Write-Ahead Log), .sqlite-shm (Shared Memory).
import CoreData
// Create Core Data container
let container = NSPersistentContainer(name: "MyAppModel")
// Custom store URL directory
guard let appSupportURL = FileManager.default
.urls(for: .applicationSupportDirectory,
in: .userDomainMask).first else { return }
let storeURL = appSupportURL
.appendingPathComponent("MyAppModel.sqlite")
let description = NSPersistentStoreDescription(url: storeURL)
container.persistentStoreDescriptions = [description]
When using CloudKit Core Data sync, the SQLite file remains in Application Support, and CloudKit acts as a transport layer. In this case, it is important not to exclude files from backup — otherwise synchronization between devices may break.
The difference between Application Support and Documents is one of the most important for properly organizing the iOS app file structure. Choosing incorrectly can lead to the user accidentally deleting important app data or, conversely, being unable to find their files.
| Parameter | Application Support | Documents Directory |
|---|---|---|
| User access | No (hidden) | Via iTunes File Sharing |
| Data type | App service data | User documents |
| iCloud backup | Yes (default) | Yes (default) |
| Deletion risk | Low (no access) | Medium (user accessible) |
| Example | SQLite Core Data | Exported PDF |
Simple rule: if the user should see the file and be able to delete it — use Documents. If the file is needed by the app to work but the user doesn't need to know about it — use Application Support. If the data can be recreated — use Caches.
Working with Application Support requires consideration of several features that distinguish it from other sandbox directories. Following these practices helps avoid data loss, migration issues, and unexpected app behavior.
Unlike Documents, Application Support may not exist on first launch. Use createDirectory(at:withIntermediateDirectories:) with the withIntermediateDirectories: true parameter to ensure the entire chain of subdirectories is created.
Create a subdirectory with the Bundle Identifier inside Application Support. This isolates your app's data from other apps (although the sandbox already provides isolation) and simplifies migration when changing providers.
import Foundation
enum AppSupport {
static func ensureDirectory() throws -> URL {
let fm = FileManager.default
let baseURL = try fm.url(
for: .applicationSupportDirectory,
in: .userDomainMask,
appropriateFor: nil,
create: true
)
let appDir = baseURL
.appendingPathComponent(Bundle.main.bundleIdentifier ?? "default")
try fm.createDirectory(at: appDir, withIntermediateDirectories: true)
return appDir
}
}
Following these practices ensures that the app's service data is properly organized, protected from accidental user deletion, and correctly restored from backups.
Frequently Asked Questions
Yes, Application Support is not automatically created when installing the app. Unlike Documents and Caches, which the system creates on first launch, Application Support must be created by the developer using FileManager.createDirectory(at:withIntermediateDirectories:). This is usually done in the application(_:didFinishLaunchingWithOptions:) method.
No, through the standard iOS interface (Files, iTunes) the user has no access to Application Support. However, when the app itself is deleted, the entire sandbox, including Application Support, is completely removed. The iCloud backup remains until restoration or manual deletion.
For downloaded videos intended for the user, it is better to use the Documents Directory so that the user can manage these files through Files. If the video is part of the app's internal cache (e.g., offline training content), Application Support can be used with the isExcludedFromBackup flag for large files.
Add versioning of subdirectories inside Application Support. When updating, check the current data version and create a new subdirectory if necessary, keeping the old one for rollback. Delete the old directory only after confirming that all users have successfully migrated to the new data version.
Indirectly — yes. If Application Support contains tens of thousands of small files, FileManager.enumerator can slow down initialization. It is recommended to limit the number of files in Application Support (no more than 1000) and use databases (Core Data, Realm) instead of many individual files for structured data.
Summary
We will develop a mobile application turnkey
IT Sectr creates iOS and Android applications for startups and businesses since 2017. We will advise you and propose the best solution.
Read also