Integrating Specto using CocoaPods

πŸ“˜

Specto supports integration using CocoaPods ~> 1.10. To check your CocoaPods version, run pod --version. If you are new to CocoaPods, please read their documentation first before following the steps below.

Add dependency to Podfile

Pin to Latest Version

To always pin to the latest release of Specto, add the following to your Podfile:

use_frameworks!

target :YourAppTarget do
  pod 'Specto', podspec: 'https://releases.specto.dev/ios/sdk/release/cocoapods'
end

πŸ“˜

If you use this "latest" endpoint, you'll need to run pod update to get newer versions than what may be declared in your Podfile.lock.

Pin to Specific Version

To pin to a specific version of Specto, add the following to your Podfile (the version number used in this example is 0.2.4, which is appended as the last component of the podspec URL):

use_frameworks!

target :YourAppTarget do
  pod 'Specto', podspec: 'https://releases.specto.dev/ios/sdk/release/cocoapods/0.2.4'
end

After updating your Podfile, run pod install to download and integrate the dependency.

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.

  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:

"${PODS_ROOT}/Specto/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:

"${PODS_ROOT}/Specto/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.