Browse Source

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`.
Ruslan Baratov 8 years ago
parent
commit
513ef514e5
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Modules/AndroidTestUtilities/PushToAndroidDevice.cmake

+ 1 - 1
Modules/AndroidTestUtilities/PushToAndroidDevice.cmake

@@ -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})