简体   繁体   English

如何通过命令行工具从Android中的rar文件中提取文件

[英]How to extract files from rar file in Android by command line tool

As title says, I need to extract files from .rar file and save it on device storage. 如标题所述,我需要从.rar文件中提取文件并将其保存在设备存储中。 There are third party tools which supports this. 有支持此功能的第三方工具。 But I was wondering is there any adb /appium /android utility command which provides this functionality ? 但是我想知道是否有提供此功能的adb / appium / android实用程序命令?

There's no way to do this without using a third party tool or app. 如果不使用第三方工具或应用程序,则无法做到这一点。 See the Android Developer reference for ADB . 请参阅ADBAndroid开发人员参考

If use of third party tools is not out of the question for you (you refer to Appium, after all), and you just want to be able to extract the .rar file from the command line, you might try installing an app which can extract .rar files (there are many) and access the correct activity from the command line using the activity manager. 如果不是不可能使用第三方工具(毕竟,您指的是Appium),并且您只想能够从命令行中提取.rar文件,则可以尝试安装一个可以提取.rar文件(有很多),并使用活动管理器从命令行访问正确的活动。 You can view the activities available to you for a given APK using the Android Asset Packaging Tool and this command: 您可以使用Android Asset Packaging Tool和以下命令查看给定APK可用的活动:

aapt dump xmltree <path to APK> AndroidManifest.xml

I would install busybox on your device. 我会在您的设备上安装busybox This will give you all the commands needed to allow for unzipping the files on your phone. 这将为您提供所有允许在手机上解压缩文件所需的命令。 Just disable auto update if you are worried about the application updating. 如果您担心应用程序更新,只需禁用自动更新。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM