Fastlane uses default iOS Simulator despite device: "desired device" in run_tests lane - xctest

In my FastFile, I have defined:
run_tests(
scheme: "TestsScheme",
device: "iPad mini (6th generation)",
output_directory: "./report_unit_tests",
skip_slack: true,
)
I did verify that a simulator with this name actually exists in xcode.
Despite this, the unit tests 'always' run on the iPhone SE (3rd generation). This device is the last one in the list in the xcode devices & simulators screen.
I also tried with:
run_tests(
scheme: "TestsScheme",
devices: ["iPad mini (6th generation)"],
output_directory: "./report_unit_tests",
skip_slack: true,
)
I got this working by deleting all simulators from xcode, leaving only the one(s) that I want the tests to run on.
What is going wrong?
Have I misconfigured something?
Is Fastlane missing my config here?
I am using:
fastlane (2.210.1)
Bundler 2.3.24
ruby 3.0.0p0 (2020-12-25 revision 95aff21468)
gem 3.2.3

Related

React native run-ios fails. ios build fails. Android works. Xcode upgraded to 14 is only change

No code changes on my side. Xcode update happened and now the build fails. Android works just fine. here is the error I get:
** BUILD FAILED **
The following build commands failed:
SwiftEmitModule normal x86_64 Emitting\ module\ for\ Stripe (in target 'Stripe' from project 'Pods')
SwiftCompile normal x86_64 Compiling\ AddPaymentMethodViewController.swift,\ AfterpayPriceBreakdownView.swift,\ Analytic.swift,\ Analytic+Payments.swift,\ APIRequest.swift,\ ApplePayHeaderView.swift,\ Async.swift,\ BackwardsCompatibleColors.swift,\ BillingAddressEditView.swift,\ BottomSheet3DS2ViewController.swift,\ BottomSheetViewController.swift,\ CardDetailsEditView.swift,\ CardScanningView.swift,\ CheckboxButton.swift,\ CheckboxElement.swift,\ ChoosePaymentOptionViewController.swift,\ CircularButton.swift,\ ConfirmButton.swift,\ ContainerView.swift,\ DefaultPaymentMethodStore.swift,\ DimmedView.swift,\ Dropd
package.json:
"#stripe/stripe-react-native": "^0.1.4",
i saw some other folks got this error and it solved for them to update to ios 14.0. i did the same but does not seem to solve my issue. here is my podfile:
platform :ios, '14.0'
xcode version:
Version 14.0.1 (14A400)
Try upgrading stripe to 0.19.0 in package.json, then run "pod update Stripe" in the ios folder.
https://github.com/stripe/stripe-react-native/issues/1183#issuecomment-1299967570

SwiftUI can't run on the device(Alamofire)

I use cocoapods to install alamofire in my project, it works fine in simulator. When I want to run my App on my iphone 6s(ios 13.3.1), it crashed and show the error message. My Xcode version is 11.3.1 (11C504). Is this issue appear due to latest swiftUI project? And is there some way to solve this issue? Please help. Thank you.
dyld: Library not loaded: #rpath/Alamofire.framework/Alamofire
Referenced from: /private/var/containers/Bundle/Application/9B2A3A91-D290-45D7-BA8E-6243A782E25C/Fitness(SwiftUI).app/Fitness(SwiftUI)
Reason: no suitable image found. Did find:
/private/var/containers/Bundle/Application/9B2A3A91-D290-45D7-BA8E-6243A782E25C/Fitness(SwiftUI).app/Frameworks/Alamofire.framework/Alamofire: code signature invalid for '/private/var/containers/Bundle/Application/9B2A3A91-D290-45D7-BA8E-6243A782E25C/Fitness(SwiftUI).app/Frameworks/Alamofire.framework/Alamofire'
/private/var/containers/Bundle/Application/9B2A3A91-D290-45D7-BA8E-6243A782E25C/Fitness(SwiftUI).app/Frameworks/Alamofire.framework/Alamofire: stat() failed with errno=25
/private/var/containers/Bundle/Application/9B2A3A91-D290-45D7-BA8E-6243A782E25C/Fitness(SwiftUI).app/Frameworks/Alamofire.framework/Alamofire: code signature invalid for '/private/var/containers/Bundle/Application/9B2A3A91-D290-45D7-BA8E-6243A782E25C/Fitness(SwiftUI).app/Frameworks/Alamofire.framework/Alamofire'
/private/var/containers/Bundle/Application/9B2A3A91-D290-45D7-BA8E-6243A782E25C/Fitness(SwiftUI).app/Frameworks/Alamofire.framework/Alamofire: stat() failed with errno=1
/private/var/containers/Bundle/Application/9B2A3A91-D290-45D7-BA8E-6243A782E25C/Fitness(SwiftUI).app/Frameworks/Alamofire.framework/Alamofire: code signature invalid for '/private/var/containers/Bundle/Application/9B2A3A91-D290-45D7-BA8E-6243A782E25C/Fitness(SwiftUI).app/Frameworks/Alamofire.framework/Alamofire'
/private/var/containers/Bundle/Application/9B2A3A91-D290-45D7-BA8E-6243A782E25C/Fitness(SwiftUI).app/Frameworks/Alamofire.framework/Alamofire: stat() failed with errno=1
Below is my Podfile:
# Uncomment the next line to define a global platform for your project
# platform :ios, '13.3.1'
target 'Fitness(SwiftUI)' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for Fitness(SwiftUI)
pod 'Alamofire'
pod 'SwiftyJSON', '~> 4.0'
pod 'AlamofireImage', '~> 3.5'
end
There is an open issue:
https://github.com/Alamofire/Alamofire/issues/3051
Seems to happen on ios 13.1.3 with non-developer Apple ID. Right now you can switch to developer Apple ID or remove use_frameworks! from pods (sadly that can make other dependencies throw error)
What fixed this issue in my case was to delete the Apple Development profile from my device and then let Xcode install it again when I ran the app on the device.
General > Device Management > Apple Development ... > tap on it then tap on Delete App. Then when you run again the app one your device the profile will be installed again and you'll be asked to Trust it again.
To be fair, I've also done a pods update.

Detox field CFBundleIdentifier not found inside Info.plist

Following Expo usage guide for detox and getting error below when running detox test.
Using:
"detox": "^10.0.10",
"detox-expo-helpers": "^0.6.0",
"expo-detox-hook": "^1.0.10"
IPA made with :
xcode v 9.4.1
expo v 31.0.6
Also tried IPAs built with xcode v10 and expo v 32.0.0, same error.
Error:
Error: field CFBundleIdentifier not found inside Info.plist of app binary at /Users/admin/Desktop/expo-test/bin/gogonow.app
at SimulatorDriver.getBundleIdFromBinary (/Users/admin/Desktop/expo-test/node_modules/detox/src/devices/drivers/SimulatorDriver.js:70:13)
Try with in the detox configuration
you should take care of .app path, xcodeproj path, Scheme[The app name] and the info.plist path.
This should work..

Where does React-Native AsyncStorage save data on disk using iPhone Simulator?

Using IOS Simulator, where does React-Native AsyncStorage save the data on disk ?
I am using IOS Simulator version 10.0 and running IOS 10.2 and react-native 0.40.0
React Native async storage data is inside Documents folder of you application sandbox. For react-native 0.40.0 it is Documents/RCTAsyncLocalStorage_V1/manifest.json.
Path to sandbox folder for iOS Simulator (Xcode 8.2) is: ~/Library/Developer/CoreSimulator/Devices/{DEVICE_ID}/data/Containers/Data/Application/{APP_ID}
To find DEVICE_ID you can use xcrun simctl list from terminal.
Since your application gets new APP_ID on each run, you can't easily find it. I simple list all files inside Application and get most recently updated. See Xcode 6 keeps renaming my app's directory in iOS8 simulator after each run. and related for other solutions.
Based on the other helpful comments and answers, let me summarize how to inspect AsyncStorage:
First, cd into the Async directory.
cd `xcrun simctl get_app_container booted $BUNDLE_ID data`/Documents/RCTAsyncLocalStorage_V1
Then review the manifest:
jq < manifest.json
Then to pretty-print a non-null value in the manifest:
jq '."somekey"|fromjson' < manifest.json
For null values, find the file that has the value:
md5 -s "otherkey"
# 90f5ba064f8280d4c94b1f0b1a85a79e
Then pretty-print that file:
jq < 90f5ba064f8280d4c94b1f0b1a85a79e
I have also shared this in a gist

GHUnit target: failed to attach to process

I have a GHUnit test target, TestGH, which I'd like to use to test classes in my application, TestApp. I'm using Xcode 4.5 and trying to run TestGH on iPad 6.0 Simulator.
I believe I've configured the TestGH build correctly in the Build Settings and Build Phases. I've set the Target Dependencies to "TestApp" I've added the *.m files for the classes I'd like to test--along with the test case classes which will test them--to the Compile Sources section TestGH.
Other notable configuration:
In the app target, TestApp:
Symbols Hidden By Default: No
Product Name: TestApp
In the test target, TestGH:
Bundle Loader: $(BUILT_PRODUCTS_DIR)/TestApp.app/TestApp
Mach-O Type: Bundle
Other linker flags: -ObjC, -all_load
Product name: TestGH
Test Host: $(BUNDLE_LOADER)
I suppose I have this mostly right, as I discovered these settings by fighting through compile/link errors, reading stackoverflow, and blogs.
However, when I launch TestGH, the Log Navigator shows:
error: failed to attach to process ID 2305 (2305 corresponds to 'sh' according to activity monitor, fyi)
Simulator screen remains black, and Xcode shows "Attaching to TestGH" in the status.
Any ideas?
I've gone through many suggested fixes/workarounds I've seen discussed here related to "failed to attach to process."
Deleted DerivedData folder in Library/Developer/Xcode, deleted everything under Library/Application Support/iPhone Simulator. Tried all the options under Product->Edit Scheme for the TestGH target--tried Debugger = GDB, LLDB, None, Launch = Automatically, wait. Results are always the same.