Good Morning! I am trying to migrate my UI-Tests f...
# android
c
Good Morning! I am trying to migrate my UI-Tests for Android 10 but my scripts fails, since i can’t grant
WRITE_EXTERNAL_STORAGE
on an Android 10 devices - any known workarounds?
google 1
w
Afaik you can set legacy behavior in manifest for tests
android:requestLegacyExternalStorage="true"
c
Oh - that’s awesome. Thanks! I really did not think of this.
Although this is something they told us will be removed with Android 11 oder Android 12. I would love to have a statement from the Google guys if there is (or will be) an idiomatic way for this.
w
Shouldn’t you migrate to SAF for the app, in which case you won’t need these permissions? I’m not working with storage recently so I’m not up to date with all the implications here
c
Yeah you are right, but the
BasicScreenCaptureProcessor
does not seem to support SAF as of now
w
I’d suggest opening an issue and hoping Google will fix it before they deprecate legacy mode 😉
c
Yeah, i think that might be the correct approach
c
There's a feature in Android Gradle plugin in 4.0 to have gradle copy data off device before uninstall (can manually opt in for 3.6 https://developer.android.com/studio/profile/benchmark#android_gradle_plugin_36_and_higher)
That's the intended replacement - can read the instrumenation arg additionalTestOutputDir from device, and it gets copied to host. If not running through Gradle though (maybe in ci) you'll need to do that copy before uninstalling the test app
c
Thanks a lot!
But this looks like a TestRunner Feature of Benchmark, right?
c
No, it's a feature of the Android Gradle plugin - the benchmark infra is just what's using it first