Documentation improvements and automated build

- Add a target for building HTML and DocSet documentation
- The build will automatically install the DocSet locally
- Update README file
- Include README content as the main documentation page
- Ignore the Docs path, where documentation will be built into
This commit is contained in:
Andreas Linde 2012-07-22 18:30:11 +02:00
parent 164369c742
commit 5f16eeb0a3
3 changed files with 98 additions and 78 deletions

2
.gitignore vendored
View File

@ -18,3 +18,5 @@ profile
*.swp
*~.nib
profile
Docs/

115
README.md
View File

@ -1,13 +1,18 @@
This document describes how to integrate the HockeyApp SDK into your app. The SDK has two main features:
## Introduction
HockeySDK-iOS implements support for using HockeyApp in your iOS applications.
The following features are currently supported:
1. **Update apps:** The app will check with HockeyApp if a new version is available. If yes, it will show an alert view to the user and let him see the release notes, the version history and start the installation process right away.
2. **Collect crash reports:** If you app crashes, a crash log with the same format as from the Apple Crash Reporter is written to the device's storage. If the user starts the app again, he is asked to submit the crash report to HockeyApp. This works for both beta and live apps, i.e. those submitted to the App Store!
The main SDK class is `BITHockeyManager`. It initializes all modules and provides access to them, so they can be further adjusted if required. Additionally all modules provide their own protocols.
## Prerequisites
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.
## Versioning
@ -15,41 +20,33 @@ This document describes how to integrate the HockeyApp SDK into your app. The SD
We suggest to handle beta and release versions in two separate *apps* on HockeyApp with their own bundle identifier (e.g. by adding "beta" to the bundle identifier), so
* both apps can run on the same device or computer at the same time without interfering,
* release versions do not appear on the beta download pages, and
* easier analysis of crash reports and user feedback.
We propose the following method to set version numbers in your beta versions:
* Use both "Bundle Version" and "Bundle Version String, short" in your Info.plist.
* Use both `Bundle Version` and `Bundle Version String, short` in your Info.plist.
* "Bundle Version" should contain a sequential build number, e.g. 1, 2, 3.
* "Bundle Version String, short" should contain the target official version number, e.g. 1.0.
## Download & Extract
1. Download the latest [HockeySDK](https://github.com/codenauts/HockeySDK-iOS/downloads).
1. Download the latest [HockeySDK-iOS](https://github.com/bitstadium/HockeySDK-iOS/downloads).
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.
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
Drag & drop the HockeySDK folder from your project directory to your Xcode project. Similar to above, our projects have a group "Vendor", so we drop it there. Select "Create groups for any added folders" and set the checkmark for your target. Then click "Finish".
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`.
## Add Frameworks
1. Select your project in the Project Navigator.
2. Select your target.
3. Select the tab "Build Phases".
4. Expand "Link Binary With Libraries".
3. Select the tab `Build Phases`.
4. Expand `Link Binary With Libraries`.
5. You need all of the following frameworks:
* CoreGraphics.framework
@ -59,81 +56,51 @@ Drag & drop the HockeySDK folder from your project directory to your Xcode proje
* SystemConfiguration.framework
* UIKit.framework
6. If one of the frameworks is missing, then click the + button, search the framework and confirm with the "Add" button.
7. HockeySDK also needs a JSON library. If you target iOS 5, you can use the built-in NSJSONSerialization classes. If your deployment target is iOS 3.x or 4.x, please include one of the following libraries:
6. If one of the frameworks is missing, then click the + button, search the framework and confirm with the `Add` button.
7. HockeySDK-iOS also needs a JSON library. If you target iOS 5, you can use the built-in `NSJSONSerialization` classes. If your deployment target is iOS 3.x or 4.x, please include one of the following libraries:
* https://github.com/johnezang/JSONKit
* https://github.com/stig/json-framework
* https://github.com/gabriel/yajl-objc
## Modify Source Code
## Setup HockeySDK-iOS
1. Open your AppDelegate.h file.
2. Add the following line at the top of the file below your own #import statements:<pre><code>#import "CNSHockeyManager.h"</code></pre>
3. Let the AppDelegate implement the protocol CNSHockeyManagerDelegate:<pre><code>@interface AppDelegate : UIResponder &lt;CNSHockeyManagerDelegate, UIApplicationDelegate>
</code></pre>
4. Search for the method application:didFinishLaunchingWithOptions:
5. Open your AppDelegate.m file.
6. Add the following lines:<pre><code>[[CNSHockeyManager sharedHockeyManager] configureWithBetaIdentifier:@"BETA_IDENTIFIER"
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 `BITHockeyManager`, `BITUpdateManager` and `BITCrashManager`:<pre><code>@interface AppDelegate() &lt;BITHockeyManager, BITUpdateManager, BITCrashManager&gt; {}
@end</code></pre>
4. Search for the method `application:didFinishLaunchingWithOptions:`
5. Add the following lines:<pre><code>[[BITHockeyManager sharedHockeyManager] configureWithBetaIdentifier:@"BETA_IDENTIFIER"
liveIdentifier:@"LIVE_IDENTIFIER"
delegate:self];</code></pre>
7. 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).
8. Replace LIVE_IDENTIFIER with the app identifier of your release app.
9. Add the following method:<pre><code>-(NSString *)customDeviceIdentifier {
\#ifdef BETA_BUILD
delegate:self];
[[BITHockeyManager sharedHockeyManager] startManager];</code></pre>
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 precompiler macro BETA_BUILD is set for your ad-hoc builds, but not for store builds.
10. If you have added the lines to the method 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.
## Optional Delegate Methods
Besides the crash log, HockeyApp can show you fields with information about the user and an optional description. You can fill out these fields by implementing the following methods:
* **crashReportUserID** should be a user ID or email, e.g. if your app requires to sign in into your server, you could specify the login here. The string should be no longer than 255 chars. You can also set autoSubmitDeviceUDID to YES, then crashReportUserID will be automatically set to the device's UDID.
* **crashReportContact** should be the user's name or similar. The string should be no longer than 255 chars.
* **crashReportDescription** can be as long as you want it to be and contain additional information about the
crash. For example, you can return a custom log or the last XML or JSON response from your server here.
If you implement these delegate methods and keep them in your live app too, please consider the privacy implications.
}</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.
## Upload the .dSYM File
Once you have your app ready for beta testing or even to submit it to the App Store, you need to upload the .dSYM bundle to HockeyApp to enable symbolication. If you have built your app with Xcode4, menu Product > Archive, you can find the .dSYM as follows:
1. Chose Window > Organizer in Xcode.
Once you have your app ready for beta testing or even to submit it to the App Store, you need to upload the `.dSYM` bundle to HockeyApp to enable symbolication. If you have built your app with Xcode4, menu `Product` > `Archive`, you can find the `.dSYM` as follows:
1. Chose `Window` > `Organizer` in Xcode.
2. Select the tab Archives.
3. Select your app in the left sidebar.
4. Right-click on the latest archive and select `Show in Finder`.
5. Right-click the `.xcarchive` in Finder and select `Show Package Contents`.
6. You should see a folder named dSYMs which contains your dSYM bundle. If you use Safari, just drag this file from Finder and drop it on to the corresponding drop zone in HockeyApp. If you use another browser, copy the file to a different location, then right-click it and choose Compress `YourApp.dSYM`. The file will be compressed as a .zip file. Drag & drop this file to HockeyApp.
4. Right-click on the latest archive and select Show in Finder.
5. Right-click the .xcarchive in Finder and select Show Package Contents.
6. You should see a folder named dSYMs which contains your dSYM bundle. If you use Safari, just drag this file from Finder and drop it on to the corresponding drop zone in HockeyApp. If you use another browser, copy the file to a different location, then right-click it and choose Compress "YourApp.dSYM". The file will be compressed as a .zip file. Drag & drop this file to HockeyApp.
As an alternative for step 5 and 6, you can use our [HockeyMac](https://github.com/codenauts/HockeyMac) app to upload the complete archive in one step.
As an alternative for step 5 and 6, you can use our [HockeyMac](https://github.com/codenauts/HockeyMac) app to upload the complete archive in one step. You can even integrate HockeyMac into Xcode to automatically show the upload interface after archiving your app, which would make all steps 1 to 6 not necessary any more!
## Checklist if Crashes Do Not Appear in HockeyApp
1. Check if the BETA_IDENTIFIER or LIVE_IDENTIFIER matches the App ID in HockeyApp.
1. Check if the `BETA_IDENTIFIER` or `LIVE_IDENTIFIER` matches the App ID in HockeyApp.
2. Check if CFBundleIdentifier in your Info.plist matches the Bundle Identifier of the app in HockeyApp. HockeyApp accepts crashes only if both the App ID and the Bundle Identifier equal their corresponding values in your plist and source code.
3. Unless you have set autoSubmitCrashReport to YES: If your app crashes and you start it again, is the alert shown which asks the user to send the crash report? If not, please crash your app again, then connect the debugger and set a break point in BWQuincyManager.m, method [startManager](https://github.com/codenauts/HockeySDK-iOS/blob/develop/Classes/BWQuincyManager.m#L251) to see why the alert is not shown.
3. Unless you have set `[BITCrashManager setAutoSubmitCrashReport:]` to `YES`: If your app crashes and you start it again, is the alert shown which asks the user to send the crash report? If not, please crash your app again, then connect the debugger and set a break point in `BITCrashManager.m`, method `startManager` to see why the alert is not shown.
4. If it still does not work, please [contact us](http://support.hockeyapp.net/discussion/new).

View File

@ -6,6 +6,20 @@
objectVersion = 46;
objects = {
/* Begin PBXAggregateTarget section */
1E8E66AD15BC3D7700632A2E /* HockeySDK Documentation */ = {
isa = PBXAggregateTarget;
buildConfigurationList = 1E8E66B015BC3D7700632A2E /* Build configuration list for PBXAggregateTarget "HockeySDK Documentation" */;
buildPhases = (
1E8E66B215BC3D8200632A2E /* ShellScript */,
);
dependencies = (
);
name = "HockeySDK Documentation";
productName = Documentation;
};
/* End PBXAggregateTarget section */
/* Begin PBXBuildFile section */
1E01118115BB6311007002AC /* BITUpdateManagerPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E01118015BB62FE007002AC /* BITUpdateManagerPrivate.h */; };
1E01118215BB6314007002AC /* BITCrashManagerPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E01117E15BB6228007002AC /* BITCrashManagerPrivate.h */; };
@ -623,6 +637,7 @@
1E59545515B6C41300A03429 /* HockeySDK-Simulator */,
1E5954CB15B6F24A00A03429 /* HockeySDKLib */,
1E59550915B6F45800A03429 /* HockeySDKResources */,
1E8E66AD15BC3D7700632A2E /* HockeySDK Documentation */,
);
};
/* End PBXProject section */
@ -670,6 +685,19 @@
shellPath = /bin/sh;
shellScript = "FRAMEWORK=\"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework\"\n\nlipo \\\n\"${BUILD_DIR}/${CONFIGURATION}-iphoneos/libHockeySDK-iphoneos.a\" \\\n\"${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/libHockeySDK-iphonesimulator.a\" \\\n-create -output \"${FRAMEWORK}/Versions/Current/${PRODUCT_NAME}\"\n\n# Strip debugging symbols\n#strip -S \"${FRAMEWORK}/Versions/Current/${PRODUCT_NAME}\"\n\ncd \"${FRAMEWORK}\" && ln -sf \"Versions/Current/${PRODUCT_NAME}\" ./\n\nif [ ! -e \"$TARGET_BUILD_DIR/HockeySDK.framework/Frameworks\" ];\nthen\ncd \"$TARGET_BUILD_DIR/HockeySDK.framework\"\nln -s \"Versions/Current/Frameworks\" \"Frameworks\"\nfi";
};
1E8E66B215BC3D8200632A2E /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/usr/local/bin/appledoc --output \"${SOURCE_ROOT}/../Docs\" --ignore Vendor --ignore .m --create-html --create-docset --install-docset --keep-intermediate-file -p HockeySDK-iOS -v \"2.3.0\" -c \"BitStadium GmbH\" --company-id de.bitstadium --docset-platform-family \"iphoneos\" --index-desc \"${SOURCE_ROOT}/../README.md\" --merge-categories --no-repeat-first-par --warn-undocumented-object --warn-undocumented-member --warn-empty-description --warn-unknown-directive --warn-invalid-crossref --warn-missing-arg --logformat xcode --exit-threshold 2 \"${SOURCE_ROOT}/../\"";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
@ -982,6 +1010,20 @@
};
name = Release;
};
1E8E66AE15BC3D7700632A2E /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
1E8E66AF15BC3D7700632A2E /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
E400563C148D79B500EB22B9 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
@ -1131,6 +1173,15 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
1E8E66B015BC3D7700632A2E /* Build configuration list for PBXAggregateTarget "HockeySDK Documentation" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1E8E66AE15BC3D7700632A2E /* Debug */,
1E8E66AF15BC3D7700632A2E /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
E4005614148D79B500EB22B9 /* Build configuration list for PBXProject "HockeySDK" */ = {
isa = XCConfigurationList;
buildConfigurations = (