fastlane / fastlane

🚀 The easiest way to automate building and releasing your iOS and Android apps
https://fastlane.tools
MIT License
39.54k stars 5.7k forks source link

Snapshot not working on iOS 14.2 & XCode 12.2 #17702

Closed mintuz closed 3 years ago

mintuz commented 3 years ago

New Issue Checklist

Issue Description

Couple of issues experienced when running fastlane snapshot

  1. The command always tries to run on my physical iPhone even when it's not connected.
  2. The simulator boots up but never loads the app
  3. The command even though it tries to run on my physical iPhone never actually runs the app on my physical phone.

The command simply hangs.

I have tried;

  1. Unpairing and repairing my iPhone to my laptop
  2. Removing my device completely and trying to run only in the simulator
  3. Restarting both my Mac and my iPhone
  4. XCode, Mac & iOS all upto date.
  5. Going to developer menu on iOS settings and ensuring UI Testing is enabled.
  6. Ensuring my device trusts my Mac.
Command executed
bundle exec fastlane snapshot
Complete output when running fastlane, including the stack trace and command used
[16:57:56]: Successfully loaded '/Users/mintuz/workspace/workout-app/fastlane/Snapfile' 📄

+----------------------------+-----------------------+
|     Detected Values from './fastlane/Snapfile'     |
+----------------------------+-----------------------+
| devices                    | ["iPhone 12 Pro Max"] |
| languages                  | ["en-US"]             |
| scheme                     | Screenshots           |
| output_directory           | ./screenshots         |
| clear_previous_screenshots | true                  |
| override_status_bar        | true                  |
+----------------------------+-----------------------+

[16:57:56]: Resolving Swift Package Manager dependencies...
[16:57:56]: $ xcodebuild -resolvePackageDependencies -scheme Screenshots -project ./Workout\ App.xcodeproj
[16:57:57]: â–¸ Command line invocation:
[16:57:57]: â–¸     /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -resolvePackageDependencies -scheme Screenshots -project "./Workout App.xcodeproj"
[16:57:57]: â–¸ Resolve Package Graph
[16:57:57]: â–¸ 2020-12-01 16:57:57.571 xcodebuild[2748:58288]  DTDeviceKit: deviceType from 00008301-288B69562E30402E was NULL
[16:57:57]: ▸ 2020-12-01 16:57:57.572 xcodebuild[2748:58029] [MT] iPhoneConnect: 📱 == Underlying device preparation errors ==
[16:57:57]: â–¸ 2020-12-01 16:57:57.572 xcodebuild[2748:58029] [MT] iPhoneConnect: Failed _shouldMakeReadyForDevelopment check even though device is not locked by passcode.
[16:57:57]: â–¸ Domain: com.apple.platform.iphoneos
[16:57:57]: â–¸ Code: 5
[16:57:57]: â–¸ Failure Reason: allowsSecureServices: 1. isConnected: 0. Platform: >. DTDKDeviceIdentifierIsIDID: 0
[16:57:57]: â–¸ User Info: {
[16:57:57]: â–¸     DVTDeviceDescription = "\Ud83d\Udcf1";
[16:57:57]: â–¸ }
[16:57:57]: â–¸ --
[16:57:57]: ▸ 2020-12-01 16:57:57.572 xcodebuild[2748:58029] [MT] iPhoneConnect: 📱 == END: Underlying device preparation errors ==
[16:57:57]: â–¸ 2020-12-01 16:57:57.573 xcodebuild[2748:58029] [MT] DTDeviceKit: deviceType from 00008301-288B69562E30402E was NULL
[16:57:57]: â–¸ 2020-12-01 16:57:57.678 xcodebuild[2748:58029] [MT] DTDeviceKit: deviceType from 00008301-288B69562E30402E was NULL
[16:58:02]: â–¸ Resolved source packages:
[16:58:02]: â–¸   gRPC: https://github.com/firebase/grpc-SwiftPM.git @ 1.28.2
[16:58:02]: â–¸   leveldb: https://github.com/firebase/leveldb.git @ 1.22.1
[16:58:02]: â–¸   Charts: https://github.com/danielgindi/Charts @ 3.5.0
[16:58:02]: â–¸   Firebase: https://github.com/firebase/firebase-ios-sdk.git @ 7.1.0
[16:58:02]: â–¸   Purchases: https://github.com/RevenueCat/purchases-ios.git @ 3.7.5
[16:58:02]: â–¸   GTMSessionFetcher: https://github.com/google/gtm-session-fetcher.git @ 1.5.0
[16:58:02]: â–¸   BoringSSL-GRPC: https://github.com/firebase/boringssl-SwiftPM.git @ 0.0.7
[16:58:02]: â–¸   Promises: https://github.com/google/promises.git @ 1.2.11
[16:58:02]: â–¸   abseil: https://github.com/firebase/abseil-cpp-SwiftPM.git @ 0.20200225.0
[16:58:02]: â–¸   nanopb: https://github.com/firebase/nanopb.git @ 2.30906.0
[16:58:02]: â–¸ resolved source packages: gRPC, leveldb, Charts, Firebase, Purchases, GTMSessionFetcher, BoringSSL-GRPC, Promises, abseil, nanopb
[16:58:02]: $ xcodebuild -showBuildSettings -scheme Screenshots -project ./Workout\ App.xcodeproj
2020-12-01 16:58:03.274 xcodebuild[2753:58391]  DTDeviceKit: deviceType from 00008301-288B69562E30402E was NULL
2020-12-01 16:58:03.274 xcodebuild[2753:58322] [MT] iPhoneConnect: 📱 == Underlying device preparation errors ==
2020-12-01 16:58:03.275 xcodebuild[2753:58322] [MT] iPhoneConnect: Failed _shouldMakeReadyForDevelopment check even though device is not locked by passcode.
Domain: com.apple.platform.iphoneos
Code: 5
Failure Reason: allowsSecureServices: 1. isConnected: 0. Platform: >. DTDKDeviceIdentifierIsIDID: 0
User Info: {
    DVTDeviceDescription = "\Ud83d\Udcf1";
}
--
2020-12-01 16:58:03.275 xcodebuild[2753:58322] [MT] iPhoneConnect: 📱 == END: Underlying device preparation errors ==
2020-12-01 16:58:03.276 xcodebuild[2753:58322] [MT] DTDeviceKit: deviceType from 00008301-288B69562E30402E was NULL
2020-12-01 16:58:03.380 xcodebuild[2753:58322] [MT] DTDeviceKit: deviceType from 00008301-288B69562E30402E was NULL
[16:58:05]: Command timed out after 3 seconds on try 1 of 4, trying again with a 6 second timeout...
2020-12-01 16:58:06.301 xcodebuild[2758:58663]  DTDeviceKit: deviceType from 00008301-288B69562E30402E was NULL
2020-12-01 16:58:06.302 xcodebuild[2758:58602] [MT] iPhoneConnect: 📱 == Underlying device preparation errors ==
2020-12-01 16:58:06.302 xcodebuild[2758:58602] [MT] iPhoneConnect: Failed _shouldMakeReadyForDevelopment check even though device is not locked by passcode.
Domain: com.apple.platform.iphoneos
Code: 5
Failure Reason: allowsSecureServices: 1. isConnected: 0. Platform: >. DTDKDeviceIdentifierIsIDID: 0
User Info: {
    DVTDeviceDescription = "\Ud83d\Udcf1";
}
--
2020-12-01 16:58:06.302 xcodebuild[2758:58602] [MT] iPhoneConnect: 📱 == END: Underlying device preparation errors ==
2020-12-01 16:58:06.303 xcodebuild[2758:58602] [MT] DTDeviceKit: deviceType from 00008301-288B69562E30402E was NULL
2020-12-01 16:58:06.408 xcodebuild[2758:58602] [MT] DTDeviceKit: deviceType from 00008301-288B69562E30402E was NULL
2020-12-01 16:58:06.520 xcodebuild[2758:58602] [MT] DTDeviceKit: deviceType from 00008301-288B69562E30402E was NULL
[16:58:11]: Command timed out after 6 seconds on try 2 of 4, trying again with a 12 second timeout...
2020-12-01 16:58:12.314 xcodebuild[2773:58983]  DTDeviceKit: deviceType from 00008301-288B69562E30402E was NULL
2020-12-01 16:58:12.315 xcodebuild[2773:58927] [MT] iPhoneConnect: 📱 == Underlying device preparation errors ==
2020-12-01 16:58:12.315 xcodebuild[2773:58927] [MT] iPhoneConnect: Failed _shouldMakeReadyForDevelopment check even though device is not locked by passcode.
Domain: com.apple.platform.iphoneos
Code: 5
Failure Reason: allowsSecureServices: 1. isConnected: 0. Platform: >. DTDKDeviceIdentifierIsIDID: 0
User Info: {
    DVTDeviceDescription = "\Ud83d\Udcf1";
}
--
2020-12-01 16:58:12.315 xcodebuild[2773:58927] [MT] iPhoneConnect: 📱 == END: Underlying device preparation errors ==
2020-12-01 16:58:12.316 xcodebuild[2773:58927] [MT] DTDeviceKit: deviceType from 00008301-288B69562E30402E was NULL
2020-12-01 16:58:12.420 xcodebuild[2773:58927] [MT] DTDeviceKit: deviceType from 00008301-288B69562E30402E was NULL
2020-12-01 16:58:12.544 xcodebuild[2773:58927] [MT] DTDeviceKit: deviceType from 00008301-288B69562E30402E was NULL

+----------------------------+--------------------------------------+
|                   Summary for snapshot 2.168.0                    |
+----------------------------+--------------------------------------+
| project                    | ./Workout App.xcodeproj              |
| output_directory           | /Users/mintuz/workspace/workout-app  |
|                            | /screenshots                         |
| devices                    | ["iPhone 12 Pro Max"]                |
| languages                  | ["en-US"]                            |
| launch_arguments           | [""]                                 |
| output_simulator_logs      | false                                |
| skip_open_summary          | false                                |
| skip_helper_version_check  | false                                |
| clear_previous_screenshots | true                                 |
| reinstall_app              | false                                |
| erase_simulator            | false                                |
| headless                   | true                                 |
| override_status_bar        | true                                 |
| localize_simulator         | false                                |
| app_identifier             | com.mintuz.Workout-App               |
| buildlog_path              | ~/Library/Logs/snapshot              |
| clean                      | false                                |
| scheme                     | Screenshots                          |
| number_of_retries          | 1                                    |
| stop_after_first_error     | false                                |
| result_bundle              | false                                |
| concurrent_simulators      | true                                 |
| disable_slide_to_type      | false                                |
| xcode_path                 | /Applications/Xcode.app              |
+----------------------------+--------------------------------------+

[16:58:17]: Clearing previously generated screenshots
[16:58:17]: Building and running project - this might take some time...
[16:58:18]: Patching simulators '/Users/mintuz/Library/Preferences/com.apple.iphonesimulator.plist' to scale to 100%
[16:58:21]: Launch Simulator iPhone 12 Pro Max
[16:58:21]: $ xcrun instruments -w A5BDF48B-7D92-481B-9236-C5CA6C8CB093 &> /dev/null
[16:58:25]: Overriding Status Bar
[16:58:25]: $ xcrun simctl status_bar A5BDF48B-7D92-481B-9236-C5CA6C8CB093 override --time 2007-01-09T09:41:00+00:00 --dataNetwork wifi --wifiMode active --wifiBars 3 --cellularMode active --cellularBars 4 --batteryState charged --batteryLevel 100 &> /dev/null
[16:58:27]: Running snapshot on: iPhone 12 Pro Max
[16:58:27]: $ set -o pipefail && xcodebuild -scheme Screenshots -project ./Workout\ App.xcodeproj -derivedDataPath /var/folders/f6/yzm6vm9d1v5djkcj_pm3l7xh0000gn/T/snapshot_derived20201201-2725-1gco8nw -destination 'platform=iOS Simulator,name=iPhone 12 Pro Max,OS=14.2' FASTLANE_SNAPSHOT=YES FASTLANE_LANGUAGE=en-US build test | tee /Users/mintuz/Library/Logs/snapshot/AppUITests-Screenshots.log | xcpretty
[16:58:27]: â–¸ Loading...
[16:58:28]: â–¸ 2020-12-01 16:58:28.799 xcodebuild[3036:66739]  DTDeviceKit: deviceType from 00008301-288B69562E30402E was NULL
[16:58:28]: ▸ 2020-12-01 16:58:28.800 xcodebuild[3036:66572] [MT] iPhoneConnect: 📱 == Underlying device preparation errors ==
[16:58:28]: â–¸ 2020-12-01 16:58:28.800 xcodebuild[3036:66572] [MT] iPhoneConnect: Failed _shouldMakeReadyForDevelopment check even though device is not locked by passcode.
[16:58:28]: â–¸ Domain: com.apple.platform.iphoneos
[16:58:28]: â–¸ Code: 5
[16:58:28]: â–¸ Failure Reason: allowsSecureServices: 1. isConnected: 0. Platform: >. DTDKDeviceIdentifierIsIDID: 0
[16:58:28]: â–¸ User Info: {
[16:58:28]: â–¸     DVTDeviceDescription = "\Ud83d\Udcf1";
[16:58:28]: â–¸ }
[16:58:28]: â–¸ --
[16:58:28]: ▸ 2020-12-01 16:58:28.800 xcodebuild[3036:66572] [MT] iPhoneConnect: 📱 == END: Underlying device preparation errors ==
[16:58:28]: â–¸ 2020-12-01 16:58:28.810 xcodebuild[3036:66572] [MT] DTDeviceKit: deviceType from 00008301-288B69562E30402E was NULL
[16:58:28]: â–¸ 2020-12-01 16:58:28.919 xcodebuild[3036:66572] [MT] DTDeviceKit: deviceType from 00008301-288B69562E30402E was NULL 

Environment

 
✅ fastlane environment ✅ ### Stack | Key | Value | | --------------------------- | -------------------------------------------------------------- | | OS | 11.0.1 | | Ruby | 2.6.3 | | Bundler? | false | | Git | git version 2.24.3 (Apple Git-128) | | Installation Source | /usr/local/bin/fastlane | | Host | macOS 11.0.1 (20B29) | | Ruby Lib Dir | /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib | | OpenSSL Version | LibreSSL 2.8.3 | | Is contained | false | | Is homebrew | false | | Is installed via Fabric.app | false | | Xcode Path | /Applications/Xcode.app/Contents/Developer/ | | Xcode Version | 12.2 | ### System Locale | Variable | Value | | | -------- | ----------- | - | | LANG | en_GB.UTF-8 | ✅ | | LC_ALL | | | | LANGUAGE | | | ### fastlane files:
`./fastlane/Fastfile` ```ruby default_platform(:ios) platform :ios do desc "Push a new beta build to TestFlight" lane :beta do build_app(scheme: "Workout App") changelog_from_git_commits upload_to_testflight end end ```
`./fastlane/Appfile` ```ruby app_identifier("com.mintuz.Workout-App") # The bundle identifier of your app apple_id("") # Your Apple email address itc_team_id("") # App Store Connect Team ID team_id("") # Developer Portal Team ID # For more information about the Appfile, see: # https://docs.fastlane.tools/advanced/#appfile ```
### fastlane gems | Gem | Version | Update-Status | | -------- | ------- | ------------- | | fastlane | 2.168.0 | ✅ Up-To-Date | ### Loaded fastlane plugins: **No plugins Loaded**
Loaded gems | Gem | Version | | ------------------------- | ------------ | | did_you_mean | 1.3.0 | | slack-notifier | 2.3.2 | | atomos | 0.1.3 | | claide | 1.0.3 | | colored2 | 3.1.2 | | nanaimo | 0.3.0 | | xcodeproj | 1.19.0 | | rouge | 2.0.7 | | xcpretty | 0.3.0 | | terminal-notifier | 2.0.0 | | unicode-display_width | 1.7.0 | | terminal-table | 1.8.0 | | plist | 3.5.0 | | public_suffix | 4.0.6 | | addressable | 2.7.0 | | multipart-post | 2.0.0 | | word_wrap | 1.0.0 | | tty-screen | 0.8.1 | | tty-cursor | 0.7.1 | | tty-spinner | 0.9.3 | | babosa | 1.0.4 | | colored | 1.2 | | highline | 1.7.10 | | commander-fastlane | 4.4.6 | | excon | 0.78.0 | | ruby2_keywords | 0.0.2 | | faraday | 1.1.0 | | unf_ext | 0.0.7.7 | | unf | 0.1.4 | | domain_name | 0.5.20190701 | | http-cookie | 1.0.3 | | faraday-cookie_jar | 0.0.7 | | faraday_middleware | 1.0.0 | | fastimage | 2.2.0 | | gh_inspector | 1.1.3 | | mini_magick | 4.10.1 | | rubyzip | 2.3.0 | | security | 0.1.3 | | xcpretty-travis-formatter | 1.0.0 | | dotenv | 2.7.6 | | bundler | 1.17.2 | | naturally | 2.2.0 | | simctl | 1.6.8 | | jwt | 2.2.2 | | uber | 0.1.0 | | declarative | 0.0.20 | | declarative-option | 0.1.0 | | representable | 3.0.4 | | retriable | 3.1.2 | | mini_mime | 1.0.2 | | multi_json | 1.15.0 | | signet | 0.14.0 | | memoist | 0.16.2 | | os | 1.1.1 | | googleauth | 0.14.0 | | httpclient | 2.8.3 | | google-api-client | 0.38.0 | | google-cloud-env | 1.4.0 | | google-cloud-errors | 1.0.1 | | google-cloud-core | 1.5.0 | | rake | 13.0.1 | | digest-crc | 0.6.1 | | google-cloud-storage | 1.29.1 | | emoji_regex | 3.2.0 | | jmespath | 1.4.0 | | aws-partitions | 1.388.0 | | aws-eventstream | 1.1.0 | | aws-sigv4 | 1.2.2 | | aws-sdk-core | 3.109.1 | | aws-sdk-kms | 1.39.0 | | aws-sdk-s3 | 1.83.1 | | CFPropertyList | 3.0.2 | | json | 2.3.1 | | forwardable | 1.2.0 | | logger | 1.3.0 | | stringio | 0.0.2 | | ipaddr | 1.2.2 | | openssl | 2.1.2 | | ostruct | 0.1.0 | | strscan | 1.0.0 | | date | 2.0.0 | | fileutils | 1.1.0 | | etc | 1.0.1 | | io-console | 0.4.7 | | zlib | 1.0.0 | | libxml-ruby | 3.1.0 | | rexml | 3.1.9 | | psych | 3.1.0 | | mutex_m | 0.1.0 | | webrick | 1.4.2 |
*generated on:* **2020-12-01**
tache commented 3 years ago

I am not seeing any issue with snapshot iOS 14.2 & XCode 12.2 in my normal work stream. Which means I have a Fastfile that configures the environment, has a lane called "screens" to do my snapshots/frames/uploads, where my command is fastlane ios screens.

I can - sorta - reproduce this error if I set my scheme target to be my physical device. Sims start, but nothing gets installed, XCTestCase tests are not run. The command used is fastlane snapshot.

Error is the following, and since I set that all up in my Fastfile when I call Snapshot, it is not present when I run directly. (Underlying Error: Failed to install the requested application. The bundle identifier of the application could not be determined. Ensure that the application's Info.plist contains a value for CFBundleIdentifier.)

Try running with --verbose to see more output.

mintuz commented 3 years ago

The only additional information I am seeing is this line for the 37 Simulators instaleld on my Mac.


Could not write domain /Users/mintuz/Library/Preferences/com.apple.iphonesimulator.plist;```
fastlane-bot commented 3 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest fastlane version and check if that solves the issue. Let us know if that works for you by adding a comment :+1:

Friendly reminder: contributions are always welcome! Check out CONTRIBUTING.md for more information on how to help with fastlane and feel free to tackle this issue yourself :muscle:

fastlane-bot commented 3 years ago

This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem :+1: