Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Strip symbols for iPhone application

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 using a binary file editor.

Deployment:

1) Deployment Post processing(checked)

2) Strip Debug Symbols During Copy(checked)

3) Strip Linked Product(checked)

4) Use Separate Strip(checked)

Linking:

5) Dead Code Stripping(checked)

GCC 4.0 - Code Generation

6) Generate Debug Symbols(NOT checked)

like image 755
user88645 Avatar asked Apr 08 '09 15:04

user88645


2 Answers

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.

like image 54
Nicholas Riley Avatar answered Nov 18 '22 01:11

Nicholas Riley


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.

like image 35
osexp2003 Avatar answered Nov 18 '22 02:11

osexp2003