0

I'm running on a 2017 macbook pro so I don't need arm64 architecture. I can thin the application manually by going to each executable and library and use lipo to extract the x86_64 architecture, but it's very time-consuming for applications with many frameworks/libraries embedded.

Is there a software or a way to thin universal application recursively? It need to:

  • identify all files that are executables/libraries and contains both x86_64 and arm64 in the application bundle, and for each file:
  • extract the x86_64 part of the file
  • replace the original file with the thinned file
  • preferably, restore the modified date of the folder containing the file

Note that the two solutions here does not answer my question because Monolingual does not thin frameworks and libraries inside the application bundle and Xslimmer is discontinued.

Joy Jin
  • 2,733
  • My best bet would be to open an issue on Monolingual to request that feature – Alexander Nov 02 '21 at 13:55
  • 2
    A) This will break the app's signatures. B) Are you sure it's worth it? The space saved from the executables is usually small compared to all the data (your own and that provided by app resources). – DarkDust Nov 02 '21 at 15:15
  • @DarkDust It will not. I have tested it. Simply put, there are separate signatures for each architecture, and deleting one will not break the app's signature. – Joy Jin Nov 03 '21 at 02:21
  • 1
    Huh, you're right. Just checked with otool, there's a LC_CODE_SIGNATURE entry per architecture. Never noticed this, and I sometimes needed to look executables with an editor; signatures are indeed present multiple times. Still leaves the question: are you sure it's worth the effort? I'd simply write a small shell script, finding all executables using find … -type f -perm +a=x …, which will also find lots of files with executable bits that are not libraries or programs. You can try to filter these further using file, but lipo should ignore them anyway (with a warning). – DarkDust Nov 03 '21 at 07:57
  • 1
    @DarkDust For applications with chromium or electron framework, doing this basically cuts down the size by 1/2. i.e. 600 mb application becomes 300mb application. Since doing this have zero negative effects, I don't think it's a bad thing to do for large applications. – Joy Jin Nov 03 '21 at 12:11

0 Answers0