Strip symbols for iPhone application

后端 未结 2 1759
有刺的猬
有刺的猬 2021-02-08 17:13

What are the settings in Xcode to strip symbols for an iphone application?

I use these settings in Xcode but still see classnames and their methods in the executable us

相关标签:
2条回答
  • 2021-02-08 17:29

    Objective-C class and method information can't be stripped - it is necessary for execution. Best you can do is come up with some kind of obfuscation, if you want.

    0 讨论(0)
  • 2021-02-08 17:41

    I did it.

    I only checked following three settings, other setting is irrelevant.

    1) Deployment Postprocessing (checked)

    3) Strip Linked Product (checked)

    4) Use Separate Strip (checked)

    enter image description here

    Of course, you need should check "Distribution" version in schema editor. enter image description here

    Then clean!!! and build.

    I'v also confirmed that "strip" command is called by Xcode: Show log navigator, select Build .... release, at the bottom, i found progress description:

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip /Users/xxx/Library/Developer/Xcode/DerivedData/aaaaa-dytaamkvztdwfreoqteyeijwqdcu/Build/Products/Distribution-iphoneos/aaaaa.app/aaaaa
    

    enter image description here

    Finally, I'v checked the result by "nm" command to final product file,

    nm -a /Users/xxx/Library/Developer/Xcode/DerivedData/aaaaa-dytaamkvztdwfreoqteyeijwqdcu/Build/Products/Distribution-iphoneos/aaaaa.app/aaaaa

    All function name of current app is really stripped. Such as following function name :

    000b0a00 t _pj_ioqueue_create

    00092ae4 t ___destroy_helper_block_200

    00092af8 t ___68-[MyClass myMethod:param2]_block_invoke_21782

    Note: objective-C method and property name string are still produced to app file, but that is not symbol name for OS loader, they are just meta data of objective-C class.

    0 讨论(0)
提交回复
热议问题