2

I am working on an iOS app using Xcode 6.4 in OS X 10.11 El Capitan (Beta 3).

Whenever I try to localise using the terminal command genstrings I get the message

genstrings: error: unable to find utility "genstrings", not a developer tool or in PATH

I have been getting this error since the 2nd beta.

Did anyone have to deal with this issue? Thanks in advance!

ajpallares
  • 777
  • 4
  • 16
  • Print the `$PATH` variable in your terminal, and then go check in those directories for the `genstrings` utility. If you can't find it there, then you need to install it manually or add a directory to your path so it can find the command. – ndmeiri Jul 09 '15 at 16:33
  • Thank you @ndmeiri for your answer. The thing is that `genstrings` dos appear in one of the directories... That is the weird thing – ajpallares Jul 10 '15 at 13:08
  • I'm having this exact same problem with El Capitan's release version :-( – Erik van der Neut Oct 02 '15 at 02:27

4 Answers4

4

Hi I am also running into this problem when trying to use Xcode 6.4's genstrings in OS X El Capitan, with Xcode 7 installed.

For some reason, the genstrings for Xcode 6.4 in /Applications/Xcode.app/Contents/Developer/usr/bin is missing. I tried to re-install Xcode Developer Tools by running xcode-select --install but to no avail.

The solution I am using is kind of a hack which is making a symlink from the genstrings in Xcode 7 into Xcode 6.4's Developer/usr/bin path as shown in the following command.

sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/usr/bin/genstrings /Applications/Xcode.app/Contents/Developer/usr/bin
  • Thank you @Nicholas for your help!. It seems to work. I guess this is a temporary fix – ajpallares Jul 13 '15 at 07:44
  • I only have Xcode 6.4 installed and have this exact same problem. The weird thing is that I do have the executable `/usr/bin/genstrings` on my machine, but when I run that I get this same error. Would my only fix at the moment be to install Xcode 7 in parallel and point to that genstrings? This is so strange... :-( – Erik van der Neut Oct 02 '15 at 02:26
  • I installed Xcode 7 as `Xcode.app` after renaming my 6.4 version to `Xcode 6.4.app`. Now genstrings works again, but now my cocoapods doesn't. Is the solution for all this to somehow switch back to the 6.4 command line tools (there is a commend for that I think) and then make that symbolic link like Nicholas is saying? – Erik van der Neut Oct 03 '15 at 23:53
  • Okay, that's it - just have to switch the version of the command line tools in the Xcode settings. So solution for me is: (1) Have both 6.4 and 7 installed, (2) Choose 6.4 version of command line tools in preferences when needing to run cocoapods, (3) Choose 7 version of command line tools in preferences when needing to run genstrings. Of course, that symlink is a brilliant hack as well. – Erik van der Neut Oct 04 '15 at 00:02
1

Looks like Apple is not providing a long term solution

OS X El Capitan no longer ships with genstrings. That utility is instead provided by Xcode 7. This means that older versions of Xcode won’t find genstrings in /usr/bin like they would on older versions of OS X. (19708961)

Xcode 7 Release Notes

ChrisSH
  • 126
  • 1
  • 11
1

For me, I needed to change the path to my active developer directory.

You can see your current active developer directory by running the following:

$ xcode-select -p

Which originally output /Library/Developer/CommandLineTools.

Solution:

I had to run

$ sudo xcode-select -s /Applications/Xcode.app

which then changed the output of the first command to /Applications/Xcode.app/Contents/Developer. After that, the genstrings command was found correctly.

AdamPro13
  • 7,232
  • 2
  • 30
  • 28
0

OS X 10.11 (El Capitan) doesn't include genstrings any more (see the Xcode 7 Release Notes). It is now included in Xcode 7. If you have Xcode 6.4 selected as the command line tools, you won't be able to run genstrings. You can, however, use xcrun and set the DEVELOPER_DIR environment variable to run it from Xcode 7, even if that version isn't selected as the command line tools:

DEVELOPER_DIR=<path to Xcode 7.x> xcrun genstrings

e.g., if you have the latest version of Xcode installed as /Applications/Xcode.app, you can do

DEVELOPER_DIR=/Applications/Xcode.app xcrun genstrings
Ben Lings
  • 28,823
  • 13
  • 72
  • 81