Skip to content
This repository has been archived by the owner on May 11, 2024. It is now read-only.

App cleaner doesn't find *Info.plist* file for iPhone/iPad apps on new Mac with Apple Silicon chip #244

Open
leonardthomson opened this issue Sep 30, 2022 · 4 comments
Labels

Comments

@leonardthomson
Copy link

Guide

How to clean uninstall macOS apps using AppCleaner open source alternative

Summary

I wanted to uninstall Chess from chess.com (iPad version) but got the error:

... % app-cleaner.sh /Applications/Chess.app
Cannot find app plist

I was able to reproduce the error for another iPhone app.

The error message is printed here. So for new Macs the if condition should be adapted.

@leonardthomson
Copy link
Author

leonardthomson commented Sep 30, 2022

Ha sorry😅
I wanted to add something:

It seems that the Info.plist file is saved in the wrapped app ($1/Wrapper/AppName.app/Info.plist).
For this file the condition gives plausible output.

... % /usr/libexec/PlistBuddy -c "Print CFBundleIdentifier" "/Applications/Chess.app/Wrapper/Chess.app/Info.plist"            
com.chess.iphone

@leonardthomson
Copy link
Author

The WrappedBundle is apperantly simply an alias for the true app which is in the Wrapper folder.
Since the app name and the wrapped app name don't doesn't have to be the same, it is easier to check for the file with "$1/WrappedBundle/Info.plist".

So my suggestion would be:

if [ -e "$1/Contents/Info.plist" ]; then
  bundle_identifier=$(/usr/libexec/PlistBuddy -c "Print CFBundleIdentifier" "$1/Contents/Info.plist" 2> /dev/null)
elif [ -e "$1/WrappedBundle/Info.plist" ]; then
  bundle_identifier=$(/usr/libexec/PlistBuddy -c "Print CFBundleIdentifier" "$1/WrappedBundle/Info.plist" 2> /dev/null)
else
  printf "%s\n" "Cannot find app plist"
  exit 1
fi

Convincing output:

... % app-cleaner.sh /Applications/Chess.app 
Checking for running processes…
Finding app data…
/Applications/Chess.app
/Users/username/Library/Application Scripts/com.apple.Chess
/Users/username/Library/Containers/com.apple.Chess
/var/folders/c2/flxghxsd6x1c3fjbngkzlpx00000gn/C/com.apple.Chess
/var/folders/c2/flxghxsd6x1c3fjbngkzlpx00000gn/C/com.chess.iphone
Move app data to trash (y or n)? y
Moving app data to trash…
Done

@verityj
Copy link

verityj commented Apr 25, 2023

I agree. App-cleaner does not find iPhone/iPad apps installed into silicon Macs. I ended up manually following https://www.macrumors.com/how-to/uninstall-iphone-ipad-apps-m1-mac/
To note, app-cleaner should look through ~/Library/Containers. I don't think I know enough scripting to enable that, so I end up doing it manually right now.

@verityj
Copy link

verityj commented Jun 21, 2023

I ended up modifying the original script to work with the iOS apps on Macs. But additionally, we need to delete the app containers (and any error log files or anything else that still persists). I shared the script and wrote it up: https://verityj.github.io/2023/06/21/clean.html. In case it helps anyone.

I specifically kept it as a two step process to have control of exactly what stays and what goes.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants