Error: Can't run /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/ibtool (no such file)
Asked Answered
R

3

7

I'm trying to use ibtool for iOS development (localization), but when I run it from terminal I get the following error:

Error: Can't run /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/ibtool (no such file).

What gives?

Riddance answered 10/7, 2012 at 22:56 Comment(0)
R
15

Did some digging on this one and found a few good Stack responses to similar problems - but no generic solutions for all comers, so I figured I'd make one. :)

The cause of the problem is: in modern versions of OSX, if you install Xcode from the App Store, it installs itself like all other Apps - which means it's in a different directory than was historically the case. Unfortunately, this has far-reaching implications that affect both Xcode and its command-line tools and - in fact - other things that reach far beyond the scope of this question.

So, until they fix it, let's talk workarounds. Many people recommend changing your Xcode system variables to point to the 'App Store' folder, but I think this is a dangerous overkill - you just don't know what kind of mayhem it may cause if they ever fix their pathing!

Instead, I recommend using Terminal to change only the system link affecting ibtool (or whatever tool you're using), like so:

Recommended solution

Step 1: Remove the old system link

sudo rm /usr/bin/ibtool

Step 2: Create a new system link

sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/bin/ibtool /usr/bin/ibtool

For reference only, here is another command that will fix this - but I DO NOT recommend using it for the reasons stated above:

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

I can see the argument that xcode-select might be a proper solution if you have all kinds of /Developer-related errors, but in that case I would just reinstall Xcode without using the App Store and get it going good from the start.

For the rest of us already too far down the App Store path to re-do it all, see above.

Riddance answered 10/7, 2012 at 22:56 Comment(2)
You can use xcrun command to launch a binary from within the Xcode bundle. Have you tried xcrun ibtool?Commentary
You'll need to enter recovery mode in order to remove /usr/bin/* without getting a failure error. To enter recovery mode, you need to reboot your mac and press ⌘+R when booting up.Endomorph
N
0

Absolute first step is to get Xcode to install the command line tools. Doing that will get the tools into /usr/bin - which is already in your PATH. Go to "Xcode" :: "Preferences" :: "Downloads" :: "Components" where there should be an install Command Line Tools. If there isn't, go to "Xcode" :: "Open Developer Tool" :: "More Developer Tools" and download the most recent command line tools.

Nihil answered 27/12, 2012 at 23:17 Comment(0)
A
0

As you are using Xcode 7, the libtool is located in the following path:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool

What you can do here is simply copy it, and then paste it to the error's specified location:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/libtool

You should also paste the file in the following path if you are planing to run the app on a device:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/libtool

if you didn't find the usr/bin just create a folder and call it usr, and another one inside it and call it bin. the paste the libtool inside it.

Ardys answered 7/4, 2016 at 12:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.