Member-only story

Analyze iOS App Binary size with Link Map

ohdarling
4 min readApr 15, 2022

--

Why?

As an iOS developer, it is often a concern that the size of the app will be a factor in whether or not a user decides to download the app when they see it in the App Store, and if the app is too large, it may discourage users from downloading the app, especially if they are on a cellular network.

For an iOS App, its size usually consists of the following components:

  • Executable binary files
  • Resource files
  • Third Party Framework

For resource files and third-party frameworks, we can count the disk space they occupy by counting the file size directly, but for binary files, how do we count the size of the code it contains?

How?

Luckily, Xcode provides us with a statistics file like Link Map to show the actual size of the code in the executable binary after compilation, and by analyzing this file, we can know exactly how much of the final executable binary it will occupy for each code file.

In order for Xcode to generate the Link Map file we need, we need to go to the project’s settings screen in Xcode, select the target which we need to generate the Link Map, select the Build Settings tab, enter “link map” in the search box (attention that there is a space between link and map), and then you will see the following settings.

--

--

ohdarling
ohdarling

Written by ohdarling

Coding and creating, build apps on tickplant.com.

Responses (1)