Skip to content

Instantly share code, notes, and snippets.

@jsaguiar
Created May 19, 2016 16:55
Show Gist options
  • Save jsaguiar/38b58ba9feb3fa807e69ef36cb7fd5e2 to your computer and use it in GitHub Desktop.
Save jsaguiar/38b58ba9feb3fa807e69ef36cb7fd5e2 to your computer and use it in GitHub Desktop.
#run this script on yout dSYMS folder
import subprocess
app_name = "your app name"
new_rellic_key = "new rellic key (same as app)"
all_dsyms = subprocess.Popen('ls', shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
for line in all_dsyms.stdout.readlines():
dsym = line.rstrip('\n')
zip_file = dsym+'.zip'
zip_command = "/usr/bin/zip --recurse-paths '"+zip_file+"' '"+ dsym + "'"
subprocess.Popen(zip_command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT).communicate()
uuid_command = "xcrun dwarfdump --uuid "+line.rstrip('\n')+" | tr '[:upper:]' '[:lower:]' | tr -d '-'| awk '{print $2}' | xargs | sed 's/ /,/g'"
uuids = subprocess.Popen(uuid_command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
for uuid in uuids.stdout.readlines():
send_command = "curl -F dsym=@'"+zip_file+"' -F buildId='"+uuid.rstrip('\n')+"' -F appName= '"+ app_name + "' -H 'X-APP-LICENSE-KEY: "+ new_rellic_key + "' https://mobile-symbol-upload.newrelic.com/symbol"
subprocess.Popen(send_command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT).communicate()
print("done")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment