bytedance / Fastbot_Android

Fastbot(2.0) is a model-based testing tool for modeling GUI transitions to discover app stability problems
Other
1.06k stars 245 forks source link

Fastbot on a real device #233

Closed dah-fari7009 closed 1 year ago

dah-fari7009 commented 1 year ago

Hello,

I'm trying to run FastBot on a real device (Pixel XL Android 10 and Pixel 6 Android 13) instead of an emulator, but it seems to require root access to push the libs folder under /data/tmp/ I was wondering if there is any way around this or can the tool only run on emulators and rooted devices?

Thanks

EasyVector commented 1 year ago

Hi, maybe should try to push the file to path /data/local/tmp which you could write through adb.

dah-fari7009 commented 1 year ago

Thanks for the reply! I meant /data/local/tmp, sorry about the confusion; on a real device it seems this folder can not be accessed without running adb as root.

EasyVector commented 1 year ago

What was the command you used for pushing those artifacts, and what was the result from adb? I probably need more details. As far as I know, you do not need root access to push file to /data/local/tmp. I am using a device of Android 10 now.

dah-fari7009 commented 1 year ago

I followed the instructions in the README:

adb push *.jar /sdcard
adb push libs/* /data/local/tmp/

The push to sdcard was successful, but the second one took a very long time and then failed with "remote fchown failed: Operation not permitted". I tried pushing the files inside libs individually as well and observed the same behavior.

I also used adb shell to check the permissions of the data folder on the device (Android 10), and could list the content of sdcard but not data: image

EasyVector commented 1 year ago

Well, the "/data" belongs to root privilege and that is why ls data/ is not allowed when shell is the current user. You could verify with using this command: adb shell ls -ld /data and you could possibly see output like drwxrwx--x 70 system system 4096 2023-07-22 02:35 /data. So I recommand you use adb shell ls -ld /data/local/tmp to check if this directory exists and belongs to shell. You might see output like:

(base) ➜  adb shell ls -ld /data/local/tmp
drwxrwx--x 14 shell shell 3488 2023-07-30 23:42 /data/local/tmp
dah-fari7009 commented 1 year ago

Thank you for your help and the pointers you provided. /data/local/tmp does indeed have shell permission, so the problem might be somewhere else. I will post an update if I figure it out!