---
title: CFBundleGetAllBundles()
framework: corefoundation
role: symbol
role_heading: Function
path: corefoundation/cfbundlegetallbundles()
---

# CFBundleGetAllBundles()

Returns an array containing all of the bundles currently open in the application.

## Declaration

```swift
func CFBundleGetAllBundles() -> CFArray!
```

## Return Value

Return Value A CFArray object containing CFBundle objects for each open bundle in the application. Ownership follows the The Get Rule.

## Discussion

Discussion This function is potentially expensive and not thread-safe. It’s best used for debugging or other diagnostics purposes rather than as part of the main execution path of production code.

## See Also

### Creating and Accessing Bundles

- [CFBundleCreate(_:_:)](corefoundation/cfbundlecreate(_:_:).md)
- [CFBundleCreateBundlesFromDirectory(_:_:_:)](corefoundation/cfbundlecreatebundlesfromdirectory(_:_:_:).md)
- [CFBundleGetBundleWithIdentifier(_:)](corefoundation/cfbundlegetbundlewithidentifier(_:).md)
- [CFBundleGetMainBundle()](corefoundation/cfbundlegetmainbundle().md)
