New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with screengrab looking for images in the wrong folder #4915

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
7 participants
@sirkro

sirkro commented May 31, 2016

Screengrab creates an additional folder screengrab on emulator/device and this line does not handle this folder.

Issue with screengrab looking for images in the wrong folder
Screengrab creates an additional folder screengrab on emulator/device and this line does not handle this folder.
@fastlane-danger-bot

This comment has been minimized.

fastlane-danger-bot commented May 31, 2016

        1 Warning
    
  </th>
 </tr>
⚠️ Before submitting a Pull Request, please create an issue on GitHub to discuss the change. Please add a link to the issue in the PR body.

Generated by 🚫 danger

@mfurtak

This comment has been minimized.

Contributor

mfurtak commented Jun 2, 2016

Hi @sirkro - thanks for the contribution 👍

Can you confirm what version of screengrab you are using for the two parts (gem & AAR)?

The gem version can be confirmed with:

gem which screengrab

And the AAR version can be confirmed from your build.gradle

Thanks!

@mfurtak mfurtak self-assigned this Jun 2, 2016

@sirkro

This comment has been minimized.

sirkro commented Jun 3, 2016

Hi @mfurtak ,

gem which screengrab
/Users/kro/.gem/ruby/2.1.0/gems/screengrab-0.3.2/lib/screengrab.rb

androidTestCompile 'tools.fastlane:screengrab:0.3.2'

@mfurtak

This comment has been minimized.

Contributor

mfurtak commented Jun 3, 2016

@sirkro This is odd... when I check out your branch and try it locally, it produces an error for me.

...
[11:10:04]: Pulling captured screenshots from the device
[11:10:04]: $ adb -s emulator-5554 pull /data/data/tools.fastlane.localetester/app_screengrab fastlane/metadata/android
[11:10:11]: Screenshots copied to fastlane/metadata/android/en-US/images/phoneScreenshots
[11:10:11]: Screenshots copied to fastlane/metadata/android/fr-FR/images/phoneScreenshots
[11:10:11]: Screenshots copied to fastlane/metadata/android/ja-JP/images/phoneScreenshots
[11:10:11]: Opening screenshots summary
[11:10:11]: $ open fastlane/metadata/android/screengrab/*/images/phoneScreenshots/*.png
The file /Users/mfurtak/Documents/Code/fastlane/fastlane/screengrab/example/fastlane/metadata/android/screengrab/*/images/phoneScreenshots/*.png does not exist.
[11:10:11]: Exit status: 1

[!] Exit status: 1

Can you please do a run of screengrab --verbose with your changes in place and paste the output here? Thanks!

@sirkro

This comment has been minimized.

sirkro commented Jun 7, 2016

With my fix:

screengrab --verbose
WARN [2016-06-07 12:01:34.49]: The 'aapt command could not be found on your PATH
WARN [2016-06-07 12:01:34.49]: Please ensure that the Android SDK is installed and you have the build tools downloaded and present on your PATH

+-----------------------------+-------------------------------------------------------------------+
|                                  Summary for screengrab 0.3.2                                   |
+-----------------------------+-------------------------------------------------------------------+
| app_package_name            | no.altibox.nhstg                                                  |
| use_tests_in_packages       | ["altibox.newhorizon"]                                            |
| app_apk_path                | app/build/outputs/apk/app-staging-debug.apk                       |
| tests_apk_path              | app/build/outputs/apk/app-staging-debug-androidTest-unaligned.apk |
| locales                     | ["en-US", "nb_NO", "da_DK"]                                       |
| clear_previous_screenshots  | true                                                              |
| tests_package_name          | no.altibox.nhstg.test                                             |
| output_directory            | fastlane/metadata/android                                         |
| skip_open_summary           | false                                                             |
| test_instrumentation_runner | android.support.test.runner.AndroidJUnitRunner                    |
| ending_locale               | en-US                                                             |
| device_type                 | phone                                                             |
+-----------------------------+-------------------------------------------------------------------+

INFO [2016-06-07 12:01:34.70]: Clearing phoneScreenshots within fastlane/metadata/android
INFO [2016-06-07 12:01:34.70]: $ adb devices -l
INFO [2016-06-07 12:01:34.71]: ▸ List of devices attached
INFO [2016-06-07 12:01:34.71]: ▸ emulator-5554          device product:sdk_google_phone_x86 model:Android_SDK_built_for_x86 device:generic_x86
INFO [2016-06-07 12:01:34.71]: $ adb -s emulator-5554 shell echo \$EXTERNAL_STORAGE
INFO [2016-06-07 12:01:34.72]: ▸ /sdcard
INFO [2016-06-07 12:01:34.72]: Cleaning screenshots on device
INFO [2016-06-07 12:01:34.74]: ▸ en-US
INFO [2016-06-07 12:01:34.74]: $ adb -s emulator-5554 shell rm -rf /sdcard/no.altibox.nhstg/screengrab
INFO [2016-06-07 12:01:34.80]: ▸ /data/data/no.altibox.nhstg/app_screengrab: No such file or directory
WARN [2016-06-07 12:01:34.80]: The 'aapt' command could not be found on your system, so your app APK could not be validated
INFO [2016-06-07 12:01:34.80]: Installing app APK
INFO [2016-06-07 12:01:34.80]: $ adb -s emulator-5554 install -r app/build/outputs/apk/app-staging-debug.apk
INFO [2016-06-07 12:01:37.37]: ▸ [100%] /data/local/tmp/app-staging-debug.apk
INFO [2016-06-07 12:01:37.51]: ▸ pkg: /data/local/tmp/app-staging-debug.apk
INFO [2016-06-07 12:01:40.84]: ▸ Success
INFO [2016-06-07 12:01:40.87]: Installing tests APK
INFO [2016-06-07 12:01:40.87]: $ adb -s emulator-5554 install -r app/build/outputs/apk/app-staging-debug-androidTest-unaligned.apk
INFO [2016-06-07 12:01:40.99]: ▸ [100%] /data/local/tmp/app-staging-debug-androidTest-unaligned.apk
INFO [2016-06-07 12:01:41.21]: ▸ pkg: /data/local/tmp/app-staging-debug-androidTest-unaligned.apk
INFO [2016-06-07 12:01:42.36]: ▸ Success
INFO [2016-06-07 12:01:42.39]: Granting the permission necessary to change locales on the device
INFO [2016-06-07 12:01:42.39]: $ adb -s emulator-5554 shell pm grant no.altibox.nhstg android.permission.CHANGE_CONFIGURATION
INFO [2016-06-07 12:01:42.59]: $ adb -s emulator-5554 shell getprop ro.build.version.sdk
INFO [2016-06-07 12:01:42.61]: ▸ 23
INFO [2016-06-07 12:01:42.62]: Granting the permissions necessary to access device external storage
INFO [2016-06-07 12:01:42.62]: $ adb -s emulator-5554 shell pm grant no.altibox.nhstg android.permission.WRITE_EXTERNAL_STORAGE
INFO [2016-06-07 12:01:42.84]: $ adb -s emulator-5554 shell pm grant no.altibox.nhstg android.permission.READ_EXTERNAL_STORAGE
INFO [2016-06-07 12:01:43.01]: Running tests for locale: en-US
INFO [2016-06-07 12:01:43.01]: $ adb -s emulator-5554 shell am instrument --no-window-animation -w \
-e testLocale en_US \
-e endingLocale en_US \
-e package altibox.newhorizon \
no.altibox.nhstg.test/android.support.test.runner.AndroidJUnitRunner
INFO [2016-06-07 12:01:43.42]: ▸ altibox.newhorizon.TestChannelsApi:..
INFO [2016-06-07 12:01:43.44]: ▸ altibox.newhorizon.CachedObservablesTest:...
INFO [2016-06-07 12:01:44.13]: ▸ altibox.newhorizon.SettingsActivityTest:.
INFO [2016-06-07 12:01:44.14]: ▸ altibox.newhorizon.TestLoginForSlowApi:
INFO [2016-06-07 12:01:44.14]: ▸ altibox.newhorizon.TestLoginForSlowApi:
INFO [2016-06-07 12:01:48.56]: ▸ altibox.newhorizon.TestLoginUI:..
INFO [2016-06-07 12:01:48.57]: ▸ altibox.newhorizon.TestPlayerControls:
INFO [2016-06-07 12:01:48.57]: ▸ altibox.newhorizon.TestPlayerControls:
INFO [2016-06-07 12:01:48.91]: ▸ altibox.newhorizon.TestTimeUtils:...........
INFO [2016-06-07 12:01:48.91]: ▸ Time: 5.43
INFO [2016-06-07 12:01:48.91]: ▸ OK (19 tests)
INFO [2016-06-07 12:01:49.13]: Running tests for locale: nb_NO
INFO [2016-06-07 12:01:49.13]: $ adb -s emulator-5554 shell am instrument --no-window-animation -w \
-e testLocale nb_NO \
-e endingLocale en_US \
-e package altibox.newhorizon \
no.altibox.nhstg.test/android.support.test.runner.AndroidJUnitRunner
INFO [2016-06-07 12:01:49.48]: ▸ altibox.newhorizon.TestChannelsApi:..
INFO [2016-06-07 12:01:49.49]: ▸ altibox.newhorizon.CachedObservablesTest:...
INFO [2016-06-07 12:01:50.18]: ▸ altibox.newhorizon.SettingsActivityTest:.
INFO [2016-06-07 12:01:50.18]: ▸ altibox.newhorizon.TestLoginForSlowApi:
INFO [2016-06-07 12:01:50.19]: ▸ altibox.newhorizon.TestLoginForSlowApi:
INFO [2016-06-07 12:01:54.54]: ▸ altibox.newhorizon.TestLoginUI:..
INFO [2016-06-07 12:01:54.54]: ▸ altibox.newhorizon.TestPlayerControls:
INFO [2016-06-07 12:01:54.54]: ▸ altibox.newhorizon.TestPlayerControls:
INFO [2016-06-07 12:01:54.92]: ▸ altibox.newhorizon.TestTimeUtils:...........
INFO [2016-06-07 12:01:54.92]: ▸ Time: 5.346
INFO [2016-06-07 12:01:54.92]: ▸ OK (19 tests)
INFO [2016-06-07 12:01:55.13]: Running tests for locale: da_DK
INFO [2016-06-07 12:01:55.13]: $ adb -s emulator-5554 shell am instrument --no-window-animation -w \
-e testLocale da_DK \
-e endingLocale en_US \
-e package altibox.newhorizon \
no.altibox.nhstg.test/android.support.test.runner.AndroidJUnitRunner
INFO [2016-06-07 12:01:55.49]: ▸ altibox.newhorizon.TestChannelsApi:..
INFO [2016-06-07 12:01:55.50]: ▸ altibox.newhorizon.CachedObservablesTest:...
INFO [2016-06-07 12:01:56.18]: ▸ altibox.newhorizon.SettingsActivityTest:.
INFO [2016-06-07 12:01:56.18]: ▸ altibox.newhorizon.TestLoginForSlowApi:
INFO [2016-06-07 12:01:56.18]: ▸ altibox.newhorizon.TestLoginForSlowApi:
INFO [2016-06-07 12:02:00.53]: ▸ altibox.newhorizon.TestLoginUI:..
INFO [2016-06-07 12:02:00.53]: ▸ altibox.newhorizon.TestPlayerControls:
INFO [2016-06-07 12:02:00.53]: ▸ altibox.newhorizon.TestPlayerControls:
INFO [2016-06-07 12:02:00.89]: ▸ altibox.newhorizon.TestTimeUtils:...........
INFO [2016-06-07 12:02:00.89]: ▸ Time: 5.335
INFO [2016-06-07 12:02:00.89]: ▸ OK (19 tests)
INFO [2016-06-07 12:02:01.10]: Pulling captured screenshots from the device
DEBUG [2016-06-07 12:02:01.10]: Starting screenshot count is: 0
INFO [2016-06-07 12:02:01.12]: ▸ en-US
INFO [2016-06-07 12:02:01.12]: $ adb -s emulator-5554 pull /sdcard/no.altibox.nhstg/screengrab fastlane/metadata/android
INFO [2016-06-07 12:02:01.30]: ▸ /sdcard/no.altibox.nhstg/screengrab/: 19 files pulled. 0 files skipped. 3.7 MB/s (652884 bytes in 0.170s)
INFO [2016-06-07 12:02:01.32]: ▸ /data/data/no.altibox.nhstg/app_screengrab: No such file or directory
INFO [2016-06-07 12:02:01.33]: Screenshots copied to fastlane/metadata/android/screengrab/en-US/images/phoneScreenshots
DEBUG [2016-06-07 12:02:01.33]: Ending screenshot count is: 15
INFO [2016-06-07 12:02:01.33]: Opening screenshots summary
INFO [2016-06-07 12:02:01.33]: $ open fastlane/metadata/android/screengrab/*/images/phoneScreenshots/*.png
INFO [2016-06-07 12:02:01.46]: Captured 15 screenshots! 📷✨

Without fix:

screengrab --verbose
WARN [2016-06-07 12:03:10.86]: The 'aapt' command could not be found on your PATH
WARN [2016-06-07 12:03:10.86]: Please ensure that the Android SDK is installed and you have the build tools downloaded and present on your PATH

+-----------------------------+-------------------------------------------------------------------+
|                                  Summary for screengrab 0.3.2                                   |
+-----------------------------+-------------------------------------------------------------------+
| app_package_name            | no.altibox.nhstg                                                  |
| use_tests_in_packages       | ["altibox.newhorizon"]                                            |
| app_apk_path                | app/build/outputs/apk/app-staging-debug.apk                       |
| tests_apk_path              | app/build/outputs/apk/app-staging-debug-androidTest-unaligned.apk |
| locales                     | ["en-US", "nb_NO", "da_DK"]                                       |
| clear_previous_screenshots  | true                                                              |
| tests_package_name          | no.altibox.nhstg.test                                             |
| output_directory            | fastlane/metadata/android                                         |
| skip_open_summary           | false                                                             |
| test_instrumentation_runner | android.support.test.runner.AndroidJUnitRunner                    |
| ending_locale               | en-US                                                             |
| device_type                 | phone                                                             |
+-----------------------------+-------------------------------------------------------------------+

INFO [2016-06-07 12:03:11.07]: Clearing phoneScreenshots within fastlane/metadata/android
INFO [2016-06-07 12:03:11.07]: $ adb devices -l
INFO [2016-06-07 12:03:11.08]: ▸ List of devices attached
INFO [2016-06-07 12:03:11.08]: ▸ emulator-5554          device product:sdk_google_phone_x86 model:Android_SDK_built_for_x86 device:generic_x86
INFO [2016-06-07 12:03:11.08]: $ adb -s emulator-5554 shell echo \$EXTERNAL_STORAGE
INFO [2016-06-07 12:03:11.09]: ▸ /sdcard
INFO [2016-06-07 12:03:11.09]: Cleaning screenshots on device
INFO [2016-06-07 12:03:11.11]: ▸ en-US
INFO [2016-06-07 12:03:11.11]: $ adb -s emulator-5554 shell rm -rf /sdcard/no.altibox.nhstg/screengrab
INFO [2016-06-07 12:03:11.17]: ▸ /data/data/no.altibox.nhstg/app_screengrab: No such file or directory
WARN [2016-06-07 12:03:11.17]: The 'aapt' command could not be found on your system, so your app APK could not be validated
INFO [2016-06-07 12:03:11.17]: Installing app APK
INFO [2016-06-07 12:03:11.17]: $ adb -s emulator-5554 install -r app/build/outputs/apk/app-staging-debug.apk
INFO [2016-06-07 12:03:14.31]: ▸ [100%] /data/local/tmp/app-staging-debug.apk
INFO [2016-06-07 12:03:14.47]: ▸ pkg: /data/local/tmp/app-staging-debug.apk
INFO [2016-06-07 12:03:18.02]: ▸ Success
INFO [2016-06-07 12:03:18.05]: Installing tests APK
INFO [2016-06-07 12:03:18.05]: $ adb -s emulator-5554 install -r app/build/outputs/apk/app-staging-debug-androidTest-unaligned.apk
INFO [2016-06-07 12:03:18.18]: ▸ [100%] /data/local/tmp/app-staging-debug-androidTest-unaligned.apk
INFO [2016-06-07 12:03:18.40]: ▸ pkg: /data/local/tmp/app-staging-debug-androidTest-unaligned.apk
INFO [2016-06-07 12:03:19.55]: ▸ Success
INFO [2016-06-07 12:03:19.57]: Granting the permission necessary to change locales on the device
INFO [2016-06-07 12:03:19.57]: $ adb -s emulator-5554 shell pm grant no.altibox.nhstg android.permission.CHANGE_CONFIGURATION
INFO [2016-06-07 12:03:19.80]: $ adb -s emulator-5554 shell getprop ro.build.version.sdk
INFO [2016-06-07 12:03:19.82]: ▸ 23
INFO [2016-06-07 12:03:19.82]: Granting the permissions necessary to access device external storage
INFO [2016-06-07 12:03:19.82]: $ adb -s emulator-5554 shell pm grant no.altibox.nhstg android.permission.WRITE_EXTERNAL_STORAGE
INFO [2016-06-07 12:03:20.03]: $ adb -s emulator-5554 shell pm grant no.altibox.nhstg android.permission.READ_EXTERNAL_STORAGE
INFO [2016-06-07 12:03:20.19]: Running tests for locale: en-US
INFO [2016-06-07 12:03:20.19]: $ adb -s emulator-5554 shell am instrument --no-window-animation -w \
-e testLocale en_US \
-e endingLocale en_US \
-e package altibox.newhorizon \
no.altibox.nhstg.test/android.support.test.runner.AndroidJUnitRunner
INFO [2016-06-07 12:03:20.61]: ▸ altibox.newhorizon.TestChannelsApi:..
INFO [2016-06-07 12:03:20.62]: ▸ altibox.newhorizon.CachedObservablesTest:...
INFO [2016-06-07 12:03:21.31]: ▸ altibox.newhorizon.SettingsActivityTest:.
INFO [2016-06-07 12:03:21.32]: ▸ altibox.newhorizon.TestLoginForSlowApi:
INFO [2016-06-07 12:03:21.32]: ▸ altibox.newhorizon.TestLoginForSlowApi:
INFO [2016-06-07 12:03:25.67]: ▸ altibox.newhorizon.TestLoginUI:..
INFO [2016-06-07 12:03:25.67]: ▸ altibox.newhorizon.TestPlayerControls:
INFO [2016-06-07 12:03:25.67]: ▸ altibox.newhorizon.TestPlayerControls:
INFO [2016-06-07 12:03:26.00]: ▸ altibox.newhorizon.TestTimeUtils:...........
INFO [2016-06-07 12:03:26.00]: ▸ Time: 5.33
INFO [2016-06-07 12:03:26.00]: ▸ OK (19 tests)
INFO [2016-06-07 12:03:26.21]: Running tests for locale: nb_NO
INFO [2016-06-07 12:03:26.21]: $ adb -s emulator-5554 shell am instrument --no-window-animation -w \
-e testLocale nb_NO \
-e endingLocale en_US \
-e package altibox.newhorizon \
no.altibox.nhstg.test/android.support.test.runner.AndroidJUnitRunner
INFO [2016-06-07 12:03:26.57]: ▸ altibox.newhorizon.TestChannelsApi:..
INFO [2016-06-07 12:03:26.58]: ▸ altibox.newhorizon.CachedObservablesTest:...
INFO [2016-06-07 12:03:27.30]: ▸ altibox.newhorizon.SettingsActivityTest:.
INFO [2016-06-07 12:03:27.30]: ▸ altibox.newhorizon.TestLoginForSlowApi:
INFO [2016-06-07 12:03:27.30]: ▸ altibox.newhorizon.TestLoginForSlowApi:
INFO [2016-06-07 12:03:31.67]: ▸ altibox.newhorizon.TestLoginUI:..
INFO [2016-06-07 12:03:31.67]: ▸ altibox.newhorizon.TestPlayerControls:
INFO [2016-06-07 12:03:31.67]: ▸ altibox.newhorizon.TestPlayerControls:
INFO [2016-06-07 12:03:36.94]: ▸ altibox.newhorizon.TestTimeUtils:...........
INFO [2016-06-07 12:03:36.94]: ▸ Time: 5.39
INFO [2016-06-07 12:03:36.94]: ▸ OK (19 tests)
INFO [2016-06-07 12:03:37.16]: Running tests for locale: da_DK
INFO [2016-06-07 12:03:37.16]: $ adb -s emulator-5554 shell am instrument --no-window-animation -w \
-e testLocale da_DK \
-e endingLocale en_US \
-e package altibox.newhorizon \
no.altibox.nhstg.test/android.support.test.runner.AndroidJUnitRunner
INFO [2016-06-07 12:03:37.52]: ▸ altibox.newhorizon.TestChannelsApi:..
INFO [2016-06-07 12:03:37.53]: ▸ altibox.newhorizon.CachedObservablesTest:...
INFO [2016-06-07 12:03:38.24]: ▸ altibox.newhorizon.SettingsActivityTest:.
INFO [2016-06-07 12:03:38.24]: ▸ altibox.newhorizon.TestLoginForSlowApi:
INFO [2016-06-07 12:03:38.24]: ▸ altibox.newhorizon.TestLoginForSlowApi:
INFO [2016-06-07 12:03:42.63]: ▸ altibox.newhorizon.TestLoginUI:..
INFO [2016-06-07 12:03:42.64]: ▸ altibox.newhorizon.TestPlayerControls:
INFO [2016-06-07 12:03:42.64]: ▸ altibox.newhorizon.TestPlayerControls:
INFO [2016-06-07 12:03:42.96]: ▸ altibox.newhorizon.TestTimeUtils:...........
INFO [2016-06-07 12:03:42.96]: ▸ Time: 5.388
INFO [2016-06-07 12:03:42.96]: ▸ OK (19 tests)
INFO [2016-06-07 12:03:43.18]: Pulling captured screenshots from the device
DEBUG [2016-06-07 12:03:43.18]: Starting screenshot count is: 0
INFO [2016-06-07 12:03:43.20]: ▸ en-US
INFO [2016-06-07 12:03:43.20]: $ adb -s emulator-5554 pull /sdcard/no.altibox.nhstg/screengrab fastlane/metadata/android
INFO [2016-06-07 12:03:43.38]: ▸ /sdcard/no.altibox.nhstg/screengrab/: 19 files pulled. 0 files skipped. 3.7 MB/s (652918 bytes in 0.169s)
INFO [2016-06-07 12:03:43.40]: ▸ /data/data/no.altibox.nhstg/app_screengrab: No such file or directory
INFO [2016-06-07 12:03:43.40]: Screenshots copied to fastlane/metadata/android/screengrab/en-US/images/phoneScreenshots
DEBUG [2016-06-07 12:03:43.40]: Ending screenshot count is: 15
INFO [2016-06-07 12:03:43.40]: Opening screenshots summary
INFO [2016-06-07 12:03:43.40]: $ open fastlane/metadata/android/*/images/phoneScreenshots/*.png
INFO [2016-06-07 12:03:43.42]: ▸ The file /Users/kro/code/aib/nh/newhorizon_android/fastlane/metadata/android/*/images/phoneScreenshots/*.png does not exist.
The file /Users/kro/code/aib/nh/newhorizon_android/fastlane/metadata/android/*/images/phoneScreenshots/*.png does not exist.
ERROR [2016-06-07 12:03:43.42]: Exit status: 1
/Users/kro/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/fastlane_core-0.41.0/lib/fastlane_core/ui/interface.rb:139:in 'user_error!': [!] Exit status: 1 (FastlaneCore::Interface::FastlaneError)
    from /Users/kro/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/fastlane_core-0.41.0/lib/fastlane_core/ui/ui.rb:14:in 'method_missing'
    from /Users/kro/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/fastlane_core-0.41.0/lib/fastlane_core/command_executor.rb:87:in 'execute'
    from /Users/kro/.gem/ruby/2.1.0/gems/screengrab-0.3.2/lib/screengrab/runner.rb:297:in 'open_screenshots_summary'
    from /Users/kro/.gem/ruby/2.1.0/gems/screengrab-0.3.2/lib/screengrab/runner.rb:74:in 'run'
    from /Users/kro/.gem/ruby/2.1.0/gems/screengrab-0.3.2/bin/screengrab:39:in 'block (2 levels) in run'
    from /Users/kro/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/commander-4.3.5/lib/commander/command.rb:178:in 'call'
    from /Users/kro/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/commander-4.3.5/lib/commander/command.rb:178:in 'call'
    from /Users/kro/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/commander-4.3.5/lib/commander/command.rb:153:in 'run'
    from /Users/kro/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/commander-4.3.5/lib/commander/runner.rb:428:in 'run_active_command'
    from /Users/kro/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/fastlane_core-0.41.0/lib/fastlane_core/ui/fastlane_runner.rb:23:in 'run!'
    from /Users/kro/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/commander-4.3.5/lib/commander/delegates.rb:15:in 'run!'
    from /Users/kro/.gem/ruby/2.1.0/gems/screengrab-0.3.2/bin/screengrab:56:in 'run'
    from /Users/kro/.gem/ruby/2.1.0/gems/screengrab-0.3.2/bin/screengrab:62:in '<top (required)>'
    from /Users/kro/.gem/ruby/2.1.0/bin/screengrab:23:in 'load'
    from /Users/kro/.gem/ruby/2.1.0/bin/screengrab:23:in '<main>'
    from /Users/kro/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in 'eval'
    from /Users/kro/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `<main>'

@KrauseFx KrauseFx removed the awaiting-reply label Jun 8, 2016

@HugoGresse

This comment has been minimized.

HugoGresse commented Jun 28, 2016

it seems that I've the same issue. screenshots are located here
screenshots/screengrab/en-US/images/phoneScreenshots/beforeAddingWebsite_1467116661813.png
But screenshots summary look here : screenshots/*/images/phoneScreenshots/*.png does not exist.

@vpolouchkine vpolouchkine referenced this pull request Jun 30, 2016

Closed

Screengrab Snapshot summary not displaying #5267

2 of 2 tasks complete

@pietrini pietrini referenced this pull request Jul 4, 2016

Closed

Screengrab looking in /data/data folder for screenshots #5209

2 of 2 tasks complete
@iamkaan

This comment has been minimized.

iamkaan commented Jul 29, 2016

can this be merged please? I'm facing the same problem and this change helped me. 👍

@mfurtak

This comment has been minimized.

Contributor

mfurtak commented Jul 29, 2016

Hi all - I would very much like to solve this problem. 👍

I do believe that this change is fixing a problem for you all, but the reason I can't merge this yet is that the current code works on my system, but this patch does not.

So far I have not been able to figure out the reason for this difference.

When screengrab runs:

adb -s TA095005RI pull /sdcard/tools.fastlane.localetester/screengrab fastlane/metadata/android

I wind up with a path in my project like:

fastlane/metadata/android/en-US/images/phoneScreenshots

It seems like you all wind up with a path like:

fastlane/metadata/android/screengrab/en-US/images/phoneScreenshots

Does anyone have any ideas on why this difference should occur? I am using adb version:

$ adb version
Android Debug Bridge version 1.0.32
Revision 09a0d98bebce-android

Is anyone using a different version, or an alternative adb implementation?

Thank you for your help! 🙌

@EarlOfEgo

This comment has been minimized.

EarlOfEgo commented Jul 30, 2016

I found the problem, looking at the adb code in line 994 is says:

If the destination path existed originally, the source directory should be copied as a child of the destination.

So the problem occurs if the folder fastlane/metadata/android already exists.
You can easy validate this by doing:
rm -r fastlane/metadata/android + screengrab -> works
mkdir -p fastlane/metadata/android + screengrab -> doesn't work

If you check the git history, this change is there since 2015-11-07 15:38:19 -0800. I didn't check out the code and searched for your revision, so I'm just guessing that the adb version which is @mfurtak using doesn't have this change.

Mine is:

Android Debug Bridge version 1.0.36
Revision fd9e4d07b0f5-android

In my opinion the implementation is wrong there for adb, but that's another story.
However this PR only works if the directory exists and seems to depend on the adb version

@mfurtak

This comment has been minimized.

Contributor

mfurtak commented Aug 1, 2016

@EarlOfEgo Wow, that is some great investigating! ❤️ I owe you one!

Knowing that, I can ensure the correct behavior by simply ensuring that the output directory exists before doing the pull.

Because supply can automatically handle your screenshots if they wind up in exactly the right folder, it is good to be able to keep the path as expected (without screengrab as part of it).

@mfurtak

This comment has been minimized.

Contributor

mfurtak commented Aug 1, 2016

Hi folks - thanks very much for your patience and efforts at fixing this!

Based on the new info from @EarlOfEgo, I have tried to address this with #5559. If you have a moment to give that latest code (from master) a try and let me know if it works for you, I can get a new release out quickly!

Thanks 🙌

@EarlOfEgo

This comment has been minimized.

EarlOfEgo commented Aug 1, 2016

Hi, I think the fix from #5559 doesn't solve the problem.

Newer versions of adb always create a child directory in the destination with the name of the source directory.
However now the path of the screenshots is always: fastlane/metadata/android/screengrab/(if you use a newer adb version)

If you want to keep the old path(without screengrab/) you have to solve it another way, like moving or copying after pulling.

@mfurtak

This comment has been minimized.

Contributor

mfurtak commented Aug 1, 2016

@EarlOfEgo Confirmed, I'll try again.

@mfurtak

This comment has been minimized.

Contributor

mfurtak commented Aug 1, 2016

OK, I've given this another shot with a different approach! If folks have time to try this from master, that'd be awesome 🙌

@EarlOfEgo

This comment has been minimized.

EarlOfEgo commented Aug 2, 2016

Just checked, works now as intended. Doesn't matter if the directory exists or not the output path is always: fastlane/metadata/android/
Thanks 👍

@mfurtak

This comment has been minimized.

Contributor

mfurtak commented Aug 2, 2016

Great! I'll close this for now, and work on a release. 🚀

Thanks again to everyone for advocating for the problem and proposing solutions!

@mfurtak mfurtak closed this Aug 2, 2016

@fastlane fastlane locked and limited conversation to collaborators Feb 4, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.