You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Android Studio中Pixel 2 API 19设备根目录访问失败:sh: stat: not found

解决Device Explorer访问API 19模拟器报sh: stat: not found的问题

问题根源

Android 4.4(API 19)的系统镜像默认不带stat命令,而Android Studio Hedgehog版本的Device Explorer在遍历设备目录时依赖这个命令。高版本系统镜像(比如API23、26)自带该命令,所以不会出现报错。

解决方案

  • 手动给API 19模拟器添加stat命令

    1. 启动Pixel 2 API 19模拟器,打开终端执行adb shell进入设备shell环境
    2. 重新挂载系统分区为可读写:mount -o remount,rw /system
    3. 先通过adb devices查看设备名称,从API23的模拟器中拉取stat文件:adb -s <API23设备名> pull /system/bin/stat
    4. 将拉取到的stat推送到API19模拟器:adb -s <API19设备名> push stat /system/bin/
    5. 修改文件权限:adb -s <API19设备名> shell chmod 755 /system/bin/stat
    6. 重启API19模拟器,再打开Device Explorer即可正常访问
  • 降级Android Studio版本
    若不想折腾命令行,可卸载当前Hedgehog版本,安装之前能正常访问API19模拟器的旧版本(比如Giraffe),操作前记得备份项目配置和SDK相关文件。

  • 用adb命令行替代Device Explorer
    临时使用命令行完成文件操作:

    • 查看目录:adb shell ls /sdcard/
    • 拉取文件:adb pull /sdcard/example.txt ./
    • 推送文件:adb push ./example.txt /sdcard/

内容的提问来源于stack exchange,提问作者bighugedev

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.02 14:37:34