At times it may be necessary to debug against a local build of Glean or another git fork or branch in order to test new features or specific versions of Glean.
Glean is shipped as a Swift Package (as glean-swift). To replace it in consuming application you need to locally build an XCFramework and replace the Swift package with it. The following steps guide you through this process.
In your local Glean checkout run:
This will create the XCFramework in
- Open the project in Xcode.
- Remove the
glean-swiftpackage dependency in the project's settings.
- Clear out any build artifacts. Select the
Clean Build Folder.
- Right-click in the file tree and select "Add files".
- Select the directory generated in your local Glean checkout,
- In the project settings, select your target.
- In the General section of that target, look for the "Frameworks, Libraries, and Embedded Content" section.
- Click the
+(plus) symbol and add the
- Run a full build. Select the
The application is now built with the locally built Glean XCFramework.
After making changes to Glean you will have to rebuild the XCFramework, then clean out build artifacts in the consuming application and rebuild the project.