iPhone simulator takes minutes to launch using Xamarin.UITest - xamarin.forms

I'm trying to automate our Xamarin.Forms project (Android&iOS) and decided to try out Xamarin.UITest for some smoke testing.
I've managed to connect the app and using REPL I've also located the elements we wish to interact with.
The issue:
The test itself works, but when I try to run it, my iPhone simulator either freezes and/or restarts multiple times.
This means going through a simple login flow-test takes up to 5 minutes, where most of that is looking at a frozen simulator not launching my app.
The simulator will eventually launch and connect, although sometimes it appears to be running headless(!?), as my tests go through but I have no simulator open.
My app initializer:
public static IApp StartApp(Platform platform)
{
if (platform == Platform.Android)
{
return ConfigureApp.Android.StartApp();
}
//Environment.SetEnvironmentVariable("UITEST_FORCE_IOS_SIM_RESTART", "1");
IApp app = ConfigureApp.iOS
.StartApp(Xamarin.UITest.Configuration.AppDataMode.DoNotClear);
return app;
}
(note I have tried with and without the AppDataMode parameter).
And my setup
IApp app;
Platform platform;
public Tests(Platform platform)
{
this.platform = platform;
}
[SetUp]
public void BeforeEachTest()
{
app = AppInitializer.StartApp(platform);
}
My setup:
MacBook Pro 2020 running Big Sur (11.5.2)
Visual Studio Community 8.10.8
Xcode 12.5.1
Xamarin.Forms 5.0.0.2012
Xamarin.UITest 3.2.0
iPhone simulators tested:
iPhone 12 - iOS 14.4
iPhone 8 - iOS 14.4
iPhone SE (2nd gen) iOS 13.7
As a final note, when running the iOS project normally (just debugging), this behaviour is not observed. The rebooting & freezing only occurs on UITests.

Related

Flutter how to cancel all FirebaseAuth authStateChanges Subscriptions after hot restart?

whenever i hot restart the app in debug in Flutter, new Subscriptions keep getting added to FirebaseAuth.instance.authStateChanges().
What I need to know:
How many subscriptions does authStateChanges() already have?
How can i cancel a subscription on that stream (authStateChanges()) if the reference to the subscription is lost due to hot restart?
How can i guarantee, that my subscription is only fired once?
The problem:
Whenever i hot restart the app multiple (n) times, it fires n times. This is undesired. I want to make sure it only gets subscribed once and i want to make sure to cancel any subscription beforehand.
Here's the code i use:
StreamSubscription<User?>? subscription;
void onAuthStateChanged(Function(User?) onAuthStateChanges) async {
if (subscription == null) {
subscription =
FirebaseAuth.instance.authStateChanges().listen(onAuthStateChanges);
} else {
// Please do not subscribe
}
}
I use the following versions:
yaml:
firebase_core: ^1.10.6
firebase_auth: "^3.3.4"
flutter doctor:
Flutter (Channel stable, 2.8.1, on Microsoft Windows [Version 10.0.18363.1801], locale de-DE)
Android toolchain - develop for Android devices (Android SDK version 31.0.0)
Chrome - develop for the web
Visual Studio - develop for Windows (Visual Studio Community 2019 16.6.2)
Android Studio (version 3.2)
Android Studio (version 2020.3)
VS Code, 64-bit edition (version 1.62.2)
Connected device (4 available)

VS2019 Xamarin Forms Remote IOS simulator Black screen - How to fix?

Xamarin Forms Project
Microsoft Visual Studio 2019 Version 16.9
Xcode on Mac version 12.4
Using IPad Pro 11 inch running 14.4 as the simulated device and IOS version.
( I tried other simulators )
If I build and run Simulation on the Mac, it works. So i believe it is a remote simulation issue.
If you set IOS simulator to remote it starts and appears to run the simulation
in the simulator but it just shows a black screen.
Ive updated everything I can think of. Mac OS, XCODE on latest available.
Visual Studio, W10, all latest available and everything restarted...
Still it doesnt work. You do see brief at time of deployment dots spinner that reminds of the spinner when shutting down.
How do I fix the back screen simulation. ?
EDIT: With Latest Updates, it works again.
After upgrading to VS2022, upgrading Xcode on the mac.
Even the simulators are now ios15.x
Somewhere is all those updates the problem is gone.
You could have a try with Forget the Device first:
Next step, better need to reboot Mac .
Last, Pair to Mac again with Add Mac manually:
If it also can not work, maybe need to check the quality of network whether is well.

AndroidTV app builds ok and will install but can't be opened. Android 7.1.1 TV

I'm at the bottom of the J curve as far as Android development goes, but I can't even get the demo app to work on my Android TV. I build the TV device blank activity in Android Studio, and it works fine in an emulator. I have a banner(320x180pixels), android.hardware.touchscreen(false), android.software.leanback(true), and LEANBACK_LAUNCHER in the intent.
The APK (which I have signed with V2 and marked as a release) installs with warnings from playprotect (which I can't shut off in this locked-down TV) but cannot be opened. I have sideloaded other APK's via the same method. I have also tried not signing the APK.
The TV is an Axis 1832S running Android 7.1.1. I CAN put it into developer mode if that helps.
Does anyone have any hints, or a simple 'hello world' apk that works that I can try?

iPhone Simulator is constantly crashing

I'm running the latest macOS 11 beta (20A5364e) and Xcode 12b6 (20A5364e). When starting the Simulator it constantly crashes every 10-20s. Independent if an app is running or simply the Home Screen is shown. Anyone else/ Any known fixes?

firebase.auth().signInWithPopup(provider) hang on mobile devices

I'm trying to implement FB login on my ionic 2 app. It works perfectly on web, but when I build the android version and install it onto my mobile, the fbLogin function will just cause the app to hang. I tried to build live version, but it doesn't solve the hang problem.
facebookLogin(){
var facebook = new firebase.auth.FacebookAuthProvider();
return firebase.auth().signInWithPopup(facebook);
}

Resources