Understanding the Structure of an iOS Application

Lucideus
4 min readJan 7, 2019

--

Introduction

This article gives a basic understanding of the structure of a typical iOS application inside the file system of an iPhone. We will try to dive deep into the “Bundle” as well as “Data” directory of an iOS application. No prerequisite knowledge is required to understand this article but walk-through of the previous articles in this series is recommended. So let’s get started.

iOS Application Architecture

The iOS components that support iOS applications together with the application layer make up the architecture of an iOS application.

Source: https://intellipaat.com/tutorial/ios-tutorial/ios-architecture/

As shown above, the Core OS and Core Services make up the base and very strongly support the iOS application. On top of that comes the Media and Cocoa Touch which are again very essential for supporting an iOS application. All of these reside on top of the Kernel and device drivers.

Source: https://www.dotnettricks.com/learn/xamarin/understanding-xamarin-ios-build-native-ios-app

Cocoa has a very important role to play for supporting an iOS application. It provides UIKit for the application to work which is essentially the USP of an iOS application.

Structure of an IPA File

There are three types of iOS applications:

  • Native applications uses Objective C/Swift for building the application
  • Hybrid applications use frameworks like Xamarin, Cordova etc. along with Objective C/Swift.
  • Web based applications are responsive versions of websites built for working on mobile device.

We would be currently focusing on native iOS applications. A native iOS application can use Objective C or Swift code along with any of their native libraries or frameworks available of use in iOS applications. We have learnt how to extract the IPA file of an iOS application from a jailbroken device. Let us analyse what an IPA file consists of.

Source: https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemOverview/FileSystemOverview.html

The Bundle Container

The Bundle directory or the IPA container consists of all the files that come along with the application when installed from the Apple’s App Store or any other source. So, the files in this directory will remain same throughout in a particular version of an application.

The structure of this directory for ‘Facebook’ application is depicted in the following screenshot.

Many important information can be obtained about the application from the files in these directory. All the possible components of the Bundle Directory of a native iOS application are explained below:

The Data Container

The “Data” directory or the Local Data Storage container consists of the files that the developer wishes to store for the application during the time which the application is installed on the device.

The files may be used for caching information for quick access or storing offline information as a backup for resuming the application from the point at intended by the developer. So, the files in this directory and also the information in the files will keep on changing while the application is in use as coded by the developers.

The structure of this directory for ‘Facebook’ application is depicted in the following screenshot.

Very critical information about the user or the application might be obtained from these files depending on what information is intended to be stored by the developer in this directory. Some of the possible components of the “Data” directory of an iOS application are explained below:

The iCloud Container

Source: https://developer.apple.com/library/archive/documentation/General/Conceptual/iCloudDesignGuide/Chapters/iCloudFundametals.html

This directory contains data that iCloud enabled iOS applications use. The files in this directory are meant to stored and updated by the sources where a user decides to update the file from.

It consists of usually two parts

  • Documents- The files in this directory are meant to be read and updated directly by the user. These files are backed up to iCloud regularly to keep in sync.
  • Data- These files are not meant to be edited or added directly by the user. Data may be kept in different directories as desired by the developer.

Conclusion

In this article, we have laid a basic foundation about the architecture of an iOS application. We are now familiar with the structure of the “Bundle” directory, the “Data” directory as well as the iCloud directory of an iOS application. In the next article, we will use this knowledge and analyze what we can get from an IPA file.

--

--