LoginSignup
12
11

More than 5 years have passed since last update.

TestFlightの使い方

Posted at

テスト配信やクラッシュレポート時にとっても便利なTestFlightの使い方。

あとTestFlightのライブラリがAppに入っていると申請リジェクトされるので要注意。
App申請時は下記はコメントアウトしたほうがよい。
([[UIDevice currentDevice] uniqueIdentifier]]も既にリジェクト対象ですね)

1.ヘッダファイルにインポートして
#import "TestFlight.h"

2.didFinishLaunchingWithOptionsに下記を追加
 ///テストフライト
 {
  NSSetUncaughtExceptionHandler(&caughtExceptionHandler);
  // installs HandleExceptions as the Uncaught Exception Handler
  NSSetUncaughtExceptionHandler(&HandleExceptions);
  // create the signal action structure
  struct sigaction newSignalAction;
  // initialize the signal action structure
  memset(&newSignalAction, 0, sizeof(newSignalAction));
  // set SignalHandler as the handler in the signal action structure
  newSignalAction.sa_handler = &SignalHandler;
  // set SignalHandler as the handlers for SIGABRT, SIGILL and SIGBUS
  sigaction(SIGABRT, &newSignalAction, NULL);
  sigaction(SIGILL, &newSignalAction, NULL);
  sigaction(SIGBUS, &newSignalAction, NULL);

  [TestFlight setDeviceIdentifier:[[UIDevice currentDevice] uniqueIdentifier]];
  [TestFlight takeOff:@"トークン"];
 }

3.ついでに下記メソッドも追加しておく。
void caughtExceptionHandler(NSException *exception) {
  TFLog(@"%@, %@",exception, [exception callStackSymbols]);
}
void HandleExceptions(NSException *exception) {
 TFLog(@"This is where we save the application data during a exception, %@ %@",exception, [exception callStackSymbols]);
}
void SignalHandler(int sig) {
 TFLog(@"This is where we save the application data during a signal %d",sig);
}

12
11
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
11