screenshot-tests-for-android icon indicating copy to clipboard operation
screenshot-tests-for-android copied to clipboard

Tests won't record screenshots on API 29+

Open tuliopereirazup opened this issue 4 years ago • 6 comments

I'm trying to run tests on emulator using API 29+ and it won't work, I suppose that is because the new Scoped storage.

tuliopereirazup avatar Nov 18 '20 19:11 tuliopereirazup

I face the same issue. Have you tried an emulator with API 24? It's working for me.

malkes avatar Dec 10 '20 13:12 malkes

On API 30 Scoped storage is enable by default, I found a workaround and open a PR https://github.com/facebook/screenshot-tests-for-android/pull/273 for this

TimoPtr avatar Jan 12 '21 16:01 TimoPtr

@TimoPtr It seems that half a year since you PR #273 being kicked off, just wondering why not fix the conflicts and merge it?

liweijian avatar Jul 02 '21 06:07 liweijian

Conflict has been solved, but it's not my call to merge this.

TimoPtr avatar Jul 02 '21 07:07 TimoPtr

Hi @tdrhq , I know you left Facebook for a while and kickoff a great project , but it seems that this project not response the community right now as you were working for facebook.

Do you know the background of the API 29+ Scoped storage issue? It should be a paint point for most of the developers in the community :)

liweijian avatar Jul 04 '21 05:07 liweijian

@liweijian I haven't been keeping track of the scoped storage issue (haven't kept up with the latest Android changes). I wonder if the right solution is to use the getDataDirectory(). I think the assumptions based on which we chose to use the external directory may not be true anymore. (We're talking Gingerbread days, those days the emulator /data directory on default emulator images weren't big enough to store enough images for our tests.)

We don't really need the directory to be shareable by apps, we just need it to be downloadable with adb pull (or more realistically, adb shell with run-as or something of the sort).

tdrhq avatar Jul 05 '21 04:07 tdrhq