Skip to content

Instantly share code, notes, and snippets.

@pablordoricaw
Last active April 15, 2021 20:54
Show Gist options
  • Save pablordoricaw/537506522b8f4141397ad0303352738b to your computer and use it in GitHub Desktop.
Save pablordoricaw/537506522b8f4141397ad0303352738b to your computer and use it in GitHub Desktop.
Bash script to unsign Microsoft Teams in macOS to be able to use external cameras for video input
#!/bin/bash
###
# Microsoft Teams stopped recognizing external cameras for video input in macOS
# after version 1.3.00.18164.
# User greghiggins3 in Microsoft's forum posted a solution.
# The solution involves unsigning Microsoft Teams.
# This Bash script automates the unsigning in macOS
# for Teams version 1.3.00.28778
# https://answers.microsoft.com/en-us/msteams/forum/msteams_tfb-msteams_tfmac/microsoft-teams-mac-os-client-is-not-recognizing/d9e863be-d9a4-4d03-a4b8-1b5c7df58828
###
# Emojis used in output
check='\xE2\x9C\x85'
x='\xE2\x9D\x8C'
smiley_face='\xF0\x9F\x98\x84'
teams_apps[0]='/Applications/Microsoft\ Teams.app'
teams_apps[1]='/Applications/Microsoft\ Teams.app/Contents/Frameworks/Microsoft\ Teams\ Helper.app'
teams_apps[2]='/Applications/Microsoft\ Teams.app/Contents/Frameworks/Microsoft\ Teams\ Helper\ \(GPU\).app'
teams_apps[3]='/Applications/Microsoft\ Teams.app/Contents/Frameworks/Microsoft\ Teams\ Helper\ \(Plugin\).app'
teams_apps[4]='/Applications/Microsoft\ Teams.app/Contents/Frameworks/Microsoft\ Teams\ Helper\ \(Renderer\).app'
unsign(){
$(eval "codesign --remove-signature $1")
}
success(){
printf "$check - Step $1/$2"
[ $1 -eq $2 ] && printf "\n" || printf "\r"
}
fail(){
printf "$x - Step $1/$2\n"
exit
}
[ $EUID -ne 0 ] && echo "Please run as root (sudo ./unsign-teams.sh)..." && exit 1
echo "-- Unsigning Microsoft Teams --"
num_teams_apps=${#teams_apps[@]}
((num_teams_apps--))
for ((i = 0; i <= $num_teams_apps; i++)); do
printf "[Unsigning]: " && printf "${teams_apps[$i]}\n"
unsign "${teams_apps[$i]}" && success $i $num_teams_apps || fail $i $num_teams_apps
done
printf "Now you can use external video inputs for Microsoft Teams " && printf "$smiley_face\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment