ios static library decompression


First to prepare a static library .a file, such as call staticLibrary.a, on the desktop in the test directory.

Separation arch

First to filelook staticLibrary.a, look at the file contains several arch.

~  cd Desktop/test
test  ls
staticLibrary.a
test  file staticLibrary.a 
staticLibrary.a: Mach-O universal binary with 2 architectures
staticLibrary.a (for architecture armv7):   current ar archive random library
staticLibrary.a (for architecture arm64):   current ar archive random library
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

You can see the file contains two arch, they are armv7 and arm64. 
Since the object when pulled below it must be to a single database, so here we have it withdrawn armv7 named v7.a:

lipo staticLibrary.a -thin armv7 -output v7.a
  • 1

This time should be more than a v7.a file in the test directory.

object pulled .a file

ar -x v7.a
  • 1

You will find some more .o files

Get File

For example, out of more than just a View.o file, use the following command to obtain:

nm View.o > view.m
  • 1

OK to take a look view.m file


Original: http: //blog.csdn.net/showhilllee/article/details/49871363

Published 172 original articles · won praise 35 · views 390 000 +

Guess you like

Origin blog.csdn.net/u012198553/article/details/78132922