Using class-dump

Skip to end of metadata
Go to start of metadata

Introduction

Private APIs

Apple exposes several APIs that are public and supported. These APIs are covered in the documentation and promoted by Apple.

There are also many APIs that are not public and used internally by Apple. They are not found in the documentation and are not promoted by Apple. They can be (and have been) removed in the next version of the iPhone OS.

Furthermore, if these private APIs are used by an App that is submitted for AppStore approval, the App will be rejected.

Why Use private APIs?

There are some functions that Apple Apps can do that are not available in the public APIs.

Often, private APIs can provide access to these functions.

What is class-dump and why would you want to use it?

The program class-dump examines the private APIs and generates header files for them.

These header files can them be used by Xcode to access the private APIs.

Getting class-dump

  • Home for class-dump is here:

http://www.codethecode.com/projects/class-dump/

  • There appear to be others forking the code base, but the link above works with 3.x so far (2009-12-05).
  • Downloads are here:

http://www.codethecode.com/download/

  • Changes are here:

http://www.codethecode.com/projects/class-dump/changes.html

Using class-dump

Framework locations

  • The location of the iphone frameworks will change from release to release.
  • In general, the frameworks are found in /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/.
  • For example the path for 3.1.2 the path is:

class-dump usage

  • Typing class-dump with no parameters will print out usage instructions:

Calling class-dump

  • The -H parameter is the framework to scan.
  • The -o parameter is the output directory.
  • To dump the Celestial framework headers to ~/Developer/iPhone/class-dump-iPhone3.1.2-Celestial.framework:
  • NOTE: the above should be on one line, it has been broken up because the paths are very long.

Parsing all the frameworks

  • The above instructions process one library at a time.
  • In order to call on all the frameworks class-dump needs to be called by a script that descends the directory tree.

Perl script

  • There is a Arstechnica article that uses a perl script:

http://arstechnica.com/apple/news/2008/11/dumping-the-iphone-2-2-frameworks.ars

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.