Closed songyuc closed 4 months ago
Change the destination to /data/local/tmp/minitouch
Hi, @codeskyblue, thanks sincerely for your guide!
Besides, I'd like to suggest an enhancement for the device.sync.push()
method to align more closely with the standard adb push
command behavior.
In standard ADB, the command adb push source-path destination-path
automatically retains the source file name if the destination file name is not specified. For example, adb push xxx\minitouch\libs\x86_64\minitouch /data/local/tmp/
pushes the file to /data/local/tmp/minitouch
.
It would be highly beneficial if adbutils
could adopt similar functionality, as following example:
# os.system(r"adb push xxx\minitouch\libs\x86_64\minitouch /data/local/tmp/")
device.sync.push(minitouch_path / "libs" / abi / "minitouch", "/data/local/tmp/", check=True)
This change of omitting the target file name would allow users to push files without specifying the file name in the destination path, thus simplifying the command and making the API more intuitive, especially for those accustomed to the standard ADB behavior.
Thank you for considering this suggestion.
Best regards, Yucheng Song
change your dst directory to a specific file name, such as "/data/local/tmp/" to "/data/local/tmp/123.txt"
Hello, guys,
I've encountered an issue with
adbutils
while working on a script that involves pushing a file to an Android emulator. The specific method that's causing trouble isdevice.sync.push
. Despite successful execution of the same command viaos.system()
, thedevice.sync.push
method results in anAdbError: FAIL
exception.Environment:
Issue Description: The script is intended to clone the
minitouch
repo, build it, and then push theminitouch
binary to an emulator. Theos.system()
method successfully pushes the file using theadb push
command. However, when attempting to do the same withadbutils
, it results in an error.Here is the relevant part of the script:
The error encountered is as follows:
Attempts to Resolve:
I'm unsure why
device.sync.push
is failing whileos.system()
succeeds. Any insights or suggestions would be greatly appreciated.Thank you for your time and assistance.
Best regards, Yucheng Song