Xamarin App running in Ios simulator using visual studio - ios

I am facing the issue to run the xamarin app in IOS simulator. Whenever i am trying to run this app it was asking me to add or pair the Mac. Since I dont own the Mac I tried to install Xamarin.Ios in windows. In this process i need to install the XCode in my windows 10 Os. First of all i am unable to download the Xcode tool from Apple portal with valid credentials. I followed the below 2 links but no luck to download and install the Xcode. Could you guys please help me the easiest solution to download install the Xcode to do the next level of run the App in windows.
https://learn.microsoft.com/en-us/xamarin/ios/get-started/installation/windows/?pivots=windows
https://apps.apple.com/us/app/xcode/id497799835?mt=12

Bottom line is that iOS apps must be build using a licensed Mac OS, period. Visual Studio for Windows does not actually build the iOS app, what it does do is connect to a Mac (which must have XCode installed) and facilitate a remote iOS build via XCode. However, if you have a Mac, you can build both iOS and Android code directly on your Mac using Visual Studio for Mac. Yes, it is frustrating that you must have access to a Mac OS to build iOS apps, but this is a requirement and there is no way around it.

Related

visual studio 2022 installs monoframework 6.12.0.174 on mac, then iOS Simulator fails

I use Visual Studio 2022 on Windows for Xamarin development for Android & iOS. I use a Mac Mini with M1 for the iOS builds. All has been working fine for over a month. A few days ago I allowed the MAC to perform an update. Today when I tried to build for iOS, the Pair To Mac dialog said there was a monoframework mismatch and offered to install monoframework 6.12.0.174 on the MAC. Initially I chose Cancel,and then rebooted both machines. The same error occurred when I tried again. This time I allowed the install. After the install completed, every time I try to use the iOS Simulator it hangs as soon as it appears. I would appreciate some direction. I do not know how to fix it and I do not know how to back-out the mono install on the MAC. Please help.
Solution: I updated Visual Studio & Visual Studio for Mac to the current versions. Then found in the following in the Visual Studio ReleaseNotes:
Known Issues
Deploying an iOS app with Visual Studio 2022 and Apple Xcode 13.3 results in a Remote iOS simulator window with a blank/black screen. Workaround: Disable the “Remote Simulator to Windows” check box in the iOS Settings under the Tools - Options menu. The iOS app should deploy correctly on the macOS host.
Following those instructions I disabled the “Remote Simulator to Windows” check box in the iOS Settings under the Tools - Options menu. The iOS app then deployed correctly, but on the macOS host, no longer can it deploy on the Windows machine from the Mac build host as in prior versions.

How to build IOS apps in flutter in windows

I want to develop a application for for my company. I'm using flutter to build it for both android and IOS platform. But I have only windows machine, so I'm only able to build it for Android. Can I build(generate apk) IOS flutter apps in windows machine ?
if yes please explain it well.
You can develop the UI on android itself. However, you need OSX to run an Iphone Simulator. An alternative would be to use a virtual machine with OSX installed. It is not recommended though.
Also, for IOS the build is different. It is not as simple as generating an apk and installing it on your phone. You will need itunes and a legit account to run it.
See more here

Unable to add apple device in Android studio

I want to try out the Kotlin Multiplatform Mobile (KMM) in Android studio. I have installed the Plugin and when I try to add configuration for IOS, nothing shows up. I just have an IOS option but nothing shows up when I click on it. The android device is already set up, so I was able to run it in Android.
I guess you are not running Android Studio on macOS. You must have macOS to compile through XCode and use Apple Simulators.
If you are running AS on macOS and you created the project with KMM plugin it's weird that you don't have the run configuration for iOS already set up, but you can try to click on the + button on the upper-left corner. Remember that you must have XCode (and Simulators) and command line tools installed on your machine.
If you are running AS on an OS different from macOS you can only compile the non native (not macOS or iOS) part of the library.
Had the same issue. What fixed it it for me was installing Xcode command line tools with xcode-select --install.
If that doesn't work, generally check the integrity of your Xcode setup.

How can I connect IOS project created by flutter to firebase? [duplicate]

I am new to developing mobile apps and wanted to try Flutter but I use Windows. Because Flutter doesn't support Windows yet I had the idea to use a virtual machine running Linux to install Flutter. Does this work?
Also in the Flutter setup it says this:
To develop Flutter apps for iOS, you need a Mac with Xcode 7.2 or newer.
Is there a way to develop iOS apps without having a Mac?
Yes, you can develop iOS apps with Linux (or Windows) using Android Studio or Visual Studio Code. The point of Flutter is that you have one code base and can deploy to both Android and iOS. So the development phase is no problem.
In the past you could only deploy iOS apps to the App Store if you had a Mac, but there are some more options now. See the following articles:
How to sign Flutter apps for iOS automatically without a Mac
Developing and debugging Flutter apps for iOS without a Mac
How to develop and distribute iOS apps without Mac with Flutter & Codemagic
Build an iOS app without a Mac or iPhone using Flutter
To test your app on the iOS simulator, though, it is still necessary to have a Mac. However, theoretically the app should have the same behavior for most things as on an Android device, so you wouldn't necessary need to test it using the iOS simulator. I would say long term you would probably want to consider getting a Mac, but it is certainly not necessary in the beginning.
Update: In a recent app I made, my tests passed in the Android emulator but crashed in the iOS simulator. It was a normal bug and nothing specific to iOS, but for some reason the Android simulator didn't crash. So for a production app, you really do need to test it on an iOS device/simulator.
As you point in your question:
To develop Flutter apps for iOS, you need a Mac with Xcode 7.2 or newer.
You can work around by using an external service (like Travis-ci or other) to build your code for iOS. However it's not usable as a developer workflow as that can take several minutes to get the artefact.
You should check out MacOS cloud solutions like MacInCloud. There are CI/CD solution that will support it (e.g. CircleCI and BitRise) however these are not suited for development.
Services like MacInCloud allow you to remote desktop into a Mac where you could conceivably use XCode remotely.
Windows is now partially supported in the way you can edit and publish for Android but you still can't create for IOS where a mac is required (XCode).
More informations https://flutter.io/setup-windows
You can use tools like Appollo to do just that directly from Windows or Linux. Appollo is a python CLI tool.
To install Appollo run pip install appollo, then setup your developer account with Appollo (https://appollo.readthedocs.io/en/master/tutorial/2_configure_app_store_connect.html) once this is done you can start building your app with appollo build start
You can check out a few example videos here : https://www.youtube.com/channel/UCBNRrJd4UP0QQRoYF4JOEmA

Xamarin iOS App deployment

The docs from Xamarin aren't explicit as to where an iOS device needs to be attached. I'm using VS to build a Xamarin app through a remote Mac Builder (connected via VPN) but my iphone is attached to my PC with Visual Studio. Its completely unclear as to whether or not you can deploy a compiled to from the PC you're running Visual Studio on or whether the iOS device needs to be USB'd to the remote Mac running the build.
Even though Xamarin offers developers the way to use C# creating native iOS applications, we also need to pair to a Mac which is required for compiling native iOS applications. So of course if you want to deploy on a real device, you need to connect it to the Mac.
It seems you have already known how to create a provisioning profile. This documentation tells you how to pair to a Mac to deploy applications. Also before doing that you also need to complete the following steps:
On a Windows machine, install Visual Studio 2017
On a Mac, install Xcode and Visual Studio for Mac

Resources