6.2 KiB
Version 3.5.0b3
Introduction
This article describes how to integrate HockeyApp into your iOS apps using a Git submodule and Xcode sub-projects. The SDK allows testers to update your app to another beta version right from within the application. It will notify the tester if a new update is available. The SDK also allows to send crash reports. If a crash has happened, it will ask the tester on the next start whether he wants to send information about the crash to the server.
This document contains the following sections:
Requirements
The SDK runs on devices with iOS 5.0 or higher.
Set up Git submodule
-
Open a Terminal window
-
Change to your projects directory `cd /path/to/MyProject'
-
If this is a new project, initialize Git:
git init -
Add the submodule:
git submodule add git://github.com/bitstadium/HockeySDK-iOS.git Vendor/HockeySDK. This would add the submodule into theVendor/HockeySDKsubfolder. Change this to the folder you prefer. -
Releases are always in the
masterbranch while thedevelopbranch provides the latest in development source code (Using the git flow branching concept). We recommend using themasterbranch!
Set up Xcode
-
Find the
HockeySDK.xcodeprojfile inside of the cloned HockeySDK-iOS project directory. -
Drag & Drop it into the
Project Navigator(⌘+1). -
Select your project in the
Project Navigator(⌘+1). -
Select your target.
-
Select the tab
Build Phases. -
Expand
Link Binary With Libraries. -
Add
libHockeySDK.a
-
Select
Add Other.... -
Select
CrashReporter.frameworkfrom theVendor/HockeySDK/Vendorfolder
-
Expand
Copy Bundle Resource. -
Drag
HockeySDKResources.bundlefrom theHockeySDKsub-projectsProductsfolder and drop into theCopy Bundle Resourcesection -
Select
Build Settings -
Add the following
Header Search Path$(SRCROOT)/Vendor/HockeySDK/Classes -
Create a new
Project.xcconfigfile, if you don't already have one (You can give it any name)Note: You can also add the required frameworks manually to your targets
Build Phasesan continue with step17.instead.a. Select your project.
b. Select the tab
Info.c. Expand
Configurations.d. Select
Project.xcconfigfor all your configurations<img src="XcodeFrameworks1_normal.png"/> -
Open
Project.xcconfigin the editor -
Add the following line:
#include "../Vendor/HockeySDK/Support/HockeySDK.xcconfig"(Adjust the path depending where the
Project.xcconfigfile is located related to the Xcode project package)Important note: Check if you overwrite any of the build settings and add a missing
$(inherited)entry on the projects build settings level, so theHockeySDK.xcconfigsettings will be passed through successfully. -
If you are getting build warnings, then the
.xcconfigsetting wasn't included successfully or its settings inOther Linker Flagsget ignored because$(interited)is missing on project or target level. Either add$(inherited)or link the following frameworks manually inLink Binary With LibrariesunderBuild Phases:CoreTextCoreGraphicsFoundationQuartzCoreSecuritySystemConfigurationUIKit
Modify Code
-
Open your
AppDelegate.mfile. -
Add the following line at the top of the file below your own #import statements:
#import "HockeySDK.h" -
Let the AppDelegate implement the protocols
BITHockeyManagerDelegate:@interface AppDelegate(HockeyProtocols) <BITHockeyManagerDelegate> {} @end -
Search for the method
application:didFinishLaunchingWithOptions: -
Add the following lines:
[[BITHockeyManager sharedHockeyManager] configureWithBetaIdentifier:@"BETA_IDENTIFIER" liveIdentifier:@"LIVE_IDENTIFIER" delegate:self]; [[BITHockeyManager sharedHockeyManager] startManager]; -
Replace
BETA_IDENTIFIERwith the app identifier of your beta app. If you don't know what the app identifier is or how to find it, please read this how-to. -
Replace
LIVE_IDENTIFIERwith the app identifier of your release app. We suggest to setup different apps on HockeyApp for your test and production builds. You usually will have way more test versions, but your production version usually has way more crash reports. This helps to keep data separated, getting a better overview and less trouble setting the right app versions downloadable for your beta users.
Note: The SDK is optimized to defer everything possible to a later time while making sure e.g. crashes on startup can also be caught and each module executes other code with a delay some seconds. This ensures that applicationDidFinishLaunching will process as fast as possible and the SDK will not block the startup sequence resulting in a possible kill by the watchdog process.
Mac Desktop Uploader
The Mac Desktop Uploader can provide easy uploading of your app versions to HockeyApp. Check out the installation tutorial.
Xcode Documentation
This documentation provides integrated help in Xcode for all public APIs and a set of additional tutorials and HowTos.
-
Download the HockeySDK-iOS documentation.
-
Unzip the file. A new folder
HockeySDK-iOS-documentationis created. -
Copy the content into ~
/Library/Developer/Shared/Documentation/DocSet
The documentation is also available via the following URL: http://hockeyapp.net/help/sdk/ios/3.5.0b3/