Some more documentation updates and cleanups

This commit is contained in:
Andreas Linde 2012-08-10 18:04:46 +02:00
parent 0f9898b811
commit 1cf64b936e
4 changed files with 313 additions and 160 deletions

View File

@ -24,7 +24,10 @@ This document contains the following sections:
2. Extract the .zip archive.
3. Copy HockeyApp to your Application folder.
4. Start HockeyApp.
5. If this is your first start, the app automatically shows the Preferences dialog: ![Preferences](HockeyMacGeneral_normal.png)
5. If this is your first start, the app automatically shows the Preferences dialog:
<img src="HockeyMacGeneral_normal.png"/>
6. You need to enter your HockeyApp API token. If you don't have one, then create one [here](https://rink.hockeyapp.net/manage/auth_tokens).
7. Close the dialog and you're ready to go.
@ -36,7 +39,9 @@ This document contains the following sections:
3. Expand `Archive`.
4. Select `Post-actions`.
5. Click the `+` in the lower left corner of the right pane and select `New Run Script Action`.
6. Select your project for the build settings and enter the following command below:<pre>open -a HockeyApp "${ARCHIVE_PATH}"</pre>![Post-action for HockeyMac](http://f.cl.ly/items/0k0B0h1Q1z1e373k0440/XcodePostActionsForHockeyMac.png)
6. Select your project for the build settings and enter the following command below:<pre>open -a HockeyApp "${ARCHIVE_PATH}"</pre>
<img src="XcodeArchivePostAction_normal.png"/>
7. Confirm with `OK`.
If you now build your product with Build & Archive and the build was successful, the .xcarchive is automatically opened with HockeyMac. You can enter your release notes and then HockeyMac creates and uploads both the .ipa and the .dSYM file. Please note that you have to configure the correct provisioning profile for AdHoc distribution in the build configuration that you use for Build & Archive.
@ -61,9 +66,9 @@ You can specify the following command line options:
* setBeta - set release type to 'beta'
* setLive - set release type to 'live'
* tags - only allow users who are tagged by these tags to download the app (restrict downloads)
* token - use this api token instead of the one configured in settings
* token - use this api token instead of the one configured in settings.
Please note that the command line options are passed to the app only at the first start. If the HockeyMac is already running, it will not consider any new arguments.
Please note that the command line options are passed to the app only at the first start. If the HockeyMac is already running, it will not consider any new arguments. In addition upload only tokens cause the app _NOT_ to be downloadable and notifications will _NOT_ be send.
Example:

View File

@ -0,0 +1,178 @@
## Introduction
This article describes how to integrate HockeyApp into your iOS apps using a Git submodule and Xcode subprojects. 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](#requirements)
- [Set up Git submodule](#download)
- [Set up Xcode](#xcode)
- [Modify Code](#modify)
- [Submit the UDID](#udid)
- [Mac Desktop Uploader](#mac)
- [Xcode Documentation](#documentation)
<a id="requirements"></a>
## Requirements
The SDK runs on devices with iOS 4.0 or higher.
If you need support for iOS 3.x, please check out [HockeyKit](http://support.hockeyapp.net/kb/client-integration/beta-distribution-on-ios-hockeykit) and [QuincyKit](http://support.hockeyapp.net/kb/client-integration/crash-reporting-on-ios-quincykit)
<a id="download"></a>
## Set up Git submodule
1. Open a Terminal window
2. Change to your projects directory `cd /path/to/MyProject'
3. If this is a new project, initialize Git: `git init`
4. Add the submodule: `git submodule add git://github.com/BitStadium/HockeySDK-iOS.git Vendor/HockeySDK`. This would add the submdolue into the `Vendor/HockeySDK` subfolder. Change this to the folder you prefer.
<a id="xcode"></a>
## Set up Xcode
1. Find the `HockeySDK.xcodeproj` file inside of the cloned HockeySDK-iOS project directory.
2. Drag & Drop it into the `Project Navigator` (⌘+1).
3. Select your project in the `Project Navigator` (⌘+1).
4. Select your target.
5. Select the tab `Build Phases`.
6. Expand `Target Dependencies`.
7. Add the following dependencies:
* `HockeySDKLib`
* `HockeySDKResources`
<img src="XcodeTargetDependencies_normal.png"/>
8. Expand `Link Binary With Libraries`.
9. Add `libHockeySDK.a`
<img src="XcodeLinkBinariesLib_normal.png"/>
10. Drag & Drop `CrashReporter.framework` from the `Frameworks` folder in `HockeySDK.xcodeproj`
<img src="XcodeLinkBinariesPLCrashReporter_normal.png"/>
11. The following entries should be present:
* `CrashReporter.framework`
* `libHockeySDK.a`
* `CoreGraphics.framework`
* `Foundation.framework`
* `QuartzCore.framework`
* `SystemConfiguration.framework`
* `UIKit.framework`
<img src="XcodeFrameworks2_normal.png"/>
12. Expand `Copy Bundle Resources`.
13. Drag & Drop `HockeySDKResources.bundle` from the `Products` folder in `HockeySDK.xcodeproj`
14. Select `Build Settings`
15. In `Header Search Paths`, add a path to `$(SRCROOT)\Vendor\HockeyKit\Classes`
<img src="XcodeHeaderSearchPath_normal.png"/>
16. Search for `Other Linker Flags`
17. Double click on the build Setting titled Other Linker Flags.
18. Add `-ObjC`
<img src="XcodeOtherLinkerFlags_normal.png"/>
19. Hit `Done`.
20. HockeySDK-iOS also needs a JSON library. If you deployment target iOS >= 5, everything is set. If your deployment target is iOS 4.x, please include one of the following libraries:
* [JSONKit](https://github.com/johnezang/JSONKit)
* [SBJSON](https://github.com/stig/json-framework)
* [YAJL](https://github.com/gabriel/yajl-objc)
<a id="modify"></a>
## Modify Code
1. Open your `AppDelegate.m` file.
2. Add the following line at the top of the file below your own #import statements:
#import "HockeySDK.h"
3. Let the AppDelegate implement the protocols `BITHockeyManagerDelegate`, `BITUpdateManagerDelegate` and `BITCrashManagerDelegate`:
@interface AppDelegate() <BITHockeyManagerDelegate, BITUpdateManagerDelegate, BITCrashManagerDelegate> {}
@end
4. Search for the method `application:didFinishLaunchingWithOptions:`
5. Add the following lines:
[[BITHockeyManager sharedHockeyManager] configureWithBetaIdentifier:@"BETA_IDENTIFIER"
liveIdentifier:@"LIVE_IDENTIFIER"
delegate:self];
[[BITHockeyManager sharedHockeyManager] startManager];
6. Replace `BETA_IDENTIFIER` with 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](http://support.hockeyapp.net/kb/how-tos/how-to-find-the-app-identifier).
7. Replace `LIVE_IDENTIFIER` with the app identifier of your release app.
<a id="udid"></a>
## Submit the UDID
If you only want crash reporting, you can skip this step. If you want to use HockeyApp for beta distribution and analyze which testers have installed your app, you need to implement an additional delegate method in your AppDelegate.m:
#pragma mark - BITUpdateManagerDelegate
- (NSString *)customDeviceIdentifierForUpdateManager:(BITUpdateManager *)updateManager {
#ifndef CONFIGURATION_AppStore
if ([[UIDevice currentDevice] respondsToSelector:@selector(uniqueIdentifier)])
return [[UIDevice currentDevice] performSelector:@selector(uniqueIdentifier)];
#endif
return nil;
}
The method only returns the UDID when the build is not targeted to the App Sore. This assumes that a preprocessor macro name CONFIGURATION_AppStore exists and is set for App Store builds. You can define the macro as follows:
1. Select your project in the `Project Navigator` (⌘+1).
2. Select your target.
3. Select the tab `Build Settings`.
4. Search for `preprocessor macros`
![XcodeMacros1_normal.png](XcodeMacros1_normal.png)
5. Select the top-most line and double-click the value field.
6. Click the + button.
7. Enter the following string into the input field and finish with "Done".<pre><code>CONFIGURATION_$(CONFIGURATION)</code></pre>
![XcodeMacros2_normal.png](XcodeMacros2_normal.png)
Now you can use `#if defined (CONFIGURATION_AppStore)` statements in your code. If your configurations have different names, please adjust the above use of `CONFIGURATION_AppStore`.
<a id="mac"></a>
## Mac Desktop Uploader
The Mac Desktop Uploader can provide easy uploading of your app versions to HockeyApp. Check out the [installation tutorial](Guide-Installation-Mac-App).
<a id="documentation"></a>
## Xcode Documentation
This documentation provides integrated help in Xcode for all public APIs and a set of additional tutorials and HowTos.
1. Download the latest [HockeySDK-iOS documentation](https://github.com/bitstadium/HockeySDK-iOS/downloads).
2. Unzip the file. A new folder `HockeySDK-iOS-documentation` is created.
3. Copy the content into ~`/Library/Developer/Shared/Documentation/DocSet`

View File

@ -1,197 +1,166 @@
## Introduction
It is possible to install HockeySDK either using a [binary framework distribution](#framework) or as a [Xcode subproject](#subproject). While a binary distribution is a little easier to integrate and doesn't need to be compiled again, using a subproject allows you to debug through the code and make individual changes.
This article describes how to integrate HockeyApp into your iOS apps. 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:
- [Prerequisites](#prerequisites)
- [Installation with binary framework distribution](#framework)
- [Installation as subproject](#subproject)
- [Setup HockeySDK](#setup)
- [Requirements](#requirements)
- [Download & Extract](#download)
- [Set up Xcode](#xcode)
- [Modify Code](#modify)
- [Submit the UDID](#udid)
- [Mac Desktop Uploader](#mac)
- [Xcode Documentation](#documentation)
<a id="prerequisites"></a>
## Prerequisites
<a id="requirements"></a>
## Requirements
1. Before you integrate HockeySDK into your own app, you should add the app to HockeyApp if you haven't already. Read [this how-to](http://support.hockeyapp.net/kb/how-tos/how-to-create-a-new-app) on how to do it.
2. We also assume that you already have a project in Xcode and that this project is opened in Xcode 4.
3. The SDK supports iOS 4.0 or newer.
4. Make sure any other crash reporting framework or exception handler is **disabled**!
5. Make sure previous versions of `PLCrashReporter` is removed! Search for `CrashReporter.framework` in your Project navigator.
The SDK runs on devices with iOS 4.0 or higher.
<a id="framework"></a>
## Installation with binary framework distribution
If you need support for iOS 3.x, please check out [HockeyKit](http://support.hockeyapp.net/kb/client-integration/beta-distribution-on-ios-hockeykit) and [QuincyKit](http://support.hockeyapp.net/kb/client-integration/crash-reporting-on-ios-quincykit)
### Download & Extract
<a id="download"></a>
## Download & Extract
1. Download the latest [HockeySDK-iOS](https://github.com/bitstadium/HockeySDK-iOS/downloads) framework.
2. Unzip the file. A new folder `HockeySDK-iOS` is created.
3. Move the folder into your project directory. We usually put 3rd-party code into a subdirectory named `Vendor`, so we move the directory into it.
### Integrate into Xcode
<a id="xcode"></a>
## Set up Xcode
1. Drag & drop the `HockeySDK-iOS` folder from your project directory to your Xcode project.
2. Similar to above, our projects have a group `Vendor`, so we drop it there.
3. Select `Create groups for any added folders` and set the checkmark for your target. Then click `Finish`.
![XcodeCreateGroups_normal.png](XcodeCreateGroups_normal.png)
4. Select your project in the `Project Navigator` (⌘+1).
5. Select your target.
6. Select the tab `Summary`.
7. Expand `Link Binary With Libraries`.
8. The following entries should be present:
* `CrashReporter.framework`
* `HockeySDK.framework`
* `CoreGraphics.framework`
* `Foundation.framework`
* `QuartzCore.framework`
* `SystemConfiguration.framework`
* `UIKit.framework`
* CoreGraphics.framework
* CrashReporter.framework
* Foundation.framework
* HockeySDK.framework
* QuartzCore.framework
* SystemConfiguration.framework
* UIKit.framework
![XcodeFrameworks1.png](XcodeFrameworks1_normal.png)
<img src="XcodeFrameworks1_normal.png"/>
9. If one of the frameworks is missing, then click the + button, search the framework and confirm with the `Add` button.
10. Select `Build Phases`
11. The following entries should be present:
* `HockeySDKResources.bundle`
<img src="XcodeCopyBundle1_normal.png"/>
12. Select `Build Settings`
13. Search for `Other Linker Flags`
14. Double click on the build Setting titled Other Linker Flags.
15. Add `-ObjC`
11. Expand `Copy Bundle Resources`.
<img src="XcodeOtherLinkerFlags_normal.png"/>
12. The following entries should be present:
* `HockeySDKResources.bundle`
![XcodeCopyBundle1.png](XcodeCopyBundle1_normal.png)
16. Hit `Done`.
17. Search for `preprocessor macros`
13. Select `Build Settings`
<img src="XcodeMacros1_normal.png"/>
14. Search for `Other Linker Flags`
18. Select the top-most line and double-click the value field.
19. Click the + button.
20. Enter the following string into the input field and finish with "Done".<pre><code>CONFIGURATION_$(CONFIGURATION)</code></pre>
15. Double click on the build setting titled `Other Linker Flags`.
<img src="XcodeMacros2_normal.png"/>
16. Add `-ObjC`
![XcodeOtherLinkerFlags_normal.png](XcodeOtherLinkerFlags_normal.png)
Now you can use `#if defined (CONFIGURATION_ABCDEF)` directives in your code, where `ABCDEF` is the actual name of **YOUR** build configuration.
21. HockeySDK-iOS also needs a JSON library. If you deployment target iOS >= 5, everything is set. If your deployment target is iOS 4.x, please include one of the following libraries:
* [JSONKit](https://github.com/johnezang/JSONKit)
* [SBJSON](https://github.com/stig/json-framework)
* [YAJL](https://github.com/gabriel/yajl-objc)
22. If you haven't installed `HockeyMac` desktop uploader, we highly recommend to follow the [installation instructions](Guide-Installation-Mac-App) to automatically invoke the uploader every time you archive a build
23. Select `Product` > `Edit Scheme`.
24. Expand `Archive`.
25. Select `Post-actions`.
26. Click the `+` in the lower left corner of the right pane and select `New Run Script Action`.
27. Select your project for the build settings and enter the following command below:<pre>open -a HockeyApp "${ARCHIVE_PATH}"</pre>![Post-action for HockeyMac](XcodeArchivePostAction_normal.png)
28. Confirm with `OK`.
17. HockeySDK-iOS needs a JSON library if your deployment target is iOS 4.x. Please include one of the following libraries:
* [JSONKit](https://github.com/johnezang/JSONKit)
* [SBJSON](https://github.com/stig/json-framework)
* [YAJL](https://github.com/gabriel/yajl-objc)
<a id="subproject"></a>
## Installation as subproject
### Add the source as a Git Submodule
1. Open a Terminal window
2. Change to your projects directory `cd /path/to/MyProject'
3. If this is a new project, initialize Git: `git init`
4. Add the submodule: `git submodule add git://github.com/BitStadium/HockeySDK-iOS.git Vendor/HockeySDK`. This would add the submdolue into the `Vendor/HockeySDK` subfolder. Change this to the folder you prefer.
### Add HockeySDK to your project
1. Find the `HockeySDK.xcodeproj` file inside of the cloned HockeySDK-iOS project directory.
2. Drag & Drop it into the `Project Navigator` (⌘+1).
3. Select your project in the `Project Navigator` (⌘+1).
4. Select your target.
5. Select the tab `Build Phases`.
6. Expand `Target Dependencies`.
7. Add the following dependencies:
* `HockeySDKLib`
* `HockeySDKResources`
<img src="XcodeTargetDependencies_normal.png"/>
8. Expand `Link Binary With Libraries`.
9. Add `libHockeySDK.a`
<img src="XcodeLinkBinariesLib_normal.png"/>
10. Drag & Drop `CrashReporter.framework` from the `Frameworks` folder in `HockeySDK.xcodeproj`
<img src="XcodeLinkBinariesPLCrashReporter_normal.png"/>
11. The following entries should be present:
* `CrashReporter.framework`
* `libHockeySDK.a`
* `CoreGraphics.framework`
* `Foundation.framework`
* `QuartzCore.framework`
* `SystemConfiguration.framework`
* `UIKit.framework`
<img src="XcodeFrameworks2_normal.png"/>
12. Expand `Copy Bundle Resources`.
13. Drag & Drop `HockeySDKResources.bundle` from the `Products` folder in `HockeySDK.xcodeproj`
14. Select `Build Settings`
15. In `Header Search Paths`, add a path to `$(SRCROOT)\Vendor\HockeyKit\Classes`
<img src="XcodeHeaderSearchPath_normal.png"/>
16. Search for `Other Linker Flags`
17. Double click on the build Setting titled Other Linker Flags.
18. Add `-ObjC`
<img src="XcodeOtherLinkerFlags_normal.png"/>
19. Hit `Done`.
20. Search for `preprocessor macros`
<img src="XcodeMacros1_normal.png"/>
21. Select the top-most line and double-click the value field.
22. Click the + button.
23. Enter the following string into the input field and finish with "Done".<pre><code>CONFIGURATION_$(CONFIGURATION)</code></pre>
<img src="XcodeMacros2_normal.png"/>
Now you can use `#if defined (CONFIGURATION_ABCDEF)` directives in your code, where `ABCDEF` is the actual name of **YOUR** build configuration.
24. HockeySDK-iOS also needs a JSON library. If you deployment target iOS >= 5, everything is set. If your deployment target is iOS 4.x, please include one of the following libraries:
* [JSONKit](https://github.com/johnezang/JSONKit)
* [SBJSON](https://github.com/stig/json-framework)
* [YAJL](https://github.com/gabriel/yajl-objc)
25. If you haven't installed `HockeyMac` desktop uploader, we highly recommend to follow the [installation instructions](Guide-Installation-Mac-App) to automatically invoke the uploader every time you archive a build
26. Select `Product` > `Edit Scheme`.
27. Expand `Archive`.
28. Select `Post-actions`.
29. Click the `+` in the lower left corner of the right pane and select `New Run Script Action`.
30. Select your project for the build settings and enter the following command below:<pre>open -a HockeyApp "${ARCHIVE_PATH}"</pre>![Post-action for HockeyMac](XcodeArchivePostAction_normal.png)
31. Confirm with `OK`.
<a id="setup"></a>
## Setup HockeySDK
<a id="modify"></a>
## Modify Code
1. Open your `AppDelegate.m` file.
2. Add the following line at the top of the file below your own #import statements:<pre><code>#import "HockeySDK.h"</code></pre>
3. Let the AppDelegate implement the protocols `BITHockeyManagerDelegate`, `BITUpdateManagerDelegate` and `BITCrashManagerDelegate`:<pre><code>@interface AppDelegate() &lt;BITHockeyManager, BITUpdateManager, BITCrashManager&gt; {}
@end</code></pre>
2. Add the following line at the top of the file below your own #import statements:
#import "HockeySDK.h"
3. Let the AppDelegate implement the protocols `BITHockeyManagerDelegate`, `BITUpdateManagerDelegate` and `BITCrashManagerDelegate`:
@interface AppDelegate() <BITHockeyManagerDelegate, BITUpdateManagerDelegate, BITCrashManagerDelegate> {}
@end
4. Search for the method `application:didFinishLaunchingWithOptions:`
5. Add the following lines:<pre><code>[[BITHockeyManager sharedHockeyManager] configureWithBetaIdentifier:@"BETA_IDENTIFIER"
liveIdentifier:@"LIVE_IDENTIFIER"
delegate:self];
[[BITHockeyManager sharedHockeyManager].updateManager setDelegate:self];
[[BITHockeyManager sharedHockeyManager].crashManager setDelegate:self];
[[BITHockeyManager sharedHockeyManager] startManager];</code></pre>
5. Add the following lines:
[[BITHockeyManager sharedHockeyManager] configureWithBetaIdentifier:@"BETA_IDENTIFIER"
liveIdentifier:@"LIVE_IDENTIFIER"
delegate:self];
[[BITHockeyManager sharedHockeyManager] startManager];
6. Replace `BETA_IDENTIFIER` with 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](http://support.hockeyapp.net/kb/how-tos/how-to-find-the-app-identifier).
7. Replace `LIVE_IDENTIFIER` with the app identifier of your release app.
8. Add the following method:<pre><code>- (NSString \*)customDeviceIdentifierForUpdateManager:(BITUpdateManager \*)updateManager {
\#ifndef CONFIGURATION_AppStore
if ([[UIDevice currentDevice] respondsToSelector:@selector(uniqueIdentifier)])
return [[UIDevice currentDevice] performSelector:@selector(uniqueIdentifier)];
\#endif
return nil;
}</code></pre>This assumes that the Xcode build configuration used for App Store builds is named `AppStore`. Repleace this string with the appropriate Xcode configuration name.
9. If you have added the lines to `application:didFinishLaunchingWithOptions:`, you should be ready to go. If you do some GCD magic or added the lines at a different place, please make sure to invoke the above code on the main thread.
<a id="udid"></a>
## Submit the UDID
If you only want crash reporting, you can skip this step. If you want to use HockeyApp for beta distribution and analyze which testers have installed your app, you need to implement an additional delegate method in your AppDelegate.m:
#pragma mark - BITUpdateManagerDelegate
- (NSString *)customDeviceIdentifierForUpdateManager:(BITUpdateManager *)updateManager {
#ifndef CONFIGURATION_AppStore
if ([[UIDevice currentDevice] respondsToSelector:@selector(uniqueIdentifier)])
return [[UIDevice currentDevice] performSelector:@selector(uniqueIdentifier)];
#endif
return nil;
}
The method only returns the UDID when the build is not targeted to the App Sore. This assumes that a preprocessor macro name CONFIGURATION_AppStore exists and is set for App Store builds. You can define the macro as follows:
1. Select your project in the `Project Navigator` (⌘+1).
2. Select your target.
3. Select the tab `Build Settings`.
4. Search for `preprocessor macros`
![XcodeMacros1_normal.png](XcodeMacros1_normal.png)
5. Select the top-most line and double-click the value field.
6. Click the + button.
7. Enter the following string into the input field and finish with "Done".<pre><code>CONFIGURATION_$(CONFIGURATION)</code></pre>
![XcodeMacros2_normal.png](XcodeMacros2_normal.png)
Now you can use `#if defined (CONFIGURATION_AppStore)` statements in your code. If your configurations have different names, please adjust the above use of `CONFIGURATION_AppStore`.
<a id="mac"></a>
## Mac Desktop Uploader
The Mac Desktop Uploader can provide easy uploading of your app versions to HockeyApp. Check out the [installation tutorial](Guide-Installation-Mac-App).
<a id="documentation"></a>
## Xcode Documentation
This documentation provides integrated help in Xcode for all public APIs and a set of additional tutorials and HowTos.
1. Download the latest [HockeySDK-iOS documentation](https://github.com/bitstadium/HockeySDK-iOS/downloads).
2. Unzip the file. A new folder `HockeySDK-iOS-documentation` is created.
3. Copy the content into ~`/Library/Developer/Shared/Documentation/DocSet`

View File

@ -23,6 +23,7 @@ The main SDK class is `BITHockeyManager`. It initializes all modules and provide
## Guides
- [Installation & Setup](Guide-Installation-Setup)
- [Installation & Setup Advanced](Guide-Installation-Setup-Advanced) (Using Git submodule and Xcode sub-project)
- [Migration from HockeyKit & QuincyKit](Guide-Migration-Kits)
- [Mac Desktop Uploader](Guide-Installation-Mac-App)