Search the Community
Showing results for tags 'lipo'.
The following thinapp.py Python 3 script can be used on macOS systems to thin the multi-architecture Affinity apps (the FAT binaries, containing "x86_64" and "arm64" architectures) to the one only specific architecture just required by the particular Mac platform ("x86_64" or "arm64"). This will reclaim some disk space. Important prerequisites in order to make use of the thinapp.py Python script: Python 3 is installed on your MacOS system MacOS lipo from the Xcode development CLI tools is installed and can be find under /usr/bin/lipo ...or... an alternative GO based lipo from https://github.com/konoui/lipo/ A working file command is available and can be find under /usr/bin/file In order to check for the needed prerequisites, you can perform a corresponding which command execution in Terminal.app: > which python3 /Library/Frameworks/Python.framework/Versions/3.10/bin/python3 > which lipo /usr/bin/lipo > which file /usr/bin/file If all of the above prerequisites are met, you can execute the thinapp.py Python 3 script in Terminal.app like this to get a short help overview... If you apply execution rights to the thinapp.py Python 3 script, via "chmod +x thinapp.py" in Terminal.app, then you can also execute the script via it's filename directly just by calling it, aka thinapp.py or thinapp.py -h . For the -arch option argument supported architectures are x86_64 or arm64, in order to thin an app to an just Intel or Arm platform specific app only here! Now in order to thin let's say Affinity Designer.app to contain just the Intel "x86_64" architecture and thus to strip out the "arm64" architecture from it's FAT binary app, you would call thinapp.py this way ... ... which in turn would then create a duplicate copy of "Affinity Designer.app" under the by the -o option as argument given file path "/Users/<yourusername>/tmp" and then process to thin it there under the "/Users/<yourusername>/tmp/Affinity Designer.app" file path. The as -arch option given x86_64 argument tells thinapp.py to keep just that x86_64 architecture, meaning that the arm64 architecture will be stripped out of the FAT binary app. After the script has finished it's work, you can compare the ADe sizes under "/Applications/Affinity Designer.app" and "/Users/<yourusername>/tmp/Affinity Designer.app" in order to see how much space has been reclaimed due to the architecture thinning process. Next you can start the thinned app from "/Users/<yourusername>/tmp/Affinity Designer.app" in order to see if it operates well. - If all is fine, you can remove the initial "/Applications/Affinity Designer.app" and replace it with the thinned one from "/Users/<yourusername>/tmp/Affinity Designer.app" (... so exchanging the initial with the thinned app). What you can expect from thinning the V1 apps of ADe, APh and APub size wise is ... ADe v1 = initially ~2.59 GB after thinning to x86_64 it has then ~1.69 GB APh v1 = initially ~2.65 GB after thinning to x86_64 it has then ~1.71 GB APub v1 = initially ~2.60 GB after thinning to x86_64 it has then ~1.65 GB Here's the thinapp.py Python 3 script: thinapp.py <-- has been updated! And as always, have fun!
I recently cleaned my oldest MacOS system of unnecessary and unused clutter i.e. removed old installer file residues and referenced caches, Xcode tmp files etc. The whole thing has set me back ~80 GB of disk space. Then I looked at some other unnecessary space wasters, and the whole FAT binary apps caught my eye. I then asked myself why I need arm-based (arm64) architecture code on an Intel-based (x86_64) MacOS, so why multi-architecture FAT binaries here at all? - Well the answer is I don't need any FAT binaries on this Intel based box at all because it's just an unnecessary waste of disk space. To give people an idea of what I mean with unnecessary wasted space here, I show you how much ADe V1 as a multiarchitecture FAT binary (including x86_64 + arm64 code) will occupy on my disk ... ... and that I can get back ~1 GB of disk space when I thin/strip it to just contain the one needed, x86_64 in my case, architecture here ... Now the same applies to APh V1 (2.65 GB as a fat binary) and Apub V1 (2.6 GB as a fat binary), which when striped to contain just one architecture will also give back at least ~1 GB each. Suppose I would also have all three version 2 apps too installed, then stripping all Affinity v1 + v2 apps to just the one architecture I need here, would give back ~6 GB of disk space here. If I would have additional Beta versions installed and then strip those too I would reclaim additional disk space. Of course it's not just the Affinity apps which, as multiarchitecture FAT binaries, occupy unnecessary disk space here, the same applies to all other bigger third party multiarchitecture fat binary apps here too! I'm sure I will get back another ~50-60 GB of disk space when stripping all installed fat binary apps on my old system, which BTW has only a small build-in disk and thus every free GB counts here!