简体   繁体   English

Pixel 2 设备中的临时文件夹

[英]Temp folder in Pixel 2 devices

My Project runs C++ test cases on Android devices.我的项目在 Android 设备上运行 C++ 测试用例。 An exectuable gets generated and along with that, couple of shared object files also gets copied over to the device and the executable is then run.一个可执行文件被生成,与此同时,几个共享对象文件也被复制到设备上,然后可执行文件被运行。 Till now, all those data were being copied over to /data/local/tmp folder.到目前为止,所有这些数据都被复制到/data/local/tmp文件夹中。 After the test cases are run, the content from /data/local/tmp is deleted using adb shell command.运行测试用例后,使用 adb shell 命令删除/data/local/tmp的内容。 With Pixel 2 devices, I am able to copy the exe and shared object files to the tmp folder, but unable to delete them once the test cases are completed.使用 Pixel 2 设备,我可以将 exe 和共享对象文件复制到tmp文件夹,但在测试用例完成后无法删除它们。 I tried using /data/local/temp folder, but I am unable to push files to that folder.我尝试使用/data/local/temp文件夹,但无法将文件推送到该文件夹​​。 Tried using /sdcard but it does not allow the exe files to be executed.尝试使用/sdcard但它不允许执行 exe 文件。 I am clueless as to which specific directory I should be using to run my native test cases on Pixel 2 devices.我不知道应该使用哪个特定目录在 Pixel 2 设备上运行我的本机测试用例。 Does anyone has any pointers?有没有人有任何指示? Please help.请帮忙。

if you create files from adb, uid:gid is set to 2000:2000 and permissions of /data/local/tmp is 0771, this means you always can remove your own files.如果您从 adb 创建文件,uid:gid 设置为 2000:2000, /data/local/tmp权限为 0771,这意味着您始终可以删除自己的文件。 There is no other location for this, you must have messed with permissions没有其他位置可用于此,您一定弄乱了权限

adb shell
touch /data/local/tmp/my-file
ls -an /data/local/tmp
rm /data/local/tmp/my-file

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

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