vbtrek
vbtrek

Reputation: 31

Where is the .dSYM file when building a Xamarin Forms 5 iOS with a Azure Devops Mac Build Agent

I'm using an Azure Devops Pipeline to build our Xamarin Forms 5.x app.

We have a self hosted DevOps agent installed on a mac which is used to build the iOS project, then we push the .ipa file up to App Center.

What I'd like to do is also push up the .dSYM file so we can get symbolicated crash reports.

I cannot find a .dSYM file in any of the agents folders, Microsoft's help file doesn't help iOS Symbolication, any suggestions where I can find this file?

The build tasks for my pipeline look like:

- task: XamariniOS@2
  displayName: 'Build Xamarin.iOS solution'
  inputs:
    solutionFile: '**/*.sln'
    configuration: '$(buildConfiguration)'
    buildForSimulator: false
    packageApp: true

- task: CopyFiles@2
  displayName: 'Copy Files to Artifact Staging Directory'
  inputs:
    SourceFolder: '$(System.DefaultWorkingDirectory)'
    Contents: '**/*.ipa'
    TargetFolder: '$(Build.ArtifactStagingDirectory)'
    flattenFolders: true

- task: PublishBuildArtifacts@1
  displayName: 'Publish Artifact iOS'
  inputs:
    PathtoPublish: '$(Build.ArtifactStagingDirectory)'
    ArtifactName: 'iOS'
    publishLocation: Container

Upvotes: 0

Views: 1181

Answers (2)

vbtrek
vbtrek

Reputation: 31

So I have found the dSYM folder, and it was in the Azure DevOps Mac Build Agent's _work folder (as per the Visual Studio Folders mentioned in @guangyu-bai-msft in the above post).

The reason I could not see the folder on the Azure DevOps Mac Build Agents _work folder after the build is something to do with the agent which seems to be moving some of the output files from:

<project directory>/bin/<platform>/<configurtion>

To the Agents binary folder:

_work\1\b

Then the Agent deletes the bin and obj folders under the project.

This is not a step I've added to my Pipeline, and I cannot see it logged by any of the steps, so I can only assume it's the Agent doing this. As long as I zip/copy the dSYM folder before the Pipeline stage finishes it works fine.

I've added a step as follows to the pipeline after CopyFiles@2 on the original post:

- task: ArchiveFiles@2
  # https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/archive-files-v2?view=azure-pipelines&viewFallbackFrom=azure-devops
  displayName: 'Compress dSYM Folder to Artifact Staging Directory'
  inputs:
    rootFolderOrFile: '$(System.DefaultWorkingDirectory)/<path to project>/bin/iPhone/Release/<project name>.app.dSYM'
    includeRootFolder: false
    archiveType: 'zip'
    archiveFile: '$(Build.ArtifactStagingDirectory)/<project name>.app.dSYM.zip'
    replaceExistingArchive: true

Upvotes: 0

Guangyu Bai - MSFT
Guangyu Bai - MSFT

Reputation: 4606

Solution for Visual Studio:

If you have enabled device-specific builds, the .dSYM can be found in the following directory:

<project directory>/bin/<platform>/<configuration>/device-builds/<device>-<os-version>/

For example:

TestApp/bin/iPhone/Release/device-builds/iphone8.4-11.3.1/

If you have not enabled device-specific builds, the .dSYM can be found in the following directory:

<project directory>/bin/<platform>/<configuration>/

For example:

TestApp/bin/iPhone/Release/

Solution for Xcode:

In general, if there is no human modification, the DSYM file will be stored in

`~/Library/Developer/Xcode`

You can use the find command to find all .dSYM files under the current pat

 allFiles=`find ~/Library/Developer/Xcode/Archives -iname '*.dSYM'`

Of course, if you want to be more precise, you can add the upper -type parameter :

filesPath=`find ~/Library/Developer/Xcode/Archives -iname '*.dSYM' -type f`

Upvotes: 0

Related Questions