Skip to content

Instantly share code, notes, and snippets.

@athoune
Last active May 7, 2026 14:49
Show Gist options
  • Select an option

  • Save athoune/a1cce040e83dcd390ee17385f1f56f61 to your computer and use it in GitHub Desktop.

Select an option

Save athoune/a1cce040e83dcd390ee17385f1f56f61 to your computer and use it in GitHub Desktop.
Find all non arm64 applications
#!/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