How to Test Camera Access in Mobile Apps (Complete Guide)
Camera access is a common mobile feature — profile photos, QR codes, document capture, AR, video. It is also a common source of UX failures, privacy issues, and platform-specific edge cases. This guid
Camera access is a common mobile feature — profile photos, QR codes, document capture, AR, video. It is also a common source of UX failures, privacy issues, and platform-specific edge cases. This guide covers the test matrix.
What to test
Permission flow
- Camera permission requested at the right moment (on feature use, not at launch)
- Permission rationale clear (what the camera is for)
- Deny → feature gracefully unavailable
- Deny-twice → settings deep link offered
- Grant → camera available within 1 second
- Revoke in settings → app detects on next use
Camera UI
- Preview renders without delay after permission grant
- Preview orientation correct (portrait / landscape)
- Switch front / back camera
- Zoom functional (pinch and slider)
- Focus tap-to-focus functional
- Flash toggle (off / on / auto)
- Timer / self-timer (if offered)
- Grid lines (if offered)
Capture
- Shutter button captures an image within 500ms
- Haptic / sound feedback on capture
- Captured photo visible in preview
- Retake option before confirming
- Confirm commits photo (saves / uploads / passes to next step)
Video
- Video record button toggles start/stop
- Recording indicator visible
- Duration visible
- Background / foreground mid-recording does not corrupt file
- Call interrupting → pause or save, not crash
- Storage full → graceful error, not silent failure
Post-capture processing
- Image compression applied (not storing 20MB originals)
- EXIF data stripped if privacy-sensitive (location)
- Correct file format saved (JPEG / HEIC / PNG per context)
- Thumbnails generated for preview lists
QR / barcode scanning
- QR in frame is detected within 2 seconds
- Multiple QRs in frame → user picks or first-detected
- Malformed QR → handled gracefully (no crash)
- QR containing malicious URL → validated before opening
- Low-light QR → detected or clear "too dark" message
Document capture
- Auto-edge detection (if offered)
- Manual crop available
- Perspective correction (dewarp)
- Multi-page stitching
- OCR (if offered) processes and returns text
AR
- World tracking stable
- Plane detection works on varied surfaces
- Performance acceptable on mid-tier devices
- Low-light fallback behavior
- Overheat handling (reduce quality, warn user)
Edge cases
- App backgrounded mid-capture → resumes or saves
- Call interrupts → camera pauses, resumes on return
- Another camera-using app in background → appropriate handling
- Screenshot during camera preview → works, does not crash
- Rotation during capture → image orientation correct
- Device overheat → camera throttles or stops with clear message
Accessibility
- Shutter button reachable with assistive tech
- Camera feature usable with screen magnification
- Voiceover announces capture
- Alternative to camera (file picker) offered where appropriate
Security / privacy
- Camera only active when feature is active (iOS green dot, Android indicator)
- Captured images not uploaded until user confirms
- Photos saved in app-specific dir, not public gallery (unless user opts in)
- No photos accessible to other apps
- User can delete captured photos from within app
- Background capture attempts blocked (iOS / Android enforce this at OS level)
Manual testing
Real device only. Emulator cameras are simulated images; you will not catch real hardware bugs. Test in:
- Bright sunlight (autofocus, auto-exposure)
- Low light (noise, HDR behavior)
- Moving (stabilization)
- With case on (some cases affect camera)
- After rapid foreground/background (warm start)
- With other apps competing for camera
Automated testing
Camera automation is limited — the OS does not allow programmatic camera feeds. What you can automate:
- Permission grant/deny flows (Android runtime, iOS launch arguments)
- UI element presence (shutter button, controls)
- File creation after simulated capture (via mocked capture API)
- Integration with downstream processing (compression, upload)
Android
// Grant permission
GrantPermissionRule.grant(Manifest.permission.CAMERA)
// Launch camera activity, assert preview surface exists
onView(withId(R.id.camera_preview)).check(matches(isDisplayed()))
iOS (StoreKit / test mode)
Inject a test camera mock that returns a known image on capture. Validate the downstream pipeline.
How SUSA tests camera flows
SUSA detects camera-requiring screens and drives through permission + UI interactions. It cannot simulate actual camera input (hardware constraint). What it does verify:
- Permission flow works correctly across allow / deny / allow-after-deny
- Camera preview renders (screen hash change after permission grant)
- Controls (shutter, switch, flash) are accessible
- Feature degrades gracefully on permission deny
susatest-agent test cameraapp.apk --persona adversarial --steps 100
Common production bugs
- Camera permission requested at launch — users reject without understanding the use
- Preview does not render on permission grant — needs lifecycle kick to re-initialize
- EXIF location leaked on shared photos
- Camera stays active after feature exit — iOS shows green dot, user loses trust
- Low-light capture produces black image — HDR / ISO not configured
Camera code is surprisingly fragile. Real-device testing every release, SUSA for permission regression, dedicated manual pass for capture quality.
Test Your App Autonomously
Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts.
Try SUSA Free