Skip to content

Instantly share code, notes, and snippets.

@olgusirman
Created March 2, 2021 22:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save olgusirman/92212671eafa5210e33617ae3d11f5ad to your computer and use it in GitHub Desktop.
Save olgusirman/92212671eafa5210e33617ae3d11f5ad to your computer and use it in GitHub Desktop.
Lipo command descriptions
https://ss64.com/osx/lipo.html
lipo
Create or operate on a universal file: convert a universal binary to a single architecture file, or vice versa.
Syntax
lipo [input_file]... [-arch arch_type input_file]... [-arch_blank arch_type]...
{ -info | -detailed_info }
[-output output_file] Operation
[-segalign arch_type value]
where Operation is one of:
[-create] [-arch_blank arch_type]
[-thin arch_type]
[-extract arch_type] ...
[-extract_family arch_type] ...
[-remove arch_type] ...
[-replace arch_type file_name] ...
[-verify_arch arch_type ...]
Options
-info Briefly list the architecture types in the input universal file.
Lists the names of each archive.
-detailed_info
Display a detailed list of the architecture types in the input universal file.
Lists universal header info. for each architecture in the file.
-arch arch_type input_file
Tell lipo that input_file contains the specified architecture type.
This is unnecessary if input_file is an object file, a universal file,
or some other file whose architecture(s) lipo can figure out.
-arch_blank arch_type
The output for the specified arch_type will be an MH_DYLIB_STUB file.
This flag can not be used with any operation other than -create.
-output output_file
The output file.
-create
Create one universal output file from the input file(s).
-thin arch_type
Take one input file and create a thin output file with the specified arch_type.
-replace arch_type file_name
Take one universal input file; in the output file, replace the arch_type contents
of the input file with the contents of the specified file_name.
-remove arch_type
Take one universal input file and remove the arch_type from that universal file,
placing the result in the output file.
-extract arch_type
Take one universal input file and copy the arch_type from that universal file into
a universal output file containing only that architecture.
-extract_family arch_type
Take one universal input file and copy all of the arch_types for the family that
arch_type is in from that universal file into an output file containing only those
architectures. If only one architecture is found the file will be thin.
-verify_arch arch_type ...
Take one input file and verify the specified arch_types are present in the file.
If so then exit with a status of 0 else exit with a status of 1.
-segalign arch_type value
Set the segment alignment of the specified arch_type when creating a universal file
containing that architecture. value is a hexadecimal number that must be an
integral power of 2. This is only needed when lipo can't figure out the alignment
of an input file (currently not an object file), or when it guesses at the
alignment too conservatively. The default for files unknown to lipo is 0
(2^0, or an alignment of one byte), and the default alignment for archives
is 4 (2^2, or 4-byte alignment).
arch_type A supported architecture name: i386 (32-bit intel) ppc (32-bit powerpc)
ppc64 (64-bit powerpc) or x86_64 (64-bit intel)
lipo produces one output file, and never alters the input file.
lipo can: list the architecture types in a universal file; create a single universal file from one or more input files; thin out a single universal file to one specified architecture type; and extract, replace, and/or remove architectures types from the input file to create a single new universal output file.
Example
$ cd /Applications
$ lipo Stickies.app/Contents/MacOS/Stickies -info
$ lipo Stickies.app/Contents/MacOS/Stickies -thin i386 -output Stickies.app/Contents/MacOS/Stickies.i386
$ cd Stickies.app/Contents/MacOS/
$ rm Stickies
$ mv Stickies.i386 Stickies
“Music is the universal language of mankind” ~ H. W. Longfellow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment