Can not get trace.log on Lolipop devices?
I encounter error "run-as: exec failed for find Error:Permission denied was moved. Retrying..." when using real devices running lolipop. Does profilo only support 6.0 and above?
Profilo should work fine for versions < 6.
This error happens because the find command found a trace in /data/data/<your_app>/cache but it was moved to /data/data/<your_app>/cache/upload (or vice versa) by the time we actually tried to use it. However, the number of times it can move from one directory to another is finite (just once or twice), so we retry in a loop until we succeed.
This is what should happen:
python -m profilo.profilo pull_last_trace com.facebook.profilo.sample
File /data/data/com.facebook.profilo.sample/./cache/upload/override-xxxxxxx.log was moved. Retrying...
override-xxxxxxx.log <---- This means the file was successfully downloaded from the device
Basically, we retry a few times (just once in this case) and eventually succeed and download the trace from the device.
Is this not what happened in your case? Did you not eventually get the trace?
It keeps looping forever
The problem because these devices i have dont have find command, so i try to modify _GET_TRACES_CMD in device.py

And the result is that it keeps retrying forever

Ugh, I had never seen find fail. Anyway...
I just made a change so that we'll default to using find and then fall back to ls -R if find fails. You should see it in a little while.
Note that what you're doing is almost correct: the problem is that you're using ls -lR, and the -l flag causes a bunch of metadata about the file (permissions, ownership, etc.) to be printed as part of the output. So, instead of getting just the file name, you get something like -rw------- <file_name>, which we can't cat. Also, if the file is not in the current directory, you need to prepend the full path name, which is also missing from what you're doing here.
I'll update this again once my fix lands here.
There you go. You should now be able to download traces using ls -R if your device doesn't support find.
Thank you for your help, i get the newest release and try to run it but the exception you just added except subprocess.CalledProcessError as e can not catch the error find command not found,.
If i run _GET_TRACES_CMD_LS as default, it works well but then i find that the stat command is also like the find command, it do not appear on every devices, so i got the error
I test on three different real devices running on 5.1.1, so i am surprised that you didnt meet these errors.
Anyway i very appreciate your quick response.
i managed to fix this error using date -r <path> +%s instead, but i meet strange error in the pwd command.
Do def _get_data_dir_full_path(package) always return **/data/data/
Do def _get_data_dir_full_path(package) always return **/data/data/ ?
It does in every device I've tested this - though, as you're already noticing, there's way too many combinations of models/versions to try them all -. We even hardcode this assumption:
full_path = "/data/data/{package}/{path}".format(