adb:统计 apk 失败:没有这样的文件或目录

问题描述 投票:0回答:1

尝试在 WSL(linux 下的 windows 子系统)下使用 buildozer 安装 APK 时,我得到:

joachim@Laptop-MJ:/mnt/d/Joachim/PycharmProjects/takePicture$ /home/joachim/.buildozer/android/platform/android-sdk/platform-tools/adb install -r "/mnt/d/Joachim/PycharmProjects/takePicture/bin/takepicture-0.1-arm64-v8a_armeabi-v7a-debug.apk"
Performing Streamed Install
adb: failed to stat /mnt/d/Joachim/PycharmProjects/takePicture/bin/takepicture-0.1-arm64-v8a_armeabi-v7a-debug.apk: No such file or directory

但是当我运行 stat 时,我得到了相同的文件:

joachim@Laptop-MJ:/mnt/d/Joachim/PycharmProjects/takePicture$ stat /mnt/d/Joachim/PycharmProjects/takePicture/bin/takepicture-0.1-arm64-v8a_armeabi-v7a-debug.apk
  File: /mnt/d/Joachim/PycharmProjects/takePicture/bin/takepicture-0.1-arm64-v8a_armeabi-v7a-debug.apk
  Size: 28205421        Blocks: 55096      IO Block: 4096   regular file
Device: 30h/48d Inode: 281474977440833  Links: 1
Access: (0777/-rwxrwxrwx)  Uid: ( 1000/ joachim)   Gid: ( 1000/ joachim)
Access: 2022-08-26 14:18:29.666167600 +0200
Modify: 2022-08-26 14:18:29.666167600 +0200
Change: 2022-08-26 14:18:29.666167600 +0200
 Birth: -

请注意,我已经下载了 windows 版本的 adb 并将其替换为 buildozer (https://github.com/kivy/kivy/wiki/Using-Buildozer-on-windows-10-using-WSL)。 adb 命令似乎有效:

joachim@Laptop-MJ:/mnt/d/Joachim/PycharmProjects/takePicture$ adb devices
List of devices attached
ce11171b6a4d221204      device

这里有什么问题吗?

更新:当我在本机 Windows 下使用 powershell 时它有效:

PS D:\Joachim\PycharmProjects\takePicture> adb.exe install -r .\bin\takepicture-0.1-arm64-v8a_armeabi-v7a-debug.apk
Performing Streamed Install
Success

我可以直接从 WSL 运行本机 powershell 吗?

pycharm adb windows-subsystem-for-linux buildozer
1个回答
0
投票

这里的工作(例如鱼壳)

function ainstall
  echo $argv
  cp $argv ./tmp.apk
  adb install -r ./tmp.apk
  rm tmp.apk
end
funcsave ainstall

然后用ainstall绝对路径安装apk

您可能需要修改构建工具的安装脚本才能使用新命令。

© www.soinside.com 2019 - 2024. All rights reserved.