Integrating Specto Manually (framework or xcframework)

πŸ“˜

Specto supports integration using both a fat framework (.framework) binary, or the new .xcframework format. We recommend using the XCFramework, which is required in order to support the arm64 iOS Simulator on Apple Silicon.

Add dependency to Xcode

Download Latest Version

Use the following links to download the latest version of Specto:

Download Specific Version

To download a specific version of Specto, use the following link format instead, with the version number appended as the last component of the URL (1.1.0 in this case):

After downloading the framework and unzipping it into your project directory, follow these steps:

  1. Drag the framework artifact into your Xcode Project Navigator to add it to the project.
  2. Select your project from the Xcode Project Navigator
  3. Select your application target
  4. Select the General tab
  5. Add Specto.xcframework (or Specto.framework, depending on which one you chose) to Frameworks, Libraries, & Embedded Content if it isn't there already, and change the Embed mode to Embed & Sign
Add Specto.xcframework to Xcode (steps 2-5)Add Specto.xcframework to Xcode (steps 2-5)

Add Specto.xcframework to Xcode (steps 2-5)

Add Run Script build phase

Specto uses a tool that runs at build time to synchronize your app metadata and upload debug symbols (dSYMs) to our service. Download the tool here. We recommend putting the SpectoTools directory in the root of your project directory. If you choose to place it in an alternate location, remember to change the references to $(SRCROOT)/SpectoTools in the steps below to the actual path.

πŸ“˜

A new version of the symbol upload tool is released alongside every new SDK release. When you update your SDK, remember to update the symbol upload tool as well.

Once you've downloaded the tool, follow the steps below to add the Run Script build phase:

  1. Select your project from the Xcode Project Navigator
  2. Select your application target
  3. Select the Build Phases tab
  4. Click the + button on the top left
Adding a Run Script build phase in Xcode (steps 1-4)Adding a Run Script build phase in Xcode (steps 1-4)

Adding a Run Script build phase in Xcode (steps 1-4)

  1. Click New Run Script Phase
Adding a Run Script build phase in Xcode (step 5)Adding a Run Script build phase in Xcode (step 5)

Adding a Run Script build phase in Xcode (step 5)

  1. Ensure that the new build phase is ordered after all of the other build phases, and give it a descriptive name
  2. Copy the API key that was automatically created upon sign up or create a new API key from the dashboard and use the following as the contents of the script, replacing the placeholder with your actual API key:

For Release builds only

If you only want to upload symbols that are built with a Release configuration, use the following script:

"${SRCROOT}/SpectoTools/specto-upload-symbols" --key "Insert your API key here"

For all builds (including Debug)

If you want to upload symbols for all builds, add the --allow_debug option:

"${SRCROOT}/SpectoTools/specto-upload-symbols" --key "Insert your API key here" --allow_debug

By default, Xcode does not generate dSYM files for debug builds. You will need to set Debug Information Format to DWARF with dSYM File for both Debug and Release configurations:

Setting the Debug Information Format setting to DWARF with dSYM File in Xcode build settingsSetting the Debug Information Format setting to DWARF with dSYM File in Xcode build settings

Setting the Debug Information Format setting to DWARF with dSYM File in Xcode build settings

8. (Going back to the Build Phases tab) Make sure that the Based on dependency analysis checkbox is unchecked. We also recommend that you uncheck the For install builds only checkbox, but you can optionally leave this option checked if you only want to upload symbols for Archive builds that are generated for an App Store or TestFlight submission. Enabling this option means that you won't be able to use Specto in your local development builds, which is why we recommend unchecking the box.

Adding a Run Script build phase in Xcode (steps 6-8)Adding a Run Script build phase in Xcode (steps 6-8)

Adding a Run Script build phase in Xcode (steps 6-8)

Build and run the app

  1. Build & run (⌘ + R) the app to run the upload tool, which will register your application with the Specto service. If you chose above to only enable symbol uploads for Release or Archive builds, ensure that your current build configuration is set accordingly
  2. Select the Report Navigator tab
  3. Select the latest Build action
  4. Find the Run Script build phase step for the Specto upload tool and ensure that it succeeded without any errors or warnings
  5. If the step failed, click the disclosure button to expand the step and view the logs. Include these logs when contacting support
Building & running the app in Xcode, and viewing the build results (steps 1-5)Building & running the app in Xcode, and viewing the build results (steps 1-5)

Building & running the app in Xcode, and viewing the build results (steps 1-5)


What’s Next

Follow the quick start guide to configure the Specto SDK and collect your first performance metrics.