Posted on 08-23-2023 01:15 PM
hello is there a script out there already or how can i create a script that can
determine the Slack app architecture whether the user is using a - (intel, silicon, universal)? version of slack
Posted on 08-24-2023 09:31 AM
Hello,
A quick script using lipo
#!/bin/bash
if [[ -e /Applications/Slack.app ]]; then
appArch=$(lipo /Applications/Slack.app/Contents/MacOS/Slack -archs)
case "$appArch" in
"x86_64 arm64" ) echo "Universal App" ;;
"x86_64" ) echo "Intel App" ;;
"arm64" ) echo "Silicon App" ;;
esac
fi
Posted on 08-29-2023 09:55 AM
hello thank you so much for this script i really appreciate if you can please help me with this script question i wanted to know how can we update that script so it would work as a Jamf extension?
Posted on 08-31-2023 09:58 AM
Hello,
Once you are happy with your script outcome, go to Jamf Pro /Settings/Computer management/Extension attributes
Create a New EA
Give a Display Name
Data Type: String
Choose where to Inventory Display
Input Type select Script.
Copy and Paste the script and let the Macs update the info after the inventory update.
Now the script needs some key data to be sent to Jamf Pro. This is how.
echo "<result>some info</result>"
So the script above should be:
#!/bin/bash
if [[ -e /Applications/Slack.app ]]; then
appArch=$(lipo /Applications/Slack.app/Contents/MacOS/Slack -archs)
case "$appArch" in
"x86_64 arm64" ) echo "<result>Universal App</result>" ;;
"x86_64" ) echo "<result>Intel App</result>" ;;
"arm64" ) echo "<result>Silicon App</result>" ;;
esac
else
# if not installed, so you know the EA has run
echo "<result>N/A</result>"
fi
exit 0
I hope this helps.
Regards
Mauricio
Posted on 09-28-2023 04:33 PM
i appreciate the help on this i really do i just wanted to know is it possible to tweak the script or have it work without using the “lipo” command ?
Posted on 09-29-2023 12:13 AM
Using the previous recommendation of file command, grep the text of the binary and report 1 if matches and 0 is not. Bit more basic but should do the job.
#!/bin/bash
if [[ -e /Applications/Slack.app ]]; then
# using file and getting the number of entry for the text "Mach-O universal binary with 2 architectures"
appUniversal=$(file /Applications/Slack.app/Contents/MacOS/Slack | grep -c "Mach-O universal binary with 2 architectures")
case "$appUniversal" in
"1" ) echo "<result>Universal App</result>" ;;
"0" ) echo "<result>Not Universal App</result>" ;;
esac
else
# if not installed, so you know the EA has run
echo "<result>N/A</result>"
fi
exit 0
Posted on 08-24-2023 01:35 PM
is there a command on the mac terminal that can tell me if slack is using universal, intel, or silicon?
Posted on 08-24-2023 02:10 PM
file /path/to/binary | awk -F':\ ' '{print $2}'
Posted on 08-24-2023 02:13 PM
does not work
08-24-2023 03:17 PM - edited 08-24-2023 03:20 PM
It should've been the actual path to the binary file in question, with the path single- or double-quoted if needed. The one I provided was a placeholder for the purpose of presentation 😶