Skip to content
This repository was archived by the owner on May 7, 2025. It is now read-only.

Building and Debugging SDKLauncher iOS

rkwright edited this page Oct 24, 2014 · 1 revision

Build and Runtime Requirements

  • Building the iOS application requires XCode 5 or higher.
  • Running the application requires iOS 6 or higher.

Building the Launcher

Sync to the github repository:

git clone --recursive https://github.com/readium/SDKLauncher-iOS.git

Be sure to use the --recursive tag since this repo, like all the Launchers and Viewers in the Readium projects, uses submodules. Without the --recursive flag, the clone operation will create the submodule folder but not clone its contents.

  • Open the XCode project, SDKLauncher-iOS.xcodeproj
  • Choose the scheme SDKLauncher-iOS -> where is either a simulator or an iOS device
  • Build the workspace, which will build the Core EPUB 3 library, zip-lib and the Launcher itself.

Running the App

Running with the iPad or iPhone simulator is straightforward. Just run the app as you normally would.

Running on an iOS device is slightly more complicated since you need to be both a registered iOS developer and have provisioned the device. Getting a developer’s license is documented here and the process for provisioning a device is documented by Apple here.

Note that there is a Readium developers license, but all contributors are strongly encouraged to get their own license. The Readium license is reserved for those contributors and related folks who for some reason cannot obtain a license and/or build their own apps.

Debugging the App

Debugging the Objective-C Launcher and the C++ Core is straightforward, just like any other XCode application. Debugging into the WebKit instance is a little trickier:

  • First, you should be familiar with the Safari Developer Guide guide.
  • From within XCode, launch the app on the Simulator or your device ** Note that if you use the iPad Retina simulator it will overflow the screen and be hard to debug unless you have an enormous screen
  • Open the target EPUB and navigate to a content page (i.e. a spine item). Until you do this, the WebKit instance won’t be instantiated and Safari won’t see that there is anything to debug
  • Once you have reached the content page, you can launch Safari on OSX (not the iPad).
  • Select the Develop menu and you should see your iOS device as a top-level menu item with a flyout item.
  • The flyout item will have ‘Readium’ in grey with a submenu item that reads ‘localhost reader.html’.
  • Select the submenu item and Safari will open a new window (on the desktop) for the Web Inspector.

In the inspector you can do all the usual web inspector activities, including debugging into the JavaScript, i.e. setting breakpoints, examining variables, etc. Unfortunately, the breakpoints will be lost when the document is closed [if someone knows a better method or how to save the breakpoints, please speak up…]

Clone this wiki locally