12

There was an Apple-customized version of pngcrush in every version of Xcode before 4.3. I can't find it in Xcode 4.3. Is it still available as a standalone exe file?

Another related question: where are the files from Command Line Tools for Xcode installed?

an0
  • 17,191
  • 12
  • 86
  • 136

4 Answers4

20

The best way to find it is to use the xcrun tool.

xcrun -sdk iphoneos5.0 -find pngcrush will print the path on stdout while xcrun -sdk iphoneos5.0 pngcrush will actually execute the command for you.

See man xcrun for more info.

honus
  • 799
  • 6
  • 14
  • Glad to help. It is nice because it saves you having to hardcode paths. In theory you shouldn't have to specify the sdk but it wasn't working for me without it. You can use `xcodebuild -showsdks` to get a list of the ones currently installed. – honus Feb 24 '12 at 02:15
  • I wish there are introductions for `Command Line Tools for Xcode` in Xcode docs. – an0 Feb 24 '12 at 02:41
  • 1
    notice that you have to check your `iphoneos` version: mine for exmaple was 5.1 so I did `xcrun -sdk iphoneos5.1 pngcrush` – microspino May 09 '12 at 16:07
5

If you are using app crush.rb with Xcode 4.3, and you get the error:

sh: /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush: No such file or directory

As Yozone said, change the first declaration to:

pngcrush = '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush'

That will point to the new location of the Xcode files.

Michael Douma
  • 1,144
  • 8
  • 21
2

The pngcrush is under /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin

Yozone W.
  • 303
  • 2
  • 18
  • Thanks! Do you know where are the additional `Command Line Tools for Xcode` installed? – an0 Feb 21 '12 at 09:23
  • Here is two ways to install the Command Line Tools for Xcode: 1, Goto "Xcode -> Open Developer Tool -> More Developer Tools", then login and download the "Command Line Tools for Xcode" 2, Goto "Xcode -> Preferences... -> Downloads(tab) -> Components(sub-tab)", then click install button. – Yozone W. Feb 27 '12 at 07:00
1

Starting from Xcode 4.3 they decided to repackage it as a single app bundle. Check this out http://developer.apple.com/library/ios/#documentation/DeveloperTools/Conceptual/WhatsNewXcode/Articles/xcode_4_3.html

Plug-ins, templates and other sub-components. Any path for component additions to developer tools that was previously found in a subdirectory of /Developer is now going to be located internal to the Xcode 4.3 application bundle.

Other standalone utility applications and add-on technologies. Several additional tools are no longer part of the default Xcode installation, they are now downloadable as separate packages. The More Developer Tools menu command provides a direct jump to developer.apple.com/downloads in Safari where these development tools can be found.

So anything missing you might find it inside the app bundle or it'd be an additional download.

iDifferent
  • 2,190
  • 1
  • 14
  • 19