Search code examples
iosxcodemacoscocoagenstrings

How to get all open strings from .h and .m files Xcode


I want to create excel of all open strings @"..." in .h and .m files throughout my project. To standardise strings across platform. Is there any tool to get strings ? I used genstrings but it only finds localized strings.


Solution

  • You need to install BREW first and then GNU grep. -p no longer works with current grep in osx. http://www.heystephenwood.com/2013/09/install-gnu-grep-on-mac-osx.html

    I used following command after installing GNU grep

     grep -rPo --no-filename --include='*.m' '(?<=@")(.*)(?=")'  *  >> outfile.txt
    

    regex is not proper but still manageable.