Skip to content
This repository has been archived by the owner on Dec 7, 2019. It is now read-only.

Screenshots not being pulled on API 22 #151

Open
Sloy opened this issue Jun 14, 2018 · 4 comments · May be fixed by #168
Open

Screenshots not being pulled on API 22 #151

Sloy opened this issue Jun 14, 2018 · 4 comments · May be fixed by #168
Labels

Comments

@Sloy
Copy link

Sloy commented Jun 14, 2018

Hi there!

TL;DR:
Composer always pulls screenshots from /storage/emulated/0/ but in API 22 they're stored in /storage/sdcard/.

Long version:
We have a device farm with some API 22 emulators, and we're seeing that the screenshots are not being pulled off the device.
The error printed by Composer is basically:

[emulator-5554] Failed to pull files from /storage/emulated/0/app_spoon-screenshots/com.infojobs.Screenshots/testMethod to /Users/.../app/build/reports/composer/debug/screenshots/emulator-5554/com.infojobs.Screenshots
failed: java.lang.IllegalStateException: 
Process [script, -F, /Users/.../app/39436924747650.output, /.../adb, -s, emulator-5554, pull, /storage/emulated/0/app_spoon-screenshots/com.infojobs.app.Screenshots/testMethod, /Users/.../app/build/reports/composer/debug/screenshots/emulator-5554/com.infojobs.Screenshots] 
exited with non-zero code 1 Script started on Thu Jun 14 15:49:15 2018

After much digging, we're seeing that Composer has a hardcoded folder to pull screenshots from: /storage/emulated/0/

folderOnDevice = "/storage/emulated/0/app_spoon-screenshots/${test.className}/${test.testName}",

But Spoon (and similar tools) save screenshots in Environment.getExternalStorageDirectory().
here. In API 22 emulators this route corresponds to /storage/sdcard/, while in higher versions it's /storage/emulated/0/.

Since Composer has a hardcoded path to a different root it's not able to pull screenshots from the right directory.

A possible fix would be to get the external storage path from the device like Spoon does by reading the EXTERNAL_STORAGE environment variable. here

@yunikkk yunikkk self-assigned this Jun 14, 2018
@yunikkk yunikkk added the bug label Jun 14, 2018
@yunikkk
Copy link
Contributor

yunikkk commented Jun 14, 2018

Thanks for detailed description!
I'll add external storage retrieval to commander soon, then fix the bug here

@CristianGM
Copy link
Contributor

Any news on that?

@mikepenz
Copy link

This would be really great to get in :)

@artem-zinnatullin
Copy link
Collaborator

There is a comment on #168 that I want @plastiv to take a look at

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants