简体   繁体   中英

How to symbolicate crash logs using the .xcarchive file?

I am having issues extracting the dsym file from .xcarchive to symbolicate crash logs. I understand that .xcarchive contains both the .app files and .dsym files. Normally you should be able to right click on the xcarchive file and selecct "Show Package Contents" ( link ). However "Show Package Contents" does not show up for me.

I also attempted to symbolicate the crash logs manually by using symbolicatecrash and giving it the xcarchive file ( link ). However it would still return crash logs that were not symbolicated.

Would anyone know what could be going on here? Any help is appreciated, Thank you!

I have prepared a script which takes two parameters,

  1. MyApp.crash
  2. MyApp.xcarchive

And gracefully output the MyApp_symbolicated.crash

Scripts:

#!/bin/bash

if [ "$#" -ne 2 ]; then
        echo "Argument missing [symbolicate @logLocation @xcarchiveLocation]"
        exit 0
fi

if test -e "$1"; then
    echo "$1 exists"
else
    echo "$1 does not exist!"
    exit 1
fi

if test -e "$2"; then
    echo "$2 exists"
else
    echo "$2 does not exist!"
    exit 1
fi

parentdir=`pwd`
export DEVELOPER_DIR=`xcode-select -p`
PATH=$PATH:$DEVELOPER_DIR
echo $PATH
cd $DEVELOPER_DIR
cd ../SharedFrameworks/
commanddir=`pwd`
command=$commanddir/`find . -name symbolicatecrash`
cd $parentdir
crashlog="$1"
archive="$2"
outputdir=`dirname "$crashlog"`
nfile=$(echo $1 | rev | cut -f 2- -d '.' | rev)
outputfile="$nfile"_symbolicated.crash
echo $nfile
desymfile="$archive"/dSYMs/*.dSYM
$command -v "$crashlog" "$desymfile" > "$outputfile"

How to use:

  1. create a file symbolicate in /usr/local/bin/
  2. Put the above code in symbolicate file
  3. set execute permission with chmod 777 symbolicate
  4. Run from wherever in your location with proper params

output will be generated in same directory of crash file.

  1. Plug an iOS Device into the Machine that contains the archive in the designated archives folder.

  2. Open the devices window in Xcode.

  3. Open device logs.

  4. Drag an drop your crash report into the list of logs of the device. Wait until it gets resymbolicated.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM