home / skills / secondsky / claude-skills / mobile-app-debugging

This skill helps you diagnose mobile app issues across iOS, Android, and React Native, guiding debugging steps and best practices.

npx playbooks add skill secondsky/claude-skills --skill mobile-app-debugging

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
2.0 KB
---
name: mobile-app-debugging
description: Mobile app debugging for iOS, Android, cross-platform frameworks. Use for crashes, memory leaks, performance issues, network problems, or encountering Xcode instruments, Android Profiler, React Native debugger, native bridge errors.
---

# Mobile App Debugging

Debug mobile applications across iOS, Android, and cross-platform frameworks.

## iOS Debugging (Xcode)

```swift
// Breakpoint with condition
// Right-click breakpoint > Edit > Condition: userId == "123"

// LLDB commands
po variable          // Print object
p expression         // Evaluate expression
bt                   // Backtrace
```

### Memory Debugging
- Use Memory Graph Debugger to find retain cycles
- Enable Zombie Objects for use-after-free bugs
- Profile with Instruments > Leaks

## Android Debugging (Android Studio)

```kotlin
// Logcat filtering
Log.d("TAG", "Debug message")
Log.e("TAG", "Error", exception)

// Filter: tag:MyApp level:error
```

### Common Issues
- ANR: Check main thread blocking
- OOM: Profile with Memory Profiler
- Layout issues: Use Layout Inspector

## React Native

```javascript
// Remote debugging
// Shake device > Debug JS Remotely

// Console logging
console.log('Debug:', variable);
console.warn('Warning');
console.error('Error');

// Performance Monitor
// Shake > Show Perf Monitor
// Target: 60 FPS, <16ms per frame
```

## Network Debugging

```javascript
// Intercept requests
XMLHttpRequest.prototype._send = XMLHttpRequest.prototype.send;
XMLHttpRequest.prototype.send = function() {
  console.log('Request:', this._url);
  this._send.apply(this, arguments);
};
```

## Debug Checklist

- [ ] Test on physical devices (not just simulators)
- [ ] Test on older device models
- [ ] Simulate slow 3G network
- [ ] Test offline mode
- [ ] Check memory under load
- [ ] Test rotation and safe areas
- [ ] Verify 60 FPS target

## Performance Targets

| Metric | Target |
|--------|--------|
| Frame rate | 60 FPS (16ms/frame) |
| Memory | <100MB |
| App launch | <2 seconds |

Overview

This skill provides practical debugging techniques for iOS, Android, and cross-platform mobile apps. It focuses on crashes, memory leaks, performance bottlenecks, network issues, and native-bridge errors for frameworks like React Native. The content is aimed at developers who need concrete steps and tooling guidance to triage and fix production and development problems quickly.

How this skill works

The skill walks through platform-specific tools and commands: Xcode and LLDB tips for iOS, Android Studio and Logcat approaches for Android, and JavaScript debugging methods for React Native. It includes memory and performance profiling workflows, network request interception patterns, and a testing checklist to reproduce issues on real devices. Use the procedures to identify root causes, reproduce bugs reliably, and validate fixes against performance targets.

When to use it

  • Investigating app crashes or native exceptions on iOS or Android
  • Diagnosing memory leaks, retain cycles, or use-after-free bugs
  • Profiling frame drops, jank, or slow UI rendering in React Native
  • Tracing failed network requests, malformed payloads, or intermittent timeouts
  • Checking integration problems between native modules and JavaScript bridges

Best practices

  • Reproduce issues on physical devices and on older device models, not only simulators
  • Use targeted profiling: Memory Graph/Leaks on iOS, Memory Profiler on Android, and RN performance monitor for JS
  • Enable helpful runtime checks: Zombies on iOS, strict thread/error logging on Android, and verbose JS logging in dev builds
  • Simulate adverse network conditions (slow 3G, offline) before assuming server-side causes
  • Measure against concrete targets: 60 FPS, <100MB memory, and app launch under 2s

Example use cases

  • Find and fix a retain cycle using Xcode Memory Graph and Instruments > Leaks
  • Track an ANR by inspecting main-thread work in Android Studio and Logcat traces
  • Resolve dropped frames in React Native by using the Performance Monitor and reducing JS work per frame
  • Intercept and log outgoing requests to reproduce a flaky API error in a mobile environment
  • Debug a native bridge crash by capturing a backtrace (bt) in LLDB and correlating with JS logs

FAQ

How do I capture a native crash stack for iOS?

Run the app from Xcode, reproduce the crash, then use LLDB commands like bt to get a backtrace and po to inspect objects. Symbolicate crash logs if needed.

What’s the quickest way to find memory leaks on Android?

Use Android Studio Memory Profiler to record allocations and heap dumps, then inspect objects retained and investigate large or growing dominating references.

How can I measure React Native frame drops?

Open the Performance Monitor (shake device > Show Perf Monitor) and target 60 FPS with less than 16ms per frame; correlate spikes with JS work and native layout passes.