Execute symbolicatecrash from shell script

末鹿安然 提交于 2019-12-07 21:07:57

问题


I am trying to call symboliccrash from a shell script that loops through multiple crash log file and outputs symbolicated version, but it is failing with an error message saying "command not found"

But it works fine in the command line.

symboliccrash CRASH_FILE.crash APP.dSYM > symbolicated.crash

I tried to find the source for symboliccrash but it fails to find it

which -a symboliccrash

Shell Script Code

#!/usr/bin/bash
export DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer"
i=0

for x in *.crash;
do
        symboliccrash $x MyApp.dSYM > $i.crash
        i=$((i+1))
done

Response

compareUUD.sh: line 7: symboliccrash: command not found

Any idea how i can do this.


回答1:


I think that you need first of all is execute this command

find /Applications/Xcode.app -name symbolicatecrash -type f

on your Terminal, this will retrieve the localization of your symbolicatecrash something like this

/Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/symbolicatecrash

then you need to update your script to this code

#!/usr/bin/bash
export DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer"

alias symbolicatecrash='/Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/symbolicatecrash'

i=0

for x in *.crash;
do
        symbolicatecrash $x MyApp.dSYM > $i.crash
        i=$((i+1))
done

and replace the direction of symbolicatecrash for the result given by the execution of find /Applications/Xcode.app -name symbolicatecrash -type f

and that is it,execute with sudo sh, I tested and result in this error

No crash report version in 0.crash at /Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/symbolicatecrash line 1007.

But I asume that this error is because I don't have any crash or dSYM so I think that now is working, I hope this help you



来源:https://stackoverflow.com/questions/39040757/execute-symbolicatecrash-from-shell-script

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!