1

次のように仮定します。

  • XCode4 は、プロジェクトを「アーカイブ」し、アドホック プロファイルで署名された app.ipa ファイルを生成するために使用されます
  • アドホック プロファイルは、10 個の異なる iOS デバイスを認識します。これは、app.ipa をテスト用に 10 人にプッシュできることを意味します。
  • ここで、11 番目のデバイスが Apple ポータル経由で Ad-Hoc プロファイルに追加されると、プロファイルが更新されます。

とすれば:

  • 多くのコードが変更されているため、XCode を使用して新しい「アーカイブ」を作成したくありません
  • まったく同じ app.ipa ファイルを取得し、更新プロファイルで再署名して、アドホックな方法で 11 番目のデバイスにもアプリを送信できるようにしたいだけです。

これを達成するために何ができるでしょうか?

  • リポジトリを使用して以前のバージョンのコードをチェックアウトしてから、更新されたプロファイルでアーカイブを使用することはお勧めしません。私はすでにその回避策を認識しており、それよりもはるかに技術的に快適なオプションが必要です

アップデート:

このブログのおかげで: http://blog.futureshock-ed.com/xcode-ad-hock-provisioning-certificate-pains

XCode 4でオーガナイザーを開き、以前にアーカイブしたビルドのいずれかを選択するだけで、app.ipaを再度生成しようとすると、新しくインポートおよび更新されたアドホックプロビジョニングプロファイルを使用してipaを作成できることがわかりましたファイル。

このアクションを実行する前に、更新されたプロビジョニング プロファイルをインポートする方法を教えてください。新しくダウンロードしたプロファイルをダブルクリックし、ポップアップウィンドウで古い兄弟を削除して、両方がMacに座っていることを確認してください. 「作成日」の値を視覚的に調べることで、どちらが古いかを判断できます。

当たり前のことだったのに、なぜかそうではなかった、同じ苦しみに苦しんでいる人が他にどれだけいるのだろうか。

4

1 に答える 1

0

次のようなものが機能するはずです (xcodebuild コマンド ライン ツールを使用してアプリケーションをビルドするために作成したプロジェクトから取得)。

- (BOOL)createSignedIPA:(NSError **)error
{
   [self.delegate builder:self didUpdateStatus:@"creating IPA, please be patient ..."];

   NSTask *task = [[NSTask alloc] init];
   NSString *path = @"/usr/bin/xcrun";
   [task setLaunchPath: path];

   NSString *input = [MOB_PROJECT_DIR stringByExpandingTildeInPath];
   input = [NSString stringWithFormat:@"%@/build/%@-iphoneos/yourapp.app", input, isDemoApp ? @"Debug" : @"Release"]; 

   NSString *output = [@"~/Desktop" stringByExpandingTildeInPath];
   output = [NSString stringWithFormat:@"%@/%@%ld.ipa", output, isDemoApp ? @"demo" : @"app", appIdentifier];

   NSString *bundleIdentifier = [self bundleIdentifier];
   NSString *profile = [self pathForProfileWithBundleIdentifier:bundleIdentifier error:error];   
   if (!profile) 
      if (*error) 
         return NO;
      else 
      {
         NSString *message = [NSString stringWithFormat:@"no profile found for bundle %@", bundleIdentifier];
         NSDictionary *userInfo = [NSDictionary dictionaryWithObject:message forKey:NSLocalizedDescriptionKey];
         *error = [NSError errorWithDomain:MOB_APP_DOMAIN code:MOB_ERR_PROFILE_NOT_FOUND userInfo:userInfo];
         return NO;
      }

   NSLog(@"%@", profile);

   NSArray *arguments = [NSArray arrayWithObjects:
                         @"-sdk", @"iphoneos5.0", 
                         @"PackageApplication", input,
                         @"-o", output, 
                         @"--sign", isDemoApp ? @"Wolfgang Schreurs (YK9DVMECC4)" : @"My Company",
                         @"--embed", profile,
                         @"-verbose",
                         nil];
   [task setArguments:arguments];

   NSString *projectDirectory = [MOB_PROJECT_DIR stringByExpandingTildeInPath];
   [task setCurrentDirectoryPath:projectDirectory];

   NSPipe *pipe = [NSPipe pipe];
   [task setStandardOutput: pipe];
   [task setStandardInput:[NSPipe pipe]]; 
   NSFileHandle *file = [pipe fileHandleForReading];

   [task launch];

   NSData *data = [file readDataToEndOfFile];
   NSString *string = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];

   [self.delegate builder:self didUpdateStatus:string];

   return YES;
}

上記のこのスニペットでは、ビルド ディレクトリから *.app を取得し、~/Library/MobileProvisioning(またはそのようなもの) のプロビジョニング プロファイルを使用して署名付き IPA を作成します。

于 2011-08-15T22:31:57.543 に答える