Sysdiagnose "Programatically" in Self Service?

PhillyPhoto
Valued Contributor

Does anyone have a script that they use to run sysdiagnose from Self Service? Just having the command in a script, it requires you to press "enter", and gives an error in the logs stating:

Script result: Triggering sysdiagnose programmatically from CLI with incorrect arguments. Exiting.

This tool generates files that allow Apple to investigate issues with your
computer and help improve Apple products. The files might contain personal
information found on your device or associated with your iCloud accounts,
including but not limited to your name, serial numbers of your device,
your device name, your attached peripheral devices, your user name, your
email address and email settings, file paths, file names, Siri suggestions,
your computer's IP addresses, and network connection information.

This information is used by Apple in accordance with its privacy policy
(www.apple.com/privacy) and is not shared with any other company. By using
this tool and sending the results to Apple, you consent to Apple using the
contents of these files to improve Apple products.

Press 'Enter' to continue. Ctrl+\ to cancel.
File: /var/tmp/mat-debug-31596.log
1 ACCEPTED SOLUTION

PhillyPhoto
Valued Contributor

Thanks, @AVmcclint! I created this script, expanding on that option:

#!/bin/sh

# Run SysDiagnose programatically and then reveal the file to the user
sysD=`sysdiagnose -u`
sysDFile=`echo $sysD | awk '{print $NF}' | awk '{ print substr( $0, 2 ) }' | awk '{ print substr( $0, 1, length($0)-2 ) }'`
open -R $sysDFile

 

View solution in original post

2 REPLIES 2

AVmcclint
Honored Contributor

try 

sysdiagnose -u 

man sysdiagnose  says  

-u       Disable UI feedback

 and that seems to work on my system.

 

PhillyPhoto
Valued Contributor

Thanks, @AVmcclint! I created this script, expanding on that option:

#!/bin/sh

# Run SysDiagnose programatically and then reveal the file to the user
sysD=`sysdiagnose -u`
sysDFile=`echo $sysD | awk '{print $NF}' | awk '{ print substr( $0, 2 ) }' | awk '{ print substr( $0, 1, length($0)-2 ) }'`
open -R $sysDFile