Application Support: Config Storage and Core Data

Author: IT Sectr Published: 2026-07-10 Reading time: 10 min

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 — a directory for data that the app creates for its own work, not intended for the user.
  • Files from Application Support automatically back up to iCloud and iTunes unless the exclusion flag is set.
  • The path to the directory is NSApplicationSupportDirectory or FileManager.urls(for: .applicationSupportDirectory).
  • Core Data by default places SQLite databases in Application Support.
  • The user has no direct access to Application Support through Files or iTunes.

What Is Application Support in iOS?

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.

How to Get the Path to Application Support

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.

swift
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.

objective-c
@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.

What Data to Store in Application Support

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.

Core Data and Realm Databases

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.

Configuration Files

JSON, plist, XML files with app settings, Feature Flags, cached user metadata (but not authentication tokens — use Keychain for those).

Data TypeApplication SupportAlternative
SQLite Core DataYes (default)
Configurations .plist / .jsonYesUserDefaults (for simple ones)
Downloaded reference materialsYesDocuments (if for user)
App logsConditionallyCaches (for logs)
Auth tokensNoKeychain

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 and 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).

swift
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.

Application Support vs Documents Directory

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.

ParameterApplication SupportDocuments Directory
User accessNo (hidden)Via iTunes File Sharing
Data typeApp service dataUser documents
iCloud backupYes (default)Yes (default)
Deletion riskLow (no access)Medium (user accessible)
ExampleSQLite Core DataExported 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.

Best Practices for Working with Application Support

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.

Always Create the Directory on First Launch

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.

Use a Subdirectory with Bundle Identifier

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.

swift
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

Do I need to create the Application Support Directory manually?

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.

Can the user accidentally delete data from Application Support?

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.

Is Application Support suitable for storing downloaded videos?

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.

How to migrate data from Application Support when updating the app?

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.

Does the size of Application Support affect app launch speed?

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

  • Application Support — a directory for app service data not intended for direct user access.
  • The path to the directory is FileManager.urls(for: .applicationSupportDirectory) or NSSearchPathForDirectoriesInDomains with NSApplicationSupportDirectory.
  • The directory must be created manually on the first app launch.
  • Core Data by default places SQLite databases in Application Support.
  • The user has no access to Application Support through Files or iTunes.
  • Files from Application Support are backed up to iCloud unless isExcludedFromBackup is set.
  • Create a subdirectory with the Bundle Identifier for data isolation and easier migration.

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.

Discuss the project

Read also