admin管理员组文章数量:1333657
Most of the steps of Fastlane Android Screengrab work as intended: building my app in debug with the given environment parameter, building the Android tests, running the Android tests in the emulator, and storing the screenshots on the device (see logcat output below) however when Fastlane attempts to pull the screenshots from the emulator it stops polling locations after a "permission denied" error.
[20:55:07]: Pulling captured screenshots from the device
ls: /sdcard/io.outright.my_flutter_app/screengrab: No such file or directory
[20:55:07]: Exit status: 1
ls: /data/data/io.outright.my_flutter_app/app_screengrab: Permission denied
[20:55:07]: Exit status: 1
[20:55:07]: Make sure you've used Screengrab.screenshot() in your tests and that your expected tests are being run.
I have confirmed that I am using Screengrab.screenshot() in my tests and my expected tests are being run. This is from logcat of the emulator while the test ran:
... Screengrab io.outright.my_flutter_app D Using screenshot storage directory: /data/user/0/io.outright.my_flutter_app/app_screengrab/en_US/images/screenshots
... Screengrab io.outright.my_flutter_app D Captured screenshot "0_StartScreen.png"
... Screengrab io.outright.my_flutter_app D Using screenshot storage directory: /data/user/0/io.outright.my_flutter_app/app_screengrab/en_US/images/screenshots
... Screengrab io.outright.my_flutter_app D Captured screenshot "1_SetupScreen.png"
... Screengrab io.outright.my_flutter_app D Using screenshot storage directory: /data/user/0/io.outright.my_flutter_app/app_screengrab/en_US/images/screenshots
... Screengrab io.outright.my_flutter_app D Captured screenshot "2_GameScreen.png"
... Screengrab io.outright.my_flutter_app D Using screenshot storage directory: /data/user/0/io.outright.my_flutter_app/app_screengrab/en_US/images/screenshots
Attempt to see these files with adb
shows the same permission error:
$ adb shell ls /data/user/0/io.outright.my_flutter_app/app_screengrab/en_US/images/screenshots
ls: /data/user/0/io.outright.my_flutter_app/app_screengrab/en_US/images/screenshots: Permission denied
There used to be a use_adb_root
parameter for Fastlane but it is now deprecated and does not work in any version since 2.0
Environment
- macOS Sonoma 14.7.1
- Chip Apple M1 Pro
- Fastlane 2.225.0
- Fastlane installed and run with ruby 3.2.2 and Bundler 2.5.22
- Android Emulator running Pixel 6a API 34 with UpsideDownCake Android 14.0 arm64-v8a
Screengrabfile
app_package_name('io.outright.my_flutter_app')
use_tests_in_packages(['io.outright.my_flutter_app'])
tests_package_name('io.outright.my_flutter_app.test')
app_apk_path('../build/app/outputs/apk/debug/app-debug.apk')
tests_apk_path('../build/app/outputs/apk/androidTest/debug/app-debug-androidTest.apk')
test_instrumentation_runner 'androidx.test.runner.AndroidJUnitRunner'
locales(['en-US'])
clear_previous_screenshots(true)
Fastfile
default_platform(:android)
platform :android do
desc "Capture screenshots"
lane :screenshots do
sh("flutter", "build", "apk", "--debug")
build_android_app(
task: 'assemble',
build_type: 'AndroidTest'
)
capture_android_screenshots
end
end
app/build.gradle
...
dependencies {
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'tools.fastlane:screengrab:2.1.1'
androidTestImplementation 'androidx.test:runner:1.5.2'
androidTestImplementation 'androidx.test:rules:1.5.0'
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
androidTestImplementation "androidx.test.uiautomator:uiautomator:2.2.0"
}
Logs
$ bundle exec fastlane screenshots
[✔]
版权声明:本文标题:Flutter Android Fastlane Permission denied pulling captured screenshots from the emulator - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人,
转载请联系作者并注明出处:http://www.betaflare.com/web/1742262708a2442812.html,
本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论