AppForShare

Get app logs with tester bug reports, without adding an SDK

· 6 min read

Get app logs with tester bug reports, without adding an SDK

Short answer: To get app logs with tester bug reports without adding an SDK, let the test build collect its own recent log lines, post them with one HTTP request when the tester taps Report a bug, and open the feedback form with the id that request returns. On AppForShare that is POST /api/feedback/<token>/attach followed by the in-app feedback link with &attach=<id>; the report then arrives with the log and up to 30 key values, such as the user id, the flavor or the API address.

"It does not work" is the most common bug report from testers, and the most expensive one. The developer then asks for the steps, the account, the server and the time, and by the time the answers arrive the log on the phone is gone. Feedback SDKs solve this by recording everything, but an SDK means a new dependency, a build setting per flavor and one more thing to keep out of store builds. For a test build, a few lines of your own code do most of the job.

What a useful report carries

  • The tester's words and a screenshot. What they expected and what they saw.
  • Build and device. Version, build number, platform, model and OS version.
  • The screen. Where in the app the tester was when they reported.
  • A few values. The signed in test user, the backend the build talks to, the feature flags that were on, the network type.
  • The last minutes of the log. Errors, failed requests and warnings right before the report.

The first three come from any feedback form. The last two have to come from inside the app, because only the app knows them.

Reading your own app's log

Both platforms let an app read its own log without special permission:

  • iOS 15 and later. OSLogStore(scope: .currentProcessIdentifier) returns the entries this process wrote with Logger or os_log. Read the last 10 to 15 minutes and join them as text.
  • Android. Running logcat -d with --pid set to the app's own process returns its own lines. Since Android 4.1 an app can only read its own entries this way, and it needs no extra permission for them.
  • React Native and Flutter. The simplest route is a ring buffer: wrap console.log, console.warn and console.error (or Flutter's debugPrint) and keep the last 2,000 lines in memory.

Keep the log short. The last few thousand lines are enough for almost every report, and a smaller payload sends faster on a weak network.

The flow, step by step

  1. The tester taps Report a bug in a debug menu, or shakes the phone (see shake to report a bug).
  2. The app posts its log and values to the attach address and gets an attach id back.
  3. The app opens the feedback link in the browser with version, build, screen and the attach id.
  4. The tester writes what happened, adds screenshots and sends. Before sending, the form shows how many log lines and which value names come along, with "Only the developer sees them".
# 1. The app posts its log and values
curl -X POST https://appforshare.io/api/feedback/<token>/attach \
  -H "Content-Type: application/json" \
  -d '{"log": "12:01:03 Checkout: 502 from api-staging", "values": {"user": "42", "flavor": "staging"}}'
# 201 {"attach": "<id>"}

# 2. The app opens the feedback link with the id
https://appforshare.io/feedback/<token>?platform=android&version=3.4.0&build=212&screen=Checkout&attach=<id>

If the post fails, open the form anyway without the id. The tester can still report, just without the log.

Limits that keep it simple

  • A plain text log up to 2 MB as a multipart file, or about 1 MB inside JSON.
  • Up to 30 values, names up to 40 characters, values up to 300 characters.
  • An attach id works once and for 2 hours, and the attach address is rate limited.

The project's Testing page has ready to paste code for Swift, Kotlin, React Native and Flutter, with your attach address and feedback link filled in. The full reference is in app logs and values with feedback.

Secrets and personal data

Logs leak things. Before anything is saved, AppForShare masks obvious secrets: bearer and basic auth headers, private keys, JWTs, AWS, Google, Stripe, Slack and GitHub key formats, password=... style pairs, and values whose name looks like a password, token or secret. Logs are stored encrypted with the same envelope sealing as store keys and kept with the report. Owner emails and webhooks only say that an app log came along, never its lines or values.

Masking catches the obvious patterns, not everything. Your app decides what it sends, so strip email addresses, names and other personal data in the app before posting, and do not log full request bodies in the first place.

Keep it out of store builds

The log code, like the feedback link itself, belongs in test builds only. Put it behind a debug menu, a build flavor or a compile flag, so the store build never contains the attach address. A test that fails when the flag is on in a release build is cheap insurance.

Where the report goes

The report lands in the feedback inbox with the tester's text, screenshots, device and build, a table of Values from the app, and the app log with search and download. From there:

  • Linear and Jira. Copy for an issue and the Linear or Jira actions carry the values, and the issue gets the log as a text file. See beta feedback to Linear and Jira.
  • CLI. npx appforshare feedback --source app lists in-app reports with their values and line count; npx appforshare feedback log 1187 --out checkout.log downloads one log.
  • AI assistants. The MCP tool list_feedback returns the values and the first 200 lines of up to 10 logs, so an assistant can read the report next to your code.

Which plan

The in-app feedback link, with screenshots, works on every plan with an account. Logs and values with the report are on Pro and Team. See pricing for the plans, and in-app feedback without an SDK for the feedback link on its own.

Common questions

Do I need an SDK to get logs with bug reports?

No. One POST from your app and the feedback link with the id it returns. The code is a few dozen lines per platform.

Can the app send a log after a crash?

Not from the process that crashed. For crashes, keep a crash reporter such as Crashlytics or Sentry in the test build; the log flow covers bugs the tester sees while the app is still running.

Who can read the log?

Members of the workspace who can see the project's feedback. Testers only see the line count and value names before they send.

Can I send values without a log?

Yes. Post only values, and the report shows them as a table.

Keep reading

App Distribution Platform · · 5 min read

AppForShare File Size and Upload Limits

AppForShare limits the size of each build you upload by plan: 50 MB without an account, 150 MB on the Free plan, 2 GB on Pro and 4 GB on Team. Accounts also have a storage total, and every plan...