[PR #125·127] Getting Ready for Real-Phone Testing: A Test Guide and Apple Private Key Line Breaks
This post bundles two PRs that came out of my preparation to test the customer app on real iPhones and Android phones.
- What was done: PR #125 wrote a step-by-step guide for the phone tests. PR #127 fixed a problem found while restarting the test server: the line breaks in the Apple private key could not be read by the server.
- Merge order: The two PRs merged in the opposite order of their numbers: PR #127 first, PR #125 later.
At a glance
| PR #125 | PR #127 | |
|---|---|---|
| Merged | 2026-11-01 (later) | 2026-10-31 (earlier) |
| What was done | Wrote the phone-test guide (documents only) | Read ` |
inAPPLE_PRIVATE_KEY` as real line breaks |
||
| What I did | Asked for the server-preparation part, allowed reading the folder outside the repo | Restarted the test server as test preparation |
| Check | Matched source files, read 9 official doc pages | Wrote the test first and saw it fail before the fix |
PR #125: The real-device test guide
- Why it was written: The customer app’s code work had all been merged, and what remained was the testing I do on real phones. There was no document to follow, so Claude wrote a new guide under
docs/guides/. No code or settings were changed, and no build, sign-in or external service call was made. It was documents and reading official docs only. - Structure: A pre-start checklist, preparing the server, entering the server address and the Kakao key, the Android build, the iPhone build, connecting to the dev server, a test checklist, and a results table with cleanup commands. The test items came from the “checked by a person” lists in earlier work logs and from the customer app plan.
- Choice made: The server address (
EXPO_PUBLIC_API_URL) is not put into the build but into.env.local(a settings file that stays on one computer). According to the official docs, the dev server inserts this value when it bundles the code, so changing it does not require rebuilding the development build (the test version of the app installed directly on the phone). Only the Kakao key is needed at build time. Results are recorded in a new work log instead of editing work logs that were already merged. - Alternatives dropped: Expo Go (a test app that cannot do Kakao sign-in), and adding steps that change code inside the guide, which is outside this PR’s scope.
- Added at my request: I asked for two additions. One is a test path that works while the computer that normally runs the server is off. The test path never depended on that computer in the first place (Docker server on my Windows computer, cloud builds, same Wi-Fi), so only the “ask someone” part of the guide was changed. The other is the server-preparation part, corrected after actually restarting the test server.
- What restarting the server showed: If the test server’s external sign-in settings are still the example (fake) values, real Kakao, Apple and Google sign-in do not work. Also,
APPLE_KEY_IDandAPPLE_PRIVATE_KEYare used not only for account deletion but also for the signature the server sends to Apple at a first Apple sign-up. With example values, that first sign-up returns 503. - How it was checked: Claude re-read the source files to match them, and read nine pages of the official Expo docs. Things the docs did not cover are marked “not confirmed” in the guide. I gave permission to read the test-server folder outside the repository; key values were not read, only the names and whether they were still example values.
PR #127: Apple private key line breaks
- Problem: Found while restarting the test server.
.envanddocker --env-fileaccept only one line per value, so the line breaks of the Apple private key (a.p8file) end up written as the two characters\n. The server passed that value as-is toimportPKCS8(the function that reads the key). When Claude tested inside the server, the key could not be read as-is but could be read once\nwas turned into real line breaks. When it cannot be read, the signature for a first Apple sign-up cannot be created and the server returns anapple_unavailable(503) error. - The fix:
loadEnv(the function that reads environment variables) now turns\ninAPPLE_PRIVATE_KEYinto real line breaks. - Choice made: Convert in the one place where the value is read (
env.ts), since everything that uses the key goes through it. - Alternatives dropped: Converting in the module that uses the key, because another place using the same value could miss it again. Converting in the shell each time a container is created, because the same fix-up would be needed on every rebuild and is easy to get wrong.
- How it was checked: A test was added to
env.spec.tsfirst and seen failing before the fix. A key with literal\ncharacters and a key that already has line breaks both come out as a key with line breaks.
What was not confirmed
- The original command used to create the containers is unknown, so the
docker runshape in the guide is inferred from the container settings. - Kakao and Apple sign-in, and Google sign-in for the admin web, can only be checked on the phone app and the admin web, so these two PRs did not confirm them.
- PR #125 changed only documents, so CI results were used instead of
verifyresults from the Windows working folder.
What I took from it
- A test guide only gets corrected by following it while writing it. Restarting the server for real showed that the key settings were used differently from what the docs said, and exposed the private key line-break problem.
- Unfold a multi-line value stored in a one-line environment variable in a single reading place. If every user of the value unfolds it, one of them will be missed.
- When writing a guide reveals a gap in the code, note it separately instead of fixing it in the documentation PR. PR #125 did this, so documentation and code changes were not mixed in one PR.