Created
May 20, 2019 17:27
-
-
Save AndrewWCarson/9177b80632779d4250f67f02b1ad7379 to your computer and use it in GitHub Desktop.
Prints all apps that are 32-bit only.
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/python | |
import subprocess | |
import plistlib | |
def get32BitApps(): | |
cmd = '/usr/sbin/system_profiler -xml SPApplicationsDataType' | |
p = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) | |
out, err = p.communicate() | |
if p.returncode != 0: | |
exit('Error: ' + err) | |
plist = plistlib.readPlistFromString(out) | |
foundApps = [] | |
apps = plist[0]['_items'] | |
for app in apps: | |
if 'no' in app.get('has64BitIntelCode'): | |
foundApps.append(app.get('path')) | |
return foundApps | |
if __name__ == '__main__': | |
for app in get32BitApps(): | |
print app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
/usr/bin/mdfind "kMDItemContentType == 'com.apple.application-bundle' && kMDItemExecutableArchitectures != '*x86_64*'"