LoginSignup
0
4

More than 1 year has passed since last update.

macOSアプリの公証をnotarytoolで行う

Posted at

概要

  • altoolはまもなく廃止となるので、notarytoolに移行します。

Apple、Xcode 13以前のGUIやaltoolによるMacアプリの公証を2023年秋までに終了し、今後はXcode 14以上のGUIやnotarytoolへ移行
AppleがXcode 13以前のGUIやaltoolによるMacアプリの公証を2023年秋で終了し、今後はXcode 14以上のGUIやnotarytoolへ移行するように発表しています。詳細は以下から。

参考

手順

キーチェーンへ情報の登録

xcrun notarytool store-credentials "AC_PASSWORD" \
               --apple-id "xxx@gmail.com" \
               --team-id "<team_id>" \
               --password "xxxx-xxxx-xxxx-xxxx"

公証対象のzip化

-c 指定したパスに書庫ファイルを作成する。
-k ZIPで圧縮する。

# Create a ZIP archive suitable for notarization.
/usr/bin/ditto -c -k --keepParent "$APP_PATH" "$ZIP_PATH"

/usr/bin/ditto -c -k --keepParent /Users/hogeuser/Downloads/tmp/MyApp.app /Users/hogeuser/Downloads/tmp/MyApp.app.zip

公証

xcrun notarytool submit MyApp.app.zip \
                   --keychain-profile "AC_PASSWORD" \
                   --wait
Conducting pre-submission checks for MyApp.app.zip and initiating connection to the Apple notary service...
Submission ID received
  id: f2c5affb-5614-44a7-8050-de80287552e1
Successfully uploaded file
  id: f2c5affb-5614-44a7-8050-de80287552e1
  path: /Users/hogeuser/Downloads/tmp/MyApp.app.zip
Waiting for processing to complete.
Current status: Accepted........
Processing complete
  id: f2c5affb-5614-44a7-8050-de80287552e1
  status: Accepted

公証結果のログの確認

xcrun notarytool log f2c5affb-5614-44a7-8050-de80287552e1 --keychain-profile "AC_PASSWORD" developer_log.json
Successfully downloaded submission log
  id: f2c5affb-5614-44a7-8050-de80287552e1
  location: /Users/hogeuser/Downloads/tmp/developer_log.json

open developer_log.json 
  • 下記の通りワーニングがある可能性があるため、成功してもログを確認することが推奨されている。

Customizing the notarization workflow
Always check the log file, even if notarization succeeds, because it might contain warnings that you can fix prior to your next submission.

Staple処理

  • オフラインのときのためのもの。(ここは従来通り。)
  • ついでに公証処理がうまくいっていることが確認できる(公証がダメだった場合にエラーとなるため)
xcrun stapler staple MyApp.app
Processing: /Users/hogeuser/Downloads/tmp/MyApp.app
Processing: /Users/hogeuser/Downloads/tmp/MyApp.app
The staple and validate action worked!
0
4
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
0
4