AndroidTestUtilities: fix cleanup operation

`su` is not available by default on all devices:

```
> adb shell "echo ls /data/local/tmp | su"
/system/bin/sh: su: not found
> echo $?
0
```

Also since `execute_adb_command` use `execute_process` under the hood
the pipeline (`|`) will not be treated as special symbol and will be
process just like one more command line argument for the `adb`.
This commit is contained in:
Ruslan Baratov 2016-12-27 21:15:36 +08:00 committed by Brad King
parent 65fb0fa632
commit 513ef514e5

View File

@ -117,7 +117,7 @@ function(android_push_test_files_to_device)
check_device_file_exists(${_ptd_DEV_TEST_DIR} test_dir_exists)
if(test_dir_exists)
# This is protected in the SetupProjectTests module.
execute_adb_command(shell echo rm -r ${_ptd_DEV_TEST_DIR} | su)
execute_adb_command(shell rm -r ${_ptd_DEV_TEST_DIR})
endif()
execute_adb_command(shell mkdir -p ${_ptd_DEV_TEST_DIR})