← 返回
效率工具 中文

Android Studio

Master Android Studio IDE with debugging, profiling, refactoring, and productivity shortcuts.
熟练掌握 Android Studio IDE,包括调试、性能分析、重构和提升效率的快捷键。
ivangdavila
效率工具 clawhub v1.0.1 1 版本 99906.2 Key: 无需
★ 2
Stars
📥 1,025
下载
💾 98
安装
1
版本
#latest

概述

Setup

On first use, read setup.md for integration guidelines.

When to Use

User works with Android Studio IDE. Agent helps with debugging tools, profiler, layout inspector, code navigation, refactoring, and keyboard shortcuts.

Architecture

Memory at ~/android-studio/. See memory-template.md for structure.

~/android-studio/
├── memory.md      # Preferences and project context
└── shortcuts.md   # Custom shortcuts learned

Quick Reference

TopicFile
-------------
Setup processsetup.md
Memory templatememory-template.md
Shortcutsshortcuts.md
Debuggingdebugging.md

Core Rules

1. Check IDE Version First

Before suggesting features, confirm Android Studio version. Features vary significantly between Arctic Fox, Bumblebee, Flamingo, Hedgehog, and newer versions.

2. Platform-Aware Shortcuts

ActionmacOSWindows/Linux
------------------------------
Search EverywhereDouble ShiftDouble Shift
Find ActionCmd+Shift+ACtrl+Shift+A
Recent FilesCmd+ECtrl+E
Navigate to ClassCmd+OCtrl+N
Navigate to FileCmd+Shift+OCtrl+Shift+N
Refactor ThisCtrl+TCtrl+Alt+Shift+T
RunCtrl+RShift+F10
DebugCtrl+DShift+F9

3. Use IDE Tools Over Manual Inspection

  • Layout Inspector over print debugging for UI issues
  • Profiler over manual timing for performance
  • Database Inspector over manual queries
  • Network Inspector over logging requests

4. Leverage Code Generation

  • Live Templates for boilerplate (type abbreviation + Tab)
  • File Templates for new components
  • Generate menu (Cmd/Alt+N) for constructors, getters, overrides

5. Debugging Strategy

  1. Breakpoints with conditions for targeted debugging
  2. Evaluate Expression (Alt+F8) for runtime inspection
  3. Watches for tracking variables across frames
  4. Frame inspection to navigate call stack

Debugging Traps

  • Setting breakpoints in hot loops → freezes IDE. Use conditional breakpoints.
  • Debugging release builds → missing symbols. Debug with debug variant.
  • Ignoring Logcat filters → drowning in logs. Filter by app package or tag.
  • Not using "Attach Debugger" → missing app startup. Attach to running process.

Profiling Traps

  • Profiling debug builds → misleading performance. Profile release builds.
  • CPU Profiler without filtering → overwhelming data. Focus on specific methods.
  • Memory Profiler heap dumps during GC → skewed results. Trigger GC first.
  • Ignoring Network Profiler → missing slow API calls. Always check network timing.

Essential IDE Features

Layout Inspector

  • Inspect live view hierarchy in running app
  • 3D mode for seeing layer depth
  • Attribute inspection for debugging constraints
  • Works with Compose and View system

Database Inspector

  • Query Room databases in real-time
  • Edit values directly for testing
  • Export data for analysis
  • Requires API 26+ on device

Network Inspector

  • Inspect OkHttp/Retrofit requests without code changes
  • View request/response bodies
  • Timeline for identifying slow calls
  • Requires enabling in manifest for release

App Inspection

  • Combined view of Database, Network, Background Tasks
  • WorkManager task monitoring
  • Background task scheduling inspection

Profiler Tools

ToolUse Case
----------------
CPU ProfilerMethod timing, thread analysis
Memory ProfilerLeaks, allocation tracking
Energy ProfilerBattery usage patterns
Network ProfilerRequest timing, payload size

Refactoring Shortcuts

RefactoringmacOSWindows/Linux
-----------------------------------
RenameShift+F6Shift+F6
Extract MethodCmd+Alt+MCtrl+Alt+M
Extract VariableCmd+Alt+VCtrl+Alt+V
Extract ConstantCmd+Alt+CCtrl+Alt+C
InlineCmd+Alt+NCtrl+Alt+N
MoveF6F6
Change SignatureCmd+F6Ctrl+F6

Build Configuration

Gradle Sync Issues

  • File → Invalidate Caches / Restart for persistent issues
  • Delete .gradle and .idea folders as last resort
  • Check Gradle JDK in Preferences → Build → Gradle

Build Variants

  • Select variant in Build Variants panel
  • Debug vs Release affects debugging capabilities
  • Product flavors for different app configurations

SDK Manager

  • Tools → SDK Manager for Android SDK updates
  • Install platform tools matching target devices
  • Keep build tools updated for latest features

Emulator Tips

  • Cold Boot vs Quick Boot: use Quick Boot for speed
  • Extended Controls (three dots) for sensors, location, battery
  • Snapshots for saving specific device states
  • Device mirroring for physical device control

Plugin Recommendations

PluginPurpose
-----------------
Key Promoter XLearn shortcuts
Rainbow BracketsBracket matching
ADB IdeaQuick ADB commands
JSON To Kotlin ClassData class generation
Compose Color PreviewColor visualization

Related Skills

Install with clawhub install if user confirms:

  • android — Android development patterns
  • kotlin — Kotlin language features
  • java — Java language patterns

Feedback

  • If useful: clawhub star android-studio
  • Stay updated: clawhub sync

版本历史

共 1 个版本

  • v1.0.1 当前
    2026-03-29 15:40 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

productivity

Weather

steipete
获取当前天气和预报(无需API密钥)
★ 446 📥 226,530
productivity

Word / DOCX

ivangdavila
创建、检查和编辑 Microsoft Word 文档及 DOCX 文件,支持样式、编号、修订记录、表格、分节符及兼容性检查等功能。
★ 440 📥 148,377
productivity

Baidu web search

ide-rea
使用百度AI搜索引擎(BDSE)进行网络搜索。适用于获取实时信息、文档资料或研究课题。
★ 239 📥 105,873