Skip to content

Building the NSLogger viewer

fpillet edited this page Aug 1, 2012 · 10 revisions

Building the NSLogger Mac OS X viewer application

You may want to build NSLogger yourself if you’re pulling updates from the git repository or want to help improve NSLogger.

1. Clone the NSLogger GIT repository:

$ git clone git://github.com/fpillet/NSLogger.git

2. Sign your code (one-time setup)

This is optional, but strongly recommended. Signing the application will allow smooth operation of the SSL connections. If the application is not signed, two things will happen (when the Mac OS X firewall is turned on, which should be the case for everyone who cares about security):

  • The first time you start the app, you’ll see the “Accept connections” confirmation dialog (put up by the firewall)
  • Incoming SSL connections will fail
  • You’ll get a dialog (put up by NSLogger) telling you it needs to restart to complete SSL setup
  • Upon restarting, and when the first SSL connection comes it, you’ll get an authorization dialog

This is due to a complicated issue involving both Keychain and the Firewall signing the app themselves with different keys, since it was not signed in the first place. Apple has a technote that describes how this all works. To prevent this issue, you’ll want to codesign the build.

To codesign the build, you need a certificate. All iOS developers (and Mac developers registered with the Mac developer program) have one. If you don’t have a certificate, Apple provides detailed instructions on how to generate a self-signed one.

Once you have your certificate installed in the Keychain (iOS Developer Program and Mac Developer Program members should already by all set), do the following in the NSLogger project:

  • Double-click the NSLogger project entry at top-left of the Xcode project window
  • Select the Build tab
  • Make sure the pop-up menu is set to “All Configurations”
  • Scroll-down to the Code Signing section
  • Click the Code Signing Identity field, select your identity from the popup

This will automatically sign every build you make with your identity.

For the time being, every time there is a project update (.xcodeproj) from the repo, you’ll have to redo the above steps. The NSLogger target has a pre-build step which checks whether a codesign identity has been set, and warns you if not. If you don’t want to sign your code, you can just remove this step.

3. Build and run.

Once you are done, simply open the NSLogger/Desktop Viewer/NSLogger.xcodeproj project, then Build & Run it.

If Xcode complains about BWToolkit.framework missing when linking NSLogger, configure your Xcode to build all products in a common build directory (in Xcode, open the Xcode Preferences > Building tab, then set “Place Build Products In:” to use a Customized Location). This issue will be fixed soon.