The debugger
See everything your app did in Preview, in order: what started each run, every step with its values, what changed, what came back from the web, and why a step failed.
The debugger lists everything your app does while it runs in Preview, in order. When something doesn't work the way you expected, it shows you which step ran, with which values, and why a step failed.
#Open the debugger
- Open Preview.
- Tap the ladybug button at the top, next to the device menu.
- Use your app. Each tap, step and change shows up in the debugger as it happens.
The debugger opens as a panel on the right. Tap the ladybug again, or the close button in the panel, to hide it. Your app keeps running either way, and the debugger keeps listing what happens.
#The badge
While the debugger is hidden, a red number on the ladybug counts the steps that failed since you last had it open. Open the debugger to see them; the badge goes away.
#Read the log
Each line has an icon, a title and the time it happened. The newest line is at the bottom, and the debugger scrolls to it. Steps inside other steps, like the steps in an If's Then or in a reusable action, are indented under the step that ran them.
| Icon | What it is | Looks like |
|---|---|---|
| Lightning bolt | A trigger. Something happened to a view and its steps started. It names the view (its name in Layers, or its component) and the trigger. | Add 250 ml: When Tapped |
| Play | A step starting, with each of its settings as they were at that moment, one per line. A formula shows what it worked out to. | Set Value / state: intake / to: 2050 |
| Arrow | A change to a variable, with its new value. | intake = 2050 |
| Arrow in a circle | An answer from the web: Call API's method, address and status, then what came back. | GET https://dummyjson.com/products → 200 |
| Red stop sign | A failure: the step that failed, and why. See When a step fails. | Write Email failed |
| ⓘ | A note: something worth knowing that isn't a step, like a message from a Log step. | Try caught it |
How values show:
- Text is in quotes. Long text is cut after 160 characters, with "…".
- A list shows how many items it has, like
3 items. A list of one shows that item. - A record shows its fields in braces, like
{ name: "Maya", age: 34 }, up to eight of them. - A value with nothing in it shows as
empty. - Secrets never show. A Call API step's headers list only their names.
Lines are cut to a few lines each. Tap a line to see all of it; tap it again to fold it. You can select the text of a step's settings, to copy a value or an address.
The debugger keeps the newest 1,000 lines. Older ones drop off the top.
#Notes you might see
| Note | What it means |
|---|---|
| Try caught it | A step inside a Try failed, so the Try's Catch steps run. The note says what went wrong (error.message). |
| Timer “…” | A timer's steps are running again. |
| … skipped | The same trigger fired again while its last run was still going. A trigger never runs twice at once, so this one didn't start. |
| The camera was closed without a photo · The scanner was closed without reading anything · No photo was picked · No file was picked | The person closed it without choosing. The steps after it didn't run. |
| Not saved · Not shared · Not added · Not sent | Save File, Share, Add to Calendar or Write Email was cancelled. The steps after it still run. |
#Show only failures
The switch at the top of the debugger chooses what it lists:
- Everything: every trigger, step, change, answer and note.
- Failures: only the steps that failed. When there are none, it says No failures: every step so far did what it should.
#Clear the log
Tap Clear at the top of the debugger to empty it. Use it before you try one thing, so the log shows only what that one thing did.
#When a step fails
A failed step shows in red, with the reason under it. Unless the step is inside a Try, the steps after it don't run, and a red message at the top of the device says what went wrong.
The reason says what to check. For Call API, it starts with the server's status:
| What it says | What to check |
|---|---|
| Error 400. The server didn't understand the request: check the body and query. | The step's Body and Query. |
| Error 401. The server doesn't know who's asking: check the headers, like Authorization, and their secrets. | The step's Headers, and that each secret they use has the right value. |
| Error 403. The server won't allow it with these credentials. | Your key or token: it may not be allowed to do this. |
| Error 404. There's nothing at that address: check the URL. | The step's Url. |
| Error 429. Too many requests: wait a moment, then try again. | How often your app calls it. |
| Error 500 (or higher). The server had a problem of its own. Try again later. | Nothing on your side, usually. |
| Any other error status. The server refused the request. | The server's answer, shown under it as Its answer: |
| This iPad isn't online. | The iPad's Wi-Fi or cellular connection. |
| The server took too long to answer (the step's timeout). | The step's Timeout, or the server. |
| There's no server at that address: check the URL. | The step's Url. |
| The server's secure connection couldn't be trusted. | The address, and the server's certificate. |
| APIs have to use an https:// address. | The step's Url starts with https://. |
| The secret “…” has no value yet. Add it under Data & Logic → Secrets. | The secret in Data & Logic → Secrets. See Secrets. |
Other steps say what they needed, in their own words. A few you might meet:
| What it says | What to check |
|---|---|
| … is turned off for PadCode. Turn it on in Settings → PadCode, then try again. | The permission, in the iPad's Settings app. |
| … wasn't allowed, so “…” didn't run. | Someone tapped Not Now, or didn't allow it when iPadOS asked. |
| There's no file “…” in this app's Assets → Files, or it isn't JSON, CSV or text. | The file in Assets, for Load File. |
| There's no view “…” for … Use a view's name from Layers. | The name in Scroll To or Focus Field matches a view's name in Layers. |
| There's nothing to share: Items is empty. | Share's Items. |
| Start isn't a date, so there's no time to put the event at. | Add to Calendar's Start. |
| Couldn't find where you are. Check that Location is on, then try again. | Location Services on the iPad. |
To handle a failure in your app instead of stopping, put the step in a Try and add Catch steps: they can show error.message, and for Call API error.status and error.body.
#The debugger and Flow
When you close Preview, what the debugger saw stays with your app. Switch the Builder to Flow and the board shows each step's last run: what it did, and which step failed. See Flow.
The debugger itself starts empty each time you open Preview.