Preferences->Downloads->Components->Command Line Too" /> Preferences->Downloads->Components->Command Line Too" /> Preferences->Downloads->Components->Command Line Too"/>

How to use terminal for working with xCode Command Line Tools?

3.3k views Asked by At

Context: I have installed the Command Line Tools separately as the conventional method of "xCode->Preferences->Downloads->Components->Command Line Tools->Install" didn't work for me.

Purpose: I need to implement internationalization/localization on my application and want to use genstrings for creating the Localizable.Strings files.

Problem: When I try to use the Terminal and type command like

$ find . -name *.m | xargs genstrings -o en.lproj

I Get:

couldn't connect to output directory en.lproj

How should I specify the path for directory? Also, I might need to specify the path for some *.m files as well.

Note: I was suggested to read the genstrings manual but I am not sure how to work with a particular xCode project while using the Terminal.

1

There are 1 answers

0
Kushal Ashok On

Two things need to be taken care of:

1) After entering the Terminal, first go to the folder in which the targeted .m files are present. Use:

cd "path"

2) While using the genstrings code, specify the complete path of the output directory. e.g.:

genstrings -o /Users/kushalashok/Desktop/ProjectnName/en.lproj *.m

After running the code, a new file named "Localizable.strings" will be created in the specified output folder.