All articles
developers

Debugging a .pkpass Locally: Five Terminal Checks to Run Before a Pass Reaches a Phone

Wallet tells you nothing when a pass fails. Your terminal will. Five local checks, one script for CI, and what only a real iPhone can confirm.

Updated
Debugging a .pkpass Locally: Five Terminal Checks to Run Before a Pass Reaches a Phone
Julio Song
10 min read

It's 4:50pm on a Friday. A developer we'll call Priya has a pass generator that works on her laptop and a ticket that says "ship before the weekend." CI builds the .pkpass. She AirDrops it to her test phone. The phone does nothing. It shows no sheet and no error, and the file never lands in Wallet.

She has no idea which half of her afternoon to distrust.

Almost everything Wallet checks before it accepts a pass, you can check yourself in a terminal in under a minute. And the terminal names the file that failed. This post walks through five checks, roughly in the order Wallet runs its own, then turns them into a script. We ran every command below against the five sample passes that ship with our validator, so the output you see is real.

Start by listing the archive, not opening it

A .pkpass is a zip. Before you unzip anything, look at the table of contents:

unzip -l ticket.pkpass

A healthy pass is flat. pass.json, manifest.json, signature and the images sit at the top level, with a .lproj folder per language if you localize. Here is what our "zipped inside a folder" sample prints instead:

Length      Date    Time    Name
---------  ---------- -----   ----
      814  2026-10-05 15:11   MyPass/pass.json
       67  2026-10-05 15:11   MyPass/icon@2x.png
      113  2026-10-05 15:11   MyPass/manifest.json
     3272  2026-10-05 15:11   MyPass/signature

That MyPass/ prefix is the whole bug. Wallet looks for pass.json at the root and finds nothing there. Apple's guide says to zip the contents of the pass package, and this is what zipping the folder looks like.

The same listing catches the second archive mistake. If you see __MACOSX/._pass.json or .DS_Store in the output, your zip tool added files your manifest has never heard of. Apple's guide tells you to leave metadata files like .DS_Store out, and the next check shows why.

Make the manifest prove itself

manifest.json maps every file in the pass to its SHA-1 hash. Wallet recomputes each hash on install. You can do the same with jq and shasum, because shasum -c reads lines of "hash, two spaces, filename" and that is easy to build from the manifest:

unzip -q ticket.pkpass -d ticket && cd ticket
jq -r 'to_entries[] | "\(.value)  \(.key)"' manifest.json | shasum -a 1 -c

On a good pass, every line ends in OK. On our "edited after signing" sample, where someone changed one word in the description after the build:

icon@2x.png: OK
pass.json: FAILED
shasum: WARNING: 1 computed checksum did NOT match

Compare that with what the phone told Priya, which was nothing.

That command only checks files the manifest lists. The reverse matters too. A file in the archive that the manifest doesn't mention counts as tampering, so compare the two lists:

diff <(find . -type f ! -name manifest.json ! -name signature | sed 's|^\./||' | sort) \
     <(jq -r 'keys[]' manifest.json | sort)

No output means the lists match. The "extra macOS files" sample prints .DS_Store and __MACOSX/._pass.json on the left side, which are the two stowaways from the first check.

Verify the signature, then read the certificate

The signature file is a detached PKCS#7 signature over manifest.json. OpenSSL can verify it:

openssl smime -verify -in signature -inform DER \
  -content manifest.json -noverify -out /dev/null

Verification successful means the signature covers this exact manifest. -noverify skips the certificate chain for now and checks only the math. Change the manifest after signing and OpenSSL 3 answers with Verification failure and a digest failure line.

This check and the last one are not interchangeable. The "edited after signing" sample fails the hash check and passes this one, because its manifest was never touched. The "manifest changed after signing" sample does the opposite. You need both. A test suite that only verifies the signature will wave through a file that was edited after signing. Our post on what goes into a .pkpass explains why the trust is layered this way.

Next, read who signed it. The certificates travel inside the signature:

openssl pkcs7 -inform DER -in signature -print_certs \
  | openssl x509 -noout -subject -issuer -enddate

The output has this shape:

subject=UID = pass.com.example.loyalty, CN = Pass Type ID: pass.com.example.loyalty, OU = A1B2C3D4E5, O = Example Coffee Co, C = US
issuer=CN = Apple Worldwide Developer Relations Certification Authority, OU = G4, O = Apple Inc., C = US
notAfter=May 14 09:33:08 2027 GMT

Three lines, four facts. UID has to equal passTypeIdentifier in your pass.json. The subject's OU has to equal teamIdentifier. notAfter is the day this certificate stops signing installable passes. And the issuer's OU tells you which WWDR generation issued your certificate.

That last one deserves ten more seconds. Run openssl pkcs7 -inform DER -in signature -print_certs -noout and you should see two subjects: yours and Apple's WWDR intermediate. Apple's Passbook FAQ lists a missing WWDR certificate first among the causes of a bad signature. If the generation on the intermediate you bundled doesn't match the generation in your issuer line, your signing code is carrying a stale file from an old tutorial.

To check the whole chain, fetch Apple's root and the current intermediate once, then drop -noverify:

curl -sO https://www.apple.com/appleca/AppleIncRootCertificate.cer
curl -sO https://www.apple.com/certificateauthority/AppleWWDRCAG4.cer
cat <(openssl x509 -inform DER -in AppleIncRootCertificate.cer) \
    <(openssl x509 -inform DER -in AppleWWDRCAG4.cer) > apple-chain.pem

openssl smime -verify -in signature -inform DER -content manifest.json \
  -CAfile apple-chain.pem -purpose any -out /dev/null

Keep -purpose any. A Pass Type ID certificate isn't an email certificate, and without the flag OpenSSL rejects a perfectly good chain with unsuitable certificate purpose. That one cost us a few minutes.

The same checks in one drop

If you'd rather not memorize OpenSSL flags, our free pkpass validator runs all of the above in your browser. It checks the archive layout, every manifest hash, the signature, and the certificate's issuer, expiry, Pass Type ID and Team ID. Then it goes further than the terminal did and reads pass.json itself: the required keys, exactly one pass style, unique field keys, barcode formats, color and date formats, and whether each image is a real PNG. The file is unzipped on your device and never uploaded, which matters when the pass in question belongs to a customer.

It also carries the five sample passes used in this post, one valid and four broken in different ways, so you can see each failure before you meet it in your own build.

Use the terminal when you want the checks in a script. Use the validator when a teammate sends you a file and asks why it won't open.

What a validator can't see

In August 2024 a developer posted to Apple's developer forums with a pass Wallet would not detect. They had done everything right by this post's standards. The manifest hashes matched. The JSON looked fine. An online validator had passed every point, and they attached the screenshot.

The reply came two months later from Alexander Cerutti, who maintains the open-source passkit-generator library. He pointed at two suspects. The pass.json used a style key Wallet doesn't recognize. And the pass had no icon@3x.png, which he said makes a pass invalid on recent iPhones while it stays valid on Macs and older phones. His verdict on the validator: "The website kind of lies. I mean, it is right, but it doesn't consider the device."

The thread never confirms which suspect was guilty. But that sentence is the fairest summary of pass validation we've read, and it applies to ours too. A validator reads a file. It doesn't run Wallet. Ours flags missing high-resolution images as a warning, not a blocker, since whether it blocks depends on the phone in your hand.

So the last check is always a device, and the device does keep a log. Apple's Wallet Developer Guide says that when a pass isn't added, "check the log for a description of what went wrong." Here is the loop:

  1. Simulator first. Drag the .pkpass onto the Simulator window. Apple's guide says it displays the pass and offers to add it. Errors go to the system log, which you read in the Console app on your Mac.
  2. Then a real iPhone. Connect it to your Mac, select it in Console, and start streaming before you open the pass. Cerutti's advice in the same thread is to filter on the process passd.
  3. Read what it says. Apple's guide lists the usual findings: malformed JSON, misspelled keys, a pass type identifier that doesn't match your certificate, and a signature that omits the WWDR certificate.

Don't stop at the Simulator. Apple's guide notes it doesn't support relevance information, and an older thread on the same forums shows the other gap. In November 2019 a developer dragged a bad pass into the Simulator and got no log output at all. Eighteen months later a second developer joined the thread with a pass that opened on macOS and did nothing on iOS, again with no error. They followed up with the cause: a WWDR certificate missing from the chain. The certificate check above prints that answer in about ten seconds.

The same goes for a Mac. A pass that previews on macOS has only passed macOS.

Put the checks where the bug gets made

A pass is rarely broken by the signing code alone. More often the culprit is whatever runs after it: a formatter, an image optimizer, a zip step on a different machine. So run the checks on the finished file, at the end of the build:

#!/usr/bin/env bash
set -euo pipefail

dir="$(mktemp -d)"
unzip -q "$1" -d "$dir"
cd "$dir"

# 1. The three required files sit at the top level
for f in pass.json manifest.json signature; do
  [ -f "$f" ] || { echo "missing $f at the archive root"; exit 1; }
done

# 2. Every file the manifest lists matches its hash
jq -r 'to_entries[] | "\(.value)  \(.key)"' manifest.json | shasum -a 1 -c --quiet

# 3. Nothing unlisted came along for the ride
diff <(find . -type f ! -name manifest.json ! -name signature | sed 's|^\./||' | sort) \
     <(jq -r 'keys[]' manifest.json | sort)

# 4. The signature covers this exact manifest
openssl smime -verify -in signature -inform DER -content manifest.json -noverify -out /dev/null

# 5. The signing certificate has more than 30 days left
openssl pkcs7 -inform DER -in signature -print_certs | openssl x509 -noout -checkend 2592000

It's about twenty lines and needs only unzip, jq, shasum and openssl. Against our five samples, the valid pass exits 0 and each broken pass stops at a different step: the wrapped folder at step 1, the edited file at step 2, the macOS extras at step 3, the altered manifest at step 4. Step 5 is the one that pays off a year from now, when the certificate you forgot about has a month left.

A green run doesn't mean the pass installs. It means four of the most common packaging mistakes can't reach a phone without someone seeing a red build first. When a pass clears all of this and a phone still refuses it, the cannot-be-installed checklist covers what's left.

Priya's bug, for the record, was an image optimizer that ran after signing. Check two would have named the file at 4:51.

If you'd rather not own any of these steps, Passmint builds the manifest and the signature in the same call that produces the pass, so nothing can touch a file in between. The quickstart has a test key signing real passes in about five minutes.

Primary sources

Common questions

Unzip it and run three checks. Compare each file against its SHA-1 hash in manifest.json, verify the signature against the manifest with openssl smime -verify, and read the signing certificate for its Pass Type ID, Team ID and expiry date. A browser validator runs the same checks in one step.
Run openssl smime -verify -in signature -inform DER -content manifest.json -noverify inside the unzipped pass. It confirms the signature covers that exact manifest. Drop -noverify and pass Apple's root and WWDR certificates with -CAfile and -purpose any to check the chain as well.
A local check reads the file. It cannot run Wallet. Device-specific behaviour, such as a current iPhone wanting an icon@3x.png that a Mac never asks for, only shows up on hardware, so finish every test on a real phone with Console open.
In the system log. Apple's Wallet Developer Guide says Simulator errors go to the system log, readable in the Console app, and device errors go to the device console. Filtering on the passd process narrows the stream to Wallet's own messages.
Julio Song

Technical content writer, Passmint

Julio is a technical content writer at Passmint. He writes about Apple PassKit, the Google Wallet API, and what breaks when wallet passes meet production traffic.

More from Julio Song โ†’

Related reading

Share this article