mcpField
M
mobile-app-debugging

mobile-app-debugging

github.com/secondsky开发240433 次安装5 周前更新
代码仓库

关于 mobile-app-debugging

mobile-app-debugging 是用于排查 iOS、Android 和跨平台框架应用问题的参考技能,涵盖平台专属调试工具,以及内存、网络、性能和常见故障检查。

主要功能

  1. 01使用 Xcode 和 LLDB 调试 iOS
  2. 02诊断 Android 日志与布局问题
  3. 03提供 React Native 调试指引
  4. 04介绍内存与网络调试方法
  5. 05检查设备、性能及离线运行

适用场景

  1. 01调查 iOS 崩溃或内存问题
  2. 02诊断 Android ANR 和布局异常
  3. 03排查 React Native 行为问题
  4. 04检查应用性能和离线运行情况

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/secondsky/claude-skills --skill mobile-app-debugging

安装后在 Claude Code 中输入/mobile-app-debugging确认已加载。

详细介绍

移动应用调试

调试 iOS、Android 和跨平台框架上的移动应用。

iOS 调试(Xcode)

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

// LLDB commands
po variable          // Print object
p expression         // Evaluate expression
bt                   // Backtrace
内存调试
  • 使用 Memory Graph Debugger 查找保留环
  • 启用 Zombie Objects,排查释放后使用错误
  • 使用 Instruments > Leaks 进行性能分析

Android 调试(Android Studio)

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

// Filter: tag:MyApp level:error
常见问题
  • ANR:检查主线程是否被阻塞
  • OOM:使用 Memory Profiler 进行性能分析
  • 布局问题:使用 Layout Inspector

React Native

// 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

网络调试

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

调试检查清单

  • 在实体设备上测试(不只是模拟器)
  • 在较旧的设备型号上测试
  • 模拟较慢的 3G 网络
  • 测试离线模式
  • 检查负载下的内存占用
  • 测试屏幕旋转和安全区域
  • 确认达到 60 FPS 目标

性能目标

指标目标
帧率60 FPS(16ms/帧)
内存<100MB
应用启动<2 秒

评论

支持 Markdown