From 045830c50a696d973e4a250a23844b1556eb4cf0 Mon Sep 17 00:00:00 2001 From: Sergii Pechenizkyi Date: Fri, 15 Feb 2019 14:38:07 +0100 Subject: [PATCH] Read external storage --- composer/src/main/kotlin/com/gojuno/composer/TestRun.kt | 9 ++++++--- dependencies.gradle | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/composer/src/main/kotlin/com/gojuno/composer/TestRun.kt b/composer/src/main/kotlin/com/gojuno/composer/TestRun.kt index 2fde0bb..44f701c 100644 --- a/composer/src/main/kotlin/com/gojuno/composer/TestRun.kt +++ b/composer/src/main/kotlin/com/gojuno/composer/TestRun.kt @@ -165,12 +165,15 @@ private fun pullTestFiles(adbDevice: AdbDevice, test: InstrumentationTest, outpu } .flatMap { screenshotsFolderOnHostMachine -> adbDevice - .pullFolder( + .externalStorage() + .flatMap { externalStorageFolder -> + adbDevice.pullFolder( // TODO: Add support for internal storage and external storage strategies. - folderOnDevice = "/storage/emulated/0/app_spoon-screenshots/${test.className}/${test.testName}", + folderOnDevice = "$externalStorageFolder/app_spoon-screenshots/${test.className}/${test.testName}", folderOnHostMachine = screenshotsFolderOnHostMachine, logErrors = verboseOutput - ) + ) + } .map { File(screenshotsFolderOnHostMachine, test.testName) } } .map { screenshotsFolderOnHostMachine -> diff --git a/dependencies.gradle b/dependencies.gradle index 6808688..ecabb94 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -3,7 +3,7 @@ ext.versions = [ rxJava : '1.3.0', jCommander : '1.71', - commander : '0.1.7', + commander : '0.1.9', apacheCommonsIo : '2.5', apacheCommonsLang: '3.5', gson : '2.8.0',