安装Adnroid官方Skills

安装 Android CLI 和 Android Skills

  1. 安装CLI

    官方教程是使用Android CLI来安装skills的,所以我们首先需要安装Android CLI。在Windows中,不支持在PowerShell中执行安装命令,需要在CMD中执行命令:

    复制代码
     curl.exe -fsSL https://dl.google.com/android/cli/latest/windows_x86_64/install.cmd -o "%TEMP%\i.cmd" && "%TEMP%\i.cmd" 

    这一步不需要使用代理。

    安装过程如下:

    复制代码
    D:\04_Workspace\ClaudeCode> curl.exe -fsSL https://dl.google.com/android/cli/latest/windows_x86_64/install.cmd -o "%TEMP%\i.cmd" && "%TEMP%\i.cmd"
    Installing android.exe...
    Downloading...
    Installing to C:\Users\daizh\AppData\AndroidCLI...
    移动了         1 个文件。
    Adding C:\Users\daizh\AppData\AndroidCLI to user PATH...
    Initializing CLI...
    Downloading Android CLI...
    ----------------------------------------
    Success! android is ready to use.
    C:\Users\daizh\AppData\AndroidCLI was added to the registry Path and the current cmd.
    ----------------------------------------

    这里显示下载了一个 android.exe 文件,并移动到了C:\Users\daizh\AppData\AndroidCLI目录,并把该目录配置到了环境变量,打开目录查看,真的是就只有一个android.exe文件,所以,如果安装失败的话,也可以找AI要离线下载的方法去下载这个android.exe文件,下载到之后把这个android.exe所在的目录配置到环境变量即可。

    可以使用android --version来验证是否安装成功,如下:

    复制代码
    D:\04_Workspace\ClaudeCode>android --version
    Unpacking embedded installation...
    Terms of Service and License Agreement for the Android Software Development Kit
    https://developer.android.com/studio/terms
    Google collects usage data for the Android CLI, such as commands, sub-commands, and flags used. This data does not include custom parameters or identifiable information. This information helps improve the tool and is collected in accordance with Google's Privacy Policy.
    https://policies.google.com/privacy
    Disable Android CLI metrics collection by using the --no-metrics flag.
    1.0.15498356

    最后一行的 1.0.15498356 即Android CLI的当前版本。

    使用 android update 可以开启检查更新,如果有新版本会自动更新,如下:

    复制代码
    C:\Users\daizh>android update
    Checking for updates...
    Already up-to-date with version 1.0.15498356.

    还可以使用android --help来查看 Andorid CLI的使用帮助:

    复制代码
    C:\Users\daizh>android --help
    Usage: android [-hV] [--sdk=PARAM] [COMMAND]
      -h, --help        Show this help message and exit.
          --sdk=PARAM   Path to the Android SDK
      -V, --version     Print version information and exit.
    Commands:
      create    Create a new Android project
      describe  Analyzes an Android project to generate descriptive metadata.
      docs      Android documentation commands
      emulator  Emulator commands
      help      Shows the help of all commands
      info      Print environment information (SDK Location, etc.)
      init      Initializes the environment (eg. skills) for Android CLI.
      layout    Returns the layout tree of an application
      run       Deploy an Android Application
      screen    Commands to view the device
      sdk       Download and list SDK packages
      skills    Manage skills
      studio    Android Studio commands
      update    Update the Android CLI

    更多信息请参考Android官方文档:https://developer.android.com/tools/agents/android-cli

  2. 安装到 Android CLI skill 到 Agent 中,以便Agent 知道如何调用Adnroid CLI,也就是说让Agent知道有一个 android.exe的存在,而且让Agent知道这个andnroid.exe(即Android CLI)能干什么,这样Agent在需要的时候才会去调用 andnroid.exe(即Android CLI)来干活。

    安装Android CLI skill:

    复制代码
    android init

    执行结果如下:

    复制代码
    D:\04_Workspace\ClaudeCode>android init
    Initializing android-cli skill...
    Skill 'android-cli' installed to C:\Users\daizh\.claude\skills\android-cli
    Skill 'android-cli' installed to C:\Users\daizh\.codebuddy\skills\android-cli
    Skill 'android-cli' installed to C:\Users\daizh\.openclaw\skills\android-cli
    Skill 'android-cli' installed to C:\Users\daizh\.qoder\skills\android-cli

    可以看到,Android CLI会自动检测电脑中已安装的Agent,并自动安装Android CLI skill到对应目录。由于我电脑上安装了四个Agent,所以上面结果中自动安装了4个位置:.claude、.codebuddy、.openclaw、.qoder,从这里也可以知道,各家Agent的skill都是放在一个skills的目录中,Android CLI 的 skill 名称为 android-cli(也是目录名称),里面是SKILL.mdreferences目录,这说明SKILL.md是通用的,所以可以Github上搜索skill,并按star排序,找一些排行高的,适合自己的,复制到自己的Agent中即可使用。

    这里还有一个新发现,我的用户目录下还有.qoder-cli.qoder-cn,不知道和.qoder目录有什么联系,阿里的qoder系列产品挺乱的,我有安装qoderIDECLI 版本,如果发现 CLI 版本无法使用 android CLI skill的话,随便从上面的一些目录中 复制 android-cli.qoder-cli.qoder-cnskills目录中即可,可自行尝试,我现在反正在用Claude Code,懒得去试 Qoder了。

  3. 安装 Android skills,这一步需要设置代理,否则无法安装,如下:

    复制代码
    D:\04_Workspace\ClaudeCode>android skills add --all
    Error downloading skills: release-assets.githubusercontent.com
    Skill 'android-cli' installed to C:\Users\daizh\.claude\skills\android-cli
    Skill 'android-cli' installed to C:\Users\daizh\.codebuddy\skills\android-cli
    Skill 'android-cli' installed to C:\Users\daizh\.openclaw\skills\android-cli
    Skill 'android-cli' installed to C:\Users\daizh\.qoder\skills\android-cli

    这里可以看到 Error downloading skills: release-assets.githubusercontent.com 下载失败了,于是我给 CMD配置了代理:

    复制代码
    set HTTPS_PROXY=http://127.0.0.1:8082
    set HTTP_PROXY=http://127.0.0.1:8082

    结果还是失败,我测试了代理是有效的:

    复制代码
    D:\04_Workspace\ClaudeCode>curl.exe -x http://127.0.0.1:8082 https://www.google.com -I
    HTTP/1.1 200 Connection established
    
    HTTP/1.1 200 OK

    有可能是Android CLI不走 cmd 配置的代理,于是我给jdk配置代理:

    复制代码
    set JAVA_TOOL_OPTIONS=-Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=8082 -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=8082

    然后再安装就成功了,而且从安装过程中也能看到确实使用了jdk中的代理了,安装过程如下:

    复制代码
    D:\04_Workspace\ClaudeCode>android skills add --all
    Picked up JAVA_TOOL_OPTIONS: -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=8082 -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=8082
    [========================================] 100% (679076/679076 bytes)
    Skill 'camera1-to-camerax' installed to C:\Users\daizh\.claude\skills\camera1-to-camerax
    Skill 'camera1-to-camerax' installed to C:\Users\daizh\.codebuddy\skills\camera1-to-camerax
    Skill 'camera1-to-camerax' installed to C:\Users\daizh\.openclaw\skills\camera1-to-camerax
    Skill 'camera1-to-camerax' installed to C:\Users\daizh\.qoder\skills\camera1-to-camerax
    Skill 'appfunctions' installed to C:\Users\daizh\.claude\skills\appfunctions
    Skill 'appfunctions' installed to C:\Users\daizh\.codebuddy\skills\appfunctions
    Skill 'appfunctions' installed to C:\Users\daizh\.openclaw\skills\appfunctions
    Skill 'appfunctions' installed to C:\Users\daizh\.qoder\skills\appfunctions
    Skill 'android-cli' installed to C:\Users\daizh\.claude\skills\android-cli
    Skill 'android-cli' installed to C:\Users\daizh\.codebuddy\skills\android-cli
    Skill 'android-cli' installed to C:\Users\daizh\.openclaw\skills\android-cli
    Skill 'android-cli' installed to C:\Users\daizh\.qoder\skills\android-cli
    Skill 'verified-email' installed to C:\Users\daizh\.claude\skills\verified-email
    Skill 'verified-email' installed to C:\Users\daizh\.codebuddy\skills\verified-email
    Skill 'verified-email' installed to C:\Users\daizh\.openclaw\skills\verified-email
    Skill 'verified-email' installed to C:\Users\daizh\.qoder\skills\verified-email
    Skill 'adaptive' installed to C:\Users\daizh\.claude\skills\adaptive
    Skill 'adaptive' installed to C:\Users\daizh\.codebuddy\skills\adaptive
    Skill 'adaptive' installed to C:\Users\daizh\.openclaw\skills\adaptive
    Skill 'adaptive' installed to C:\Users\daizh\.qoder\skills\adaptive
    Skill 'navigation-3' installed to C:\Users\daizh\.claude\skills\navigation-3
    Skill 'navigation-3' installed to C:\Users\daizh\.codebuddy\skills\navigation-3
    Skill 'navigation-3' installed to C:\Users\daizh\.openclaw\skills\navigation-3
    Skill 'navigation-3' installed to C:\Users\daizh\.qoder\skills\navigation-3
    Skill 'r8-analyzer' installed to C:\Users\daizh\.claude\skills\r8-analyzer
    Skill 'r8-analyzer' installed to C:\Users\daizh\.codebuddy\skills\r8-analyzer
    Skill 'r8-analyzer' installed to C:\Users\daizh\.openclaw\skills\r8-analyzer
    Skill 'r8-analyzer' installed to C:\Users\daizh\.qoder\skills\r8-analyzer
    Skill 'engage-sdk-integration' installed to C:\Users\daizh\.claude\skills\engage-sdk-integration
    Skill 'engage-sdk-integration' installed to C:\Users\daizh\.codebuddy\skills\engage-sdk-integration
    Skill 'engage-sdk-integration' installed to C:\Users\daizh\.openclaw\skills\engage-sdk-integration
    Skill 'engage-sdk-integration' installed to C:\Users\daizh\.qoder\skills\engage-sdk-integration
    Skill 'play-billing-library-version-upgrade' installed to C:\Users\daizh\.claude\skills\play-billing-library-version-upgrade
    Skill 'play-billing-library-version-upgrade' installed to C:\Users\daizh\.codebuddy\skills\play-billing-library-version-upgrade
    Skill 'play-billing-library-version-upgrade' installed to C:\Users\daizh\.openclaw\skills\play-billing-library-version-upgrade
    Skill 'play-billing-library-version-upgrade' installed to C:\Users\daizh\.qoder\skills\play-billing-library-version-upgrade
    Skill 'perfetto-sql' installed to C:\Users\daizh\.claude\skills\perfetto-sql
    Skill 'perfetto-sql' installed to C:\Users\daizh\.codebuddy\skills\perfetto-sql
    Skill 'perfetto-sql' installed to C:\Users\daizh\.openclaw\skills\perfetto-sql
    Skill 'perfetto-sql' installed to C:\Users\daizh\.qoder\skills\perfetto-sql
    Skill 'perfetto-trace-analysis' installed to C:\Users\daizh\.claude\skills\perfetto-trace-analysis
    Skill 'perfetto-trace-analysis' installed to C:\Users\daizh\.codebuddy\skills\perfetto-trace-analysis
    Skill 'perfetto-trace-analysis' installed to C:\Users\daizh\.openclaw\skills\perfetto-trace-analysis
    Skill 'perfetto-trace-analysis' installed to C:\Users\daizh\.qoder\skills\perfetto-trace-analysis
    Skill 'edge-to-edge' installed to C:\Users\daizh\.claude\skills\edge-to-edge
    Skill 'edge-to-edge' installed to C:\Users\daizh\.codebuddy\skills\edge-to-edge
    Skill 'edge-to-edge' installed to C:\Users\daizh\.openclaw\skills\edge-to-edge
    Skill 'edge-to-edge' installed to C:\Users\daizh\.qoder\skills\edge-to-edge
    Skill 'testing-setup' installed to C:\Users\daizh\.claude\skills\testing-setup
    Skill 'testing-setup' installed to C:\Users\daizh\.codebuddy\skills\testing-setup
    Skill 'testing-setup' installed to C:\Users\daizh\.openclaw\skills\testing-setup
    Skill 'testing-setup' installed to C:\Users\daizh\.qoder\skills\testing-setup
    Skill 'jetpack-compose-m3' installed to C:\Users\daizh\.claude\skills\jetpack-compose-m3
    Skill 'jetpack-compose-m3' installed to C:\Users\daizh\.codebuddy\skills\jetpack-compose-m3
    Skill 'jetpack-compose-m3' installed to C:\Users\daizh\.openclaw\skills\jetpack-compose-m3
    Skill 'jetpack-compose-m3' installed to C:\Users\daizh\.qoder\skills\jetpack-compose-m3
    Skill 'display-glasses-with-jetpack-compose-glimmer' installed to C:\Users\daizh\.claude\skills\display-glasses-with-jetpack-compose-glimmer
    Skill 'display-glasses-with-jetpack-compose-glimmer' installed to C:\Users\daizh\.codebuddy\skills\display-glasses-with-jetpack-compose-glimmer
    Skill 'display-glasses-with-jetpack-compose-glimmer' installed to C:\Users\daizh\.openclaw\skills\display-glasses-with-jetpack-compose-glimmer
    Skill 'display-glasses-with-jetpack-compose-glimmer' installed to C:\Users\daizh\.qoder\skills\display-glasses-with-jetpack-compose-glimmer
    Skill 'agp-9-upgrade' installed to C:\Users\daizh\.claude\skills\agp-9-upgrade
    Skill 'agp-9-upgrade' installed to C:\Users\daizh\.codebuddy\skills\agp-9-upgrade
    Skill 'agp-9-upgrade' installed to C:\Users\daizh\.openclaw\skills\agp-9-upgrade
    Skill 'agp-9-upgrade' installed to C:\Users\daizh\.qoder\skills\agp-9-upgrade
    Skill 'migrate-xml-views-to-jetpack-compose' installed to C:\Users\daizh\.claude\skills\migrate-xml-views-to-jetpack-compose
    Skill 'migrate-xml-views-to-jetpack-compose' installed to C:\Users\daizh\.codebuddy\skills\migrate-xml-views-to-jetpack-compose
    Skill 'migrate-xml-views-to-jetpack-compose' installed to C:\Users\daizh\.openclaw\skills\migrate-xml-views-to-jetpack-compose
    Skill 'migrate-xml-views-to-jetpack-compose' installed to C:\Users\daizh\.qoder\skills\migrate-xml-views-to-jetpack-compose
    Skill 'styles' installed to C:\Users\daizh\.claude\skills\styles
    Skill 'styles' installed to C:\Users\daizh\.codebuddy\skills\styles
    Skill 'styles' installed to C:\Users\daizh\.openclaw\skills\styles
    Skill 'styles' installed to C:\Users\daizh\.qoder\skills\styles

    可以看到,它是会安装到所有能检测到的Agent中,查看~/.claude/skills目录,如下:

    复制代码
    adaptive
    agp-9-upgrade
    android-cli
    appfunctions
    camera1-to-camerax
    display-glasses-with-jetpack-compose-glimmer
    edge-to-edge
    engage-sdk-integration
    jetpack-compose-m3
    migrate-xml-views-to-jetpack-compose
    navigation-3
    perfetto-sql
    perfetto-trace-analysis
    play-billing-library-version-upgrade
    r8-analyzer
    styles
    testing-setup
    verified-email

    可以看到,一共安装了19个Android skills(其实是18个,android-cli 是最开始就安装的),每个skill目录里面就是一个SKILL.md文件和一个references目录,SKILL.md用于告诉Agent能干什么和怎么干,references目录中应该就是执行该技能时需要的一些资源文件,所以,如果你没有代理,无法完成代理安装,也可以自己手动下载然后复制相应的skill到对应目录即可(我并没有这么试过,大家可以自行尝试),官方 skill 的 Github 为:

    https://github.com/android/skills

    有时候不使用代理,Github也是可以访问的,多试试,如果实在不行,我在Gitee上也克隆了一份:

    https://gitee.com/daizhufei/android-skills

    Android官网对技能有此描述:

    为了使 SKILL.md 文件简洁且模块化,您可以在技能文件夹中的以下可选目录中添加其他资源:

    • scripts/:包含智能体可以运行的可执行代码(例如 Python 或 Bash)。
    • references/:包含详细的技术文档、API 参考或特定于领域的指南。
    • assets/:包含静态资源,例如文档模板、界面图或 JSON 架构。

    SKILL.md 指令中引用这些文件时,请使用相对于技能根目录的相对路径。例如:Run the script at scripts/cleanup.py

  4. 列出最新Android skills

    复制代码
    android skills list

    这个操作是从网上获取skills列表的,所以也需要配置jdk代理才能返回结果,如下:

    复制代码
    D:\04_Workspace\ClaudeCode>android skills list
    Picked up JAVA_TOOL_OPTIONS: -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=8082 -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=8082
    camera1-to-camerax
    appfunctions
    android-cli
    verified-email
    adaptive
    navigation-3
    r8-analyzer
    engage-sdk-integration
    play-billing-library-version-upgrade
    perfetto-sql
    perfetto-trace-analysis
    edge-to-edge
    testing-setup
    jetpack-compose-m3
    display-glasses-with-jetpack-compose-glimmer
    agp-9-upgrade
    migrate-xml-views-to-jetpack-compose
    styles

Android CLI 能干什么

可以看官方,但是比较慢,这里我复制一份我在ChatGPT的提问:

在配置 Claude Code 的CLAUDE.md时有:

复制代码
 ## Android CLI 
 - 构建用: android build 
 - 部署用: android deploy
 - 设备管理: android device 

我怎么知道哪些功能有哪些CLI,常用这个Android CLI有哪些,给我列出来?

下面是ChatGPT回答:

Google 在 2026 年 4 月官方发布的新一代:Android CLI

这是 Android 官方推出的 AI/Agent 化 Android 开发 CLI。

官方定位是:

"Android development from the terminal, built for agents."

(为 AI Agent 设计的 Android 开发命令行)

而且 Google 明确提到支持:


你问的核心问题

"我怎么知道 Android CLI 有哪些命令?"

这个现在官方已经有完整体系了。


官方文档入口

Android CLI 官方主页

Android CLI Overview

下载页

Android CLI Download

Release Notes

Android CLI Release Notes


目前 Android CLI 的命令体系

Google 现在把 Android CLI 分成几个模块:

分类 用途
android project 项目
android build 构建
android device 设备
android emulator 模拟器
android test 测试
android docs 文档知识库
android studio Android Studio Agent能力
android journey 用户流程自动化
android skills AI Skills
android sdk SDK管理

一、最核心的 CLI

这些是目前最常用的。


project

创建项目

复制代码
android project create

或者:

复制代码
android init

这个是 Agent 初始化 Android 工程。


分析项目

复制代码
android project analyze

让 AI 理解:

  • Gradle
  • AGP
  • modules
  • dependencies
  • flavors

build

构建 APK

复制代码
android build

构建 release

复制代码
android build release

构建 AAB

复制代码
android build bundle

clean

复制代码
android build clean

device

这是现在最重要的一组。


查看设备

复制代码
android device list

替代:

复制代码
adb devices

安装 APK

复制代码
android device install app.apk

启动 App

复制代码
android device launch

查看日志

复制代码
android device logs

shell

复制代码
android device shell

截图

复制代码
android device screenshot

录屏

复制代码
android device record

emulator


模拟器列表

复制代码
android emulator list

启动模拟器

复制代码
android emulator start Pixel_9

停止模拟器

复制代码
android emulator stop

test


单元测试

复制代码
android test

UI测试

复制代码
android test connected

Compose测试

复制代码
android test compose

docs(非常重要)

这是 Android CLI 最 AI 化的部分。


查询官方文档

复制代码
android docs camerax

或者:

复制代码
android docs mediacodec surface input

这个会:

  • 自动查 Android 官方文档
  • 返回适合 AI 的结构化结果
  • 比普通网页搜索 token 更少

Google 说 Android CLI 最大优势之一就是:

给 AI 提供结构化 Android Knowledge Base。


skills(你现在 CLAUDE.md 最相关)

这是你现在真正需要理解的。


什么是 Android Skills?

Google 官方说:

Android skills 是给 AI Agent 的"专业能力模块"。

类似:

  • CameraX expert
  • Compose expert
  • Adaptive UI expert
  • AppFunctions expert

查看 Skills

复制代码
android skills list

安装 Skill

复制代码
android skills install camerax

搜索 Skill

复制代码
android skills search compose

查看 Skill 详情

复制代码
android skills info camerax

现在你最关心的问题:

"怎么知道有哪些 CLI?"

官方推荐就是:

复制代码
android --help

以及:

复制代码
android <subcommand> --help

例如:

复制代码
android device --help
android skills --help
android docs --help

另外一个非常重要的命令

查看全部命令树

复制代码
android help

或者:

复制代码
android commands

有些版本支持。


Android CLI 和传统工具的关系

Android CLI 并不是替代:

  • adb
  • gradle
  • emulator

而是:

Agent-Friendly Wrapper

Google 官方说得很明确:

它是:

为 AI Agent 优化的统一接口。

也就是说:

Android CLI 底层
android build gradlew
android device adb
android emulator emulator
android sdk sdkmanager
android docs Android KB
android studio Android Studio API

Android Studio Commands(新东西)

这是 1.0 版刚加入的。


调用 Android Studio

复制代码
android studio analyze

Compose Render

复制代码
android studio compose-preview

Semantic Lookup

复制代码
android studio lookup MainActivity

这意味着:

Claude Code 能直接借 Android Studio 的 IDE 能力。

这非常强。


Journeys(AI自动用户流程)

Google I/O 2026 新增。


运行用户流程

复制代码
android journey run login-flow

AI 自动:

  • 启动App
  • 点击
  • 输入
  • 截图
  • 验证

有点像:

  • Maestro
  • UIAutomator
  • Espresso

的 AI 化版本。


我建议你现在重点掌握这些

这是目前 Android CLI 最实用的一套:

复制代码
android build
android device list
android device logs
android device screenshot
android emulator start
android test
android docs
android skills list
android studio analyze

还有一个关键点

你在 CLAUDE.md 里写:

复制代码
## Android CLI

- build: android build
- deploy: android device install
- logs: android device logs
- docs: android docs
- skills: android skills list

会比:

复制代码
- android deploy

更准确。

因为现在官方很多命令已经规范化到:

复制代码
android <module> <action>

结构了。


最后一个关键事实

Android CLI 本质是:

Android 官方 MCP / Agent Toolchain

很多人现在已经把它看成:

  • Android MCP
  • Android Agent Runtime
  • Android AI Toolchain

因为它不是给人优化的。

是给:

  • Claude
  • Gemini
  • Codex
  • Cursor Agent

优化的.

相关推荐
小七-七牛开发者6 小时前
周一上线|瑞幸把咖啡做进 CLI,Fable 5 短暂登场,Stonk Rider 骑上 K 线图
ai·chatgpt·大模型·agent·claude·codex·skill·claudecode·ai coding
cup1118 小时前
SKILL 第一定律:说点 AI 不知道的
ai·prompt·编程·skill
小七-七牛开发者1 天前
Codex 实践系列 Vol.02:让 Codex 读懂开源项目 Typer
ai·chatgpt·openai·agent·工作流·codex·skill·ai coding
MuGuiLin1 天前
在VS Code 中安装 Claude Code 并接入 DeepSeek 模型和 Skills 的使用
ai编程·claude code·ai coding·skills·cc-switch·omc·claude code cli
ShyanZh2 天前
【skill】HTML PPT Skill:用 Claude Code 一句话生成专业演示文稿
前端·ai·html·powerpoint·skill
key_3_feng2 天前
如何在 ClawHub 上发布 Skill:从打包到上架的全流程方案
skill·clawhub
砍光二叉树3 天前
一文打通 AI 认知:LLM、Agent、MCP、Skill 完整体系
人工智能·llm·agent·skill·mcp
东方隐侠安全团队-千里3 天前
币安Skills Hub:散户的“机构级超能力“来了
安全·ai·区块链·skills
腾讯位置服务4 天前
4月产品上新|魔方洞察、智能选址、打车服务三大Skills上线,两轮车熄屏导航同步升级!
大数据·开发·skill·龙虾·腾讯位置服务