0

Trying to notarize Electron app.

Generated “App Manager” API key on https://appstoreconnect.apple.com/access/api.

Ran xcrun notarytool store-credentials test referencing AuthKey_*.p8 API key.

Wrote following notarize.js @electron/notarize script.

const { existsSync } = require("fs")
const { homedir } = require("os")
const { join } = require("path")
const electronNotarize = require("@electron/notarize")

module.exports = async function (context) {
  if (process.platform !== "darwin") {
    return
  }

  const appId = context.packager.config.appId

  const appPath = join(
    context.appOutDir,
    `${context.packager.appInfo.productFilename}.app`
  )

  console.log(`Notarizing ${appId} found at ${appPath}…`)

  await electronNotarize.notarize({
    appPath: appPath,
    keychain: `${homedir()}/Library/Keychains/login.keychain-db`,
    keychainProfile: "test",
    tool: "notarytool",
  })

  console.log(`Notarized ${appId} found at ${appPath}`)
}

When I run electron-builder build script which triggers afterSign which runs notarize.js, following error is thrown.

Error: No Keychain password item found for profile: test

What am I missing?

sunknudsen
  • 6,356
  • 3
  • 39
  • 76
  • Using `appleApiKey`, `appleApiKeyId` and `appleApiIssuer` worked… so looks like an issue related to Keychain. – sunknudsen Dec 15 '22 at 15:56

0 Answers0