How to detect & avoid the use of private APIs in third party libraries

前端 未结 2 1008
花落未央
花落未央 2020-12-28 10:15

Now that Apple is running some kind of static analysis to automatically check for private API use, a number of people have been caught because of the Three20 library. I use

2条回答
  •  春和景丽
    2020-12-28 10:26

    You could try running nm on the object files instead of the linked executable:

    nm -g -j *.o  | sort | uniq
    

    The objects should be in the build/.build/*/.build/Objects-normal sub-directory.

    You're seeing a reference to AudioServicesPlaySystemSound because one of the functions you did call in turn calls AudioServicesPlaySystemSound.

    Objective C calls won't generally show up in nm dumps, you'll need to use otool for that:

    otool -ov 
    
        

    提交回复
    热议问题