Skip to content

Instantly share code, notes, and snippets.

@mahdi-malv
Created March 23, 2024 11:56
Show Gist options
  • Save mahdi-malv/12d99653da31287aa40444819dbf837b to your computer and use it in GitHub Desktop.
Save mahdi-malv/12d99653da31287aa40444819dbf837b to your computer and use it in GitHub Desktop.
Bulk remove apps from iOS or iPadOS using idb (fbidb.io)
#!/bin/bash
DEVICE_UDID=""
# Run the command and store the result in a variable
apps=$(idb list-apps --udid "$DEVICE_UDID")
echo "$apps" | while IFS= read -r app; do
# Parse the app details
id=$(echo "$app" | cut -d '|' -f 1 | tr -d '[:space:]')
name=$(echo "$app" | cut -d '|' -f 2 | tr -d '[:space:]')
type=$(echo "$app" | cut -d '|' -f 3 | tr -d '[:space:]')
# If the app is not a system app, print its details
if [[ "$type" != "system" ]]; then
# Use tput to set the text color
green=$(tput setaf 2)
yellow=$(tput setaf 3)
reset=$(tput sgr0)
# Print the app name in yellow and the id in green
echo "${yellow}$name${reset} (${green}$id${reset}) - $type"
# Ask for user confirmation
read -p "Remove ${green}$name${reset}? (y/n - def=y): " confirm < /dev/tty
if [[ "$confirm" != "n" ]]; then
echo "${red}Removing${reset} ${red}$name${reset}..."
idb uninstall --udid "$DEVICE_UDID" "$id"
else
echo "${yellow}Skipping${reset}"
fi
else
red=$(tput setaf 1)
echo "Skipping system app: ${red}$name${reset}"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment