Enables you to use .bundle and other resources with SPM Unit-tests

What's New

1.0.0 🎉


First release ✌️

mit platform Lang SPM compatible Github actions badge codebeat badge


  • Enables you to use .bundle and other resources with SPM Unit-tests. (Perfect for Github action CI)
  • Enables you to also use the same code in XCode unit tests

Example code:

// The temp.bundle folder can be in the root of your project (same directory as your `Package.swift`)
// iOS can only add resources inside .bundle folders
let path: String = ResourceHelper.projectRootURL(projectRef: #file, fileName: "temp.bundle/payload.json").path
Swift.print("path:  \(path)") // Users/John/Documents/AwesomeApp/temp.bundle/payload.json

Note: Swift 5.3 has support for adding assets with SPM, although a bit cumbersome. here is a tutorial 😅:


ResourceHelper is available using the Swift Package Manager:

Using Xcode 11, go to File -> Swift Packages -> Add Package Dependency and search for ResourceHelper or enter:

If you are using Package.swift, you can also add ResourceHelper as a dependency easily.

let package = Package(
  name: "TestProject",
  dependencies: [
    .package(url: "", .branch("master"))
  targets: [
    .target(name: "TestProject", dependencies: ["ResourceHelper"])


  • Swift Tools 5.1.0
View More Packages from this Author


  • None
Last updated: Tue Feb 27 2024 07:39:26 GMT-1000 (Hawaii-Aleutian Standard Time)