【问题标题】:Unzip files in phone from ADB terminal从 ADB 终端解压缩手机中的文件
【发布时间】:2021-08-08 22:38:22
【问题描述】:

我正在尝试从终端 (Ubuntu 20.04) 使用 ADB 解压缩我的 android (11) 手机中的文件。我需要从我的 Ubuntu 笔记本电脑上运行一个脚本来解压缩手机上的文件。

我已经从this 的建议中尝试过Busybox。使用这个应用程序,我可以在访问 shell 后解压缩文件。我的意思是-

$ adb shell                
a60q:/ $ cd /sdcard/
a60q:/sdcard $ unzip data.zip                                            
Archive:  data.zip
  inflating: Screenshot from 2020-11-30 16-45-46 (7th copy).png
  inflating: Screenshot from 2020-11-30 16-45-46 (10th copy).png

但是当我尝试使用直接命令时,它会显示错误。

$ adb shell unzip /sdcard/data.zip
unzip: couldn't create file Screenshot from 2020-11-30 16-45-46 (7th copy).png: Read-only file system
Archive:  /sdcard/data.zip

Root 手机不是一种选择。我的问题是 -

  1. 如何从终端解压?
  2. 是否有任何工具可以从终端制作压缩的 zip 文件(在 Android 中)?

【问题讨论】:

    标签: android zip adb busybox


    【解决方案1】:

    为了从终端成功调用unzip 命令,您应该明确指定将提取 zip 内容的文件夹,例如:

    adb shell unzip /sdcard/data.zip -d /sdcard
    

    通过调用unzip --help,您还将获得有关其他可用参数的更多信息。

    【讨论】:

      猜你喜欢
      • 2021-12-29
      • 1970-01-01
      • 2015-10-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-09-05
      • 1970-01-01
      相关资源
      最近更新 更多