How to get the name of the running application in iOS
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.
Introduction
On iOS, you can easily get information about your own app, but you cannot inspect arbitrary running apps on the device. That limitation is intentional: iOS sandboxing prevents one app from enumerating or identifying other running apps for privacy and security reasons.
So the practical answer depends on what you mean by "running application." If you want your app's display name, bundle name, or process name, iOS exposes that through your bundle metadata and process information.
Get Your App's Display Name
The name users normally see on the home screen is usually stored in the CFBundleDisplayName key inside the app's Info.plist. If that key is not set, many apps fall back to CFBundleName.
Here is a simple Swift helper:
This is usually what you want for UI, diagnostics, or logging.
Bundle Name, Bundle Identifier, and Process Name
These values are related, but they are not the same thing:
- '
CFBundleDisplayNameis the user-facing display name.' - '
CFBundleNameis the internal bundle name.' - '
bundleIdentifieris the unique reverse-domain identifier.' - '
ProcessInfo.processNameis the current executable process name.'
You can inspect all of them in one place:
For analytics and system integration, the bundle identifier is usually the most stable choice. For labels shown to users, prefer the display name.
If You Mean App State
Sometimes the question is really about whether the app is active, inactive, or in the background. iOS lets your app observe its own lifecycle state, but still not the full state of unrelated apps.
That can be useful for debugging why certain code runs only in the foreground, or why a network task is being deferred.
What You Cannot Do
You cannot ask iOS for "the name of the currently running application" in the desktop operating system sense. There is no public API that tells your app which other app is currently on screen or what other apps are running in the background.
The only limited cross-app checks available are mechanisms such as canOpenURL, app groups for apps you own, and system APIs with specific entitlements. None of those provide a general list of running applications.
That distinction matters because many developers come from desktop environments where process enumeration is normal. On iOS, that model does not apply.
A Small Utility Wrapper
If you need this information in multiple places, wrap it in a lightweight type:
This keeps the call sites clean and centralizes fallback behavior.
Common Pitfalls
- Expecting iOS to reveal other running apps. Public APIs do not allow general app enumeration.
- Using
CFBundleNamewhen you actually need the user-visible app name. PreferCFBundleDisplayNamefirst. - Assuming the process name and the display name are identical. They often differ.
- Forgetting that localization can affect display names if your
Info.plistis localized.
Summary
- Use
CFBundleDisplayNameto get the user-facing name of your own iOS app. - Fall back to
CFBundleNameif no display name is configured. - Use
bundleIdentifierfor stable internal identification. - Use
ProcessInfo.processNamewhen you need the executable process name. - You cannot use public iOS APIs to identify arbitrary other running applications.
Related reading
- How to get the Power of some Integer in Swift language?
- How to get the result of OnPostExecute to main activity because AsyncTask is a separate class?
- How to get the screen width and height in iOS?
- How to get the scroll bar with CSS overflow on iOS
- How to get the selected index of a RadioGroup in Android
- How to get the selected index of a RadioGroup in Android
- How to get the status bar height in iOS 13?
- How to get the TextField value in flutter
.png&w=3840&q=75)
Tackling System Design Interview Problems
A short course that equips you with the skills to approach system design interviews methodically.
Start the free courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.