Last active
May 7, 2026 14:49
-
-
Save athoune/a1cce040e83dcd390ee17385f1f56f61 to your computer and use it in GitHub Desktop.
Find all non arm64 applications
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| # your can pass blacklisted words as ARGV | |
| IO.popen("find /Applications -name Info.plist") do |io| | |
| io.each_line do |line| | |
| line = line.rstrip | |
| if line.end_with? ".app/Contents/Info.plist" | |
| exe = `plutil -extract CFBundleExecutable raw '#{line}'`.rstrip | |
| exe_path = "#{line[..-(1+"Info.plist".length)]}MacOS/#{exe}" | |
| file = `file "#{exe_path}"`.rstrip | |
| if ! ["arm64", "POSIX shell script text executable"].any? { |i| file.include? i} | |
| next if ARGV.any? { |black_list| exe_path.include?(black_list) } | |
| puts exe_path | |
| puts file | |
| puts `brew search --cask "#{exe_path.split("/")[2].split(".").first}"` | |
| puts | |
| $stdout.flush | |
| end | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment