Mobile Toolchain Unifier 标志

Mobile Toolchain Unifier

社区
Harishwarrior
mobile-toolchain-unifier

Audits, unifies, and optimizes mobile development environments and toolchains across a drive (Android, Flutter, iOS). Consolidates fragmented NDKs, SDK platforms, Gradle distributions, Flutter SDKs (FVM), and Java/JVM daemon versions to the latest stable releases, verifies project builds, reclaims tens of gigabytes of disk space, aggressively trims emulator bloatware using avdslim while preserving Play Store, and creates instant-boot Golden Snapshots. Use whenever the user asks to clean, unify, upgrade, or optimize Android SDKs, NDKs, Gradle wrappers, Java/JVM daemons, iOS simulator runtimes, or mobile emulator environments.

概览

发布者Harishwarrior
代码仓库flutter-claude-skills
技能名称mobile-toolchain-unifier
星标数
68
复刻数
6
附带文件
3
许可协议MIT
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 3 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 Harishwarrior 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Mobile Toolchain Unifier AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/Harishwarrior/flutter-claude-skills/tree/main/mobile-toolchain-unifier
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Harishwarrior/flutter-claude-skills.git /tmp/flutter-claude-skills
mkdir -p .claude/skills
cp -r /tmp/flutter-claude-skills/mobile-toolchain-unifier .claude/skills/mobile-toolchain-unifier
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Mobile Toolchain Unifier,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Mobile Toolchain Unifier。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Mobile Toolchain Unifier 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Mobile Toolchain Unifier

A comprehensive skill for auditing, unifying, and reclaiming disk space across multi-project mobile development workspaces (Flutter, Android native, and iOS).

Overview

Over time, active mobile development machines accumulate duplicate SDKs, conflicting Gradle versions, multiple Java daemons, redundant NDKs, bloated system images, and gigabytes of orphaned simulator runtimes.

This skill provides an automated, non-destructive workflow to:

  1. Audit & Discover: Find all mobile projects across the drive and inventory their toolchain versions.
  2. Unify & Pin: Align all projects onto the latest stable common denominators (Gradle wrapper, AGP, Java LTS, NDK, SDK platforms, Flutter FVM).
  3. Verify Builds: Test compilation across all projects to ensure zero breaking changes.
  4. Purge Obsolete Assets: Remove older toolchain copies, Gradle caches, and legacy simulator runtimes, saving 20–80+ GB of disk space.
  5. Optimize Emulators: Build ultra-lightweight Android emulators with avdslim, uninstall bloatware while keeping Google Play Services & Play Store, and bake <1.5s Golden Snapshots.

Reference Guides

DomainReference file
AGP, Gradle, Java, NDK & compileSdk Matrixreferences/android_toolchain_matrix.md
Bloatware Removal, Play Store & avdslim Guidereferences/emulator_slimming_guide.md
Apple Simulator Slimming & simslim Guidereferences/simslim_optimization_guide.md

6-Phase Workflow

Phase 1: Audit & Discovery

Scan the drive for all active mobile projects and toolchains.

1. Discover Projects
bash
# Locate Gradle and Flutter configurations across Developer directories
find ~/Developer -maxdepth 5 \( -name "build.gradle" -o -name "build.gradle.kts" -o -name ".fvmrc" \) -not -path "*/build/*" -not -path "*/.gradle/*"
2. Inventory Installed Toolchains
bash
# Android SDK components
sdkmanager --list_installed

# Flutter FVM versions
ls -lh ~/fvm/versions/

# Java runtimes and daemon JVMs
java -version
/usr/libexec/java_home -V
cat ~/.gradle/gradle.properties

# iOS CoreSimulator runtimes and disk images
xcrun simctl runtime list

Phase 2: Toolchain Unification

Consolidate all discovered projects onto unified versions:

1. Android NDK
  • Inspect pinned ndkVersion in every build.gradle.kts / build.gradle.
  • Pin to the latest installed stable release (e.g. 30.0.16248370 / NDK r30).
  • Ensure projects without explicit ndkVersion declare it to prevent Android Gradle Plugin from auto-downloading legacy fallbacks.
2. Gradle Wrapper & Android Gradle Plugin (AGP)
  • Upgrade gradle/wrapper/gradle-wrapper.properties in all projects to the latest stable release (e.g. gradle-9.8.2-bin.zip).
  • Align AGP in settings.gradle.kts / root build.gradle (e.g. AGP 9.4.x / 9.5.x) to ensure compatibility with Gradle 9.6+.
  • Align Kotlin Gradle Plugin (org.jetbrains.kotlin.android) to 2.4.x to match AGP 9.
3. Java / JVM Daemon Alignment

Prevent Gradle from spawning multiple incompatible daemon JVMs:

  • In ~/.zshrc, point JAVA_HOME and PATH to the latest LTS JDK (e.g. Java 21 LTS):
    bash
    export JAVA_HOME="$HOME/.gradle/jdks/eclipse_adoptium-21-aarch64-os_x.2/jdk-21.0.7+6/Contents/Home"
    export PATH="$JAVA_HOME/bin:$PATH"
  • In ~/.gradle/gradle.properties, set matching daemon JVM:
    properties
    org.gradle.java.home=/path/to/jdk-21/Contents/Home
  • In each project's build.gradle.kts, standardize compatibility:
    kotlin
    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_21
        targetCompatibility = JavaVersion.VERSION_21
    }
    tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
        compilerOptions {
            jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_21)
        }
    }
4. Flutter SDK (FVM)
  • Update all .fvmrc files to point to the latest installed Flutter release (e.g. 3.47.8).
  • Update pubspec.yaml environment constraints:
    yaml
    environment:
      sdk: 3.13.7
      flutter: 3.47.8
  • Update local.properties in Flutter Android modules:
    properties
    flutter.sdk=/Users/<user>/fvm/versions/3.47.8

Phase 3: Build Verification

Never delete or finalize before verifying that all projects build cleanly:

bash
# 1. Flutter dependencies
cd <project> && fvm flutter pub get

# 2. Native Android compilation
cd <project>/android && ./gradlew assembleDebug

# 3. Verify Daemon JVM reuse
./gradlew --status

Look for: Launcher JVM: 21.x and Daemon JVM: 21.x matching across every run.


Phase 4: Disk Reclamation & Pruning

Once builds are verified, safely eliminate redundant older assets:

bash
# 1. Remove older NDK directories
rm -rf ~/Library/Android/sdk/ndk/<older-version>

# 2. Remove older SDK platforms and system images
rm -rf ~/Library/Android/sdk/platforms/android-{34,35,36}
rm -rf ~/Library/Android/sdk/system-images/android-{34,35,36}

# 3. Clean older Gradle wrapper distributions (frees 1-3 GB)
rm -rf ~/.gradle/wrapper/dists/gradle-{8.*,9.0.*,9.3.*,9.6.*}

# 4. Clean obsolete Gradle version caches (frees 10-25+ GB)
rm -rf ~/.gradle/caches/{9.0.0,9.3.1,9.6.0}

# 5. Remove older Flutter FVM SDKs (frees ~2.2 GB per version)
rm -rf ~/fvm/versions/<older-version>

# 6. Clean unneeded simulator runtimes (frees 20-60+ GB)
xcrun simctl runtime delete <runtime-uuid>
xcrun simctl delete unavailable

Phase 5: Android Emulator Optimization (avdslim)

Create a lightning-fast, ultra-low-RAM single emulator instance:

  1. Delete All Existing AVDs:

    bash
    avdmanager delete avd -n <old_avd>
  2. Select Google APIs Image (4 KB page size):

    • Prefer system-images;android-<latest>;google_apis;arm64-v8a.
    • Avoid Google Play production images (blocks adb root and runs heavy background security scanners).
    • Avoid 16 KB page size images (forces QEMU to allocate $\ge$ 4096 MB RAM).
  3. Create Pre-Tuned AVD:

    bash
    avdslim create Slim_Pixel --api=<latest> --ram=1536
  4. Uninstall Bloatware While Preserving Play Store:

    • Boot the emulator headlessly with low-memory host flags:
      bash
      emulator -avd Slim_Pixel -memory 1536 -gpu host -no-audio -camera-back none -camera-front none -no-boot-anim -lowram -no-window
    • Elevate ADB daemon to root:
      bash
      adb root
    • Enable Google Play Store (com.android.vending):
      bash
      adb shell pm enable com.android.vending
    • Completely uninstall all bloatware for user 0 (see list in references/emulator_slimming_guide.md):
      bash
      adb shell "for pkg in \$(pm list packages -d | sed 's/package://'); do if [ \"\$pkg\" != 'com.android.vending' ]; then pm uninstall --user 0 \"\$pkg\"; fi; done"
  5. Capture Golden Snapshot & Install Shim:

    bash
    # Snapshot live state (<1.5s restore)
    avdslim snap
    
    # Gracefully shut down
    avdslim stop
    
    # Install Android Studio wrapper shim
    avdslim install-shim

Phase 6: iOS & Apple Simulator Optimization (simslim)

Prune runtimes and slim remaining simulators to reduce disk and idle RAM consumption:

  1. Prune Outdated Runtimes:

    bash
    # List installed runtime disk images
    xcrun simctl runtime list
    
    # Delete outdated runtimes (frees 10-60+ GB)
    xcrun simctl runtime delete <UUID>
  2. Consolidate Device Fleet:

    • Prune devices down to 2 primary target devices (e.g. 1 modern iPhone and 1 iPad Pro) and delete all other device UUIDs:
    bash
    xcrun simctl delete <UUID>
    xcrun simctl delete unavailable
  3. Slim Simulators with simslim:

    • Configure persistent launchd disable overrides for 168 non-essential background daemons:
    bash
    simslim on <UDID> --preserve-boot-state
  4. Reclaim Disk Space (disk-clean):

    • Purge accumulated caches, diagnostic logs, and temporary files:
    bash
    simslim disk-clean <UDID> --categories caches,logs,temporary,linguistic-data --confirm

    Drops individual simulator storage down to ~56 MB.

  5. Verify and Monitor:

    bash
    # Measure allocated disk size
    simslim size <UDID>
    
    # Live fleet memory and CPU monitor
    simslim top

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Mobile Toolchain Unifier AI 技能有什么作用?

Audits, unifies, and optimizes mobile development environments and toolchains across a drive (Android, Flutter, iOS). Consolidates fragmented NDKs, SDK platforms, Gradle distributions, Flutter SDKs (FVM), and Java/JVM daemon versions to the latest stable releases, verifies project builds, reclaims tens of gigabytes of disk space, aggressively trims emulator bloatware using avdslim while preserving Play Store, and creates instant-boot Golden Snapshots. Use whenever the user asks to clean, unify, upgrade, or optimize Android SDKs, NDKs, Gradle wrappers, Java/JVM daemons, iOS simulator runtime...

为什么在 TypingMind 中使用 Mobile Toolchain Unifier?

因为您只需安装一次,就能搭配任何模型使用。Mobile Toolchain Unifier 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Mobile Toolchain Unifier?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/Harishwarrior/flutter-claude-skills/tree/main/mobile-toolchain-unifier。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Mobile Toolchain Unifier?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Mobile Toolchain Unifier 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Mobile Toolchain Unifier 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Mobile Toolchain Unifier AI 技能免费吗?

是的。Harishwarrior 已在 GitHub 上根据 MIT 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇