how to simulate ios app in windows using xamarin visual studio 2015 - ios

I am trying to simulate an iOS app on my windows machine using visual studio 2015(Xamarin installed). My windows machine is connected to a mac agent. When I simulate the app in the windows machine the simulator opens in the mac. Can any one tell me how to simulate the app on my windows machine.

You can use the iOS remote simulator. To use this feature you must update Xamarin and turn on remote simulator in Tools->Options->Xamarin->iOS.
You still need a mac for this feature.

You can use VNC to remote into the mac to show the simulator. That is what Xamarin dev's do at Evolve.
Unfortunately, that is your only option at the moment.

To simulate the iOS application, you must need MAC machine. Using Windows machine with Xamarin Studio, you can develop iOS application. But to run it on device or simulator, you need Mac machine.

Look at these solutions to remotely see the mac window:
Apple Remote Desktop
TeamViewer !
Chrome Remote Desktop
VNC Client. Activate screen sharing:

To fix this problem please follow these steps assuming your windows machine is connected to a mac agent:
Download and install the "Remoted iOS Simulator (for Windows)":
https://developer.xamarin.com/guides/cross-platform/windows/ios-simulator/
Go to Tools -> Options -> Xamarin -> iOS Settings:
Tick the checkbox "Remote Simulator to Windows"
Click in Build -> Configuration Manager:
Find your iOS project in the list and make sure the Platform is "iPhoneSimulator"
In your solution explorer right click in your iOS project and go to "Properties":
In the tab "iOS Build" find the section "Linker Options" and select the Linker behavior to "Link all assemblies" and Save
In your solution explorer right click in your iOS project again and click "Clean" and after that click "Rebuild"
Set the Visual Studio to run in Debug Mode and select "iPhone 5s iOS 9.3" click in option to launch the iPhone Simulator.
I hope it helps.

Remote iOS simulator is only available on enterprise
https://developer.xamarin.com/guides/cross-platform/windows/ios-simulator/
Remoted iOS Simulator requires a Visual Studio Enterprise license

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.

Unable to run on iOS Simulator from Visual Studio on Windows

The Issue
Developing on Windows with Visual Studio, and trying to run my app in iOS Simulator.
I'm not fussy whether the Simulator runs locally on my Windows machine, or on the Mac itself.
The Mac is "connected" from within Visual Studio, and Visual Studio successfully installed any missing libraries it required remotely on the Mac.
My app runs wonderfully on Android in both the Android simulator and physical devices.
But I'm unable to get the iOS Simulator to run when launched from Visual Studio.
Environment
Windows machine:
Windows 10
Visual Studio 2019 Preview 16.11.0 Preview 3
Xamarin Mobile Blazor Bindings (doesn't to seem to be relevant, as I've tried creating other brand new iOS-related projects from within VS, with the same result).
Mac
MacBook Air, running Big Sur.
Xamarin.iOS14.20.0.24
Xcode 12.5.1
Simulator 12.5.1
Different Scenarios Tried
Scenario 1 - Enabled Remote Simulator to Windows
Visual Studio → Options → Xamarin → iOS Settings → Simulator - Checked "Remote Simulator to Windows".
Selected "iPhoneSimulator".
Selected iOS project from solution "BlazorHybridApp.iOS".
Selected from the list of available devices "iPod touch (7th generation) iOS 14.5)".
Clicked "Run".
Scenario 1 - Result within Visual Studio on Windows
Scenario 2 - Disabled Remote Simulator to Windows
Visual Studio → Options → Xamarin → iOS Settings → Simulator - UNCHECKED "Remote Simulator to Windows".
Selected "iPhoneSimulator".
Selected iOS project from solution "BlazorHybridApp.iOS".
Selected from the list of available devices "iPod touch (7th generation) iOS 14.5)".
Clicked "Run".
Scenario 2 - Result within Visual Studio on Windows
Error message:
error MT0069: The app directory '/Users/macbook/Library/Caches/Xamarin/mtbs/builds/BlazorHybridApp.iOS/373192a984aab952b21bd389276fc38f881a1f70c8927669096f762b8fab1f51/bin/iPhoneSimulator/Debug/BlazorHybridApp.iOS.app' does not exist.
I checked on the MacBook, and indeed the folder does not exist (I'd expect it to be auto-created as part of the build?).
So, I manually created the folder on the Mac, and reran from Visual Studio with the same settings selected.
Scenario 2 - 2nd Result within Visual Studio on Windows
Error message:
error MT1008: Failed to launch the simulator: Could not find required file '/Users/macbook/Library/Caches/Xamarin/mtbs/builds/BlazorHybridApp.iOS/373192a984aab952b21bd389276fc38f881a1f70c8927669096f762b8fab1f51/bin/iPhoneSimulator/Debug/BlazorHybridApp.iOS.app/Info.plist'.
I checked on the MacBook, and the specified file does not exist. In fact the folder I manually created is empty. I'm assuming this is where Xcode should be generating the binaries, etc.?
Despite the error message, on the MacBook, the Simulator DID launch, but did not launch my app.
Other Info
Big Sur/Xcode newly installed
This is a virgin MacBook, so no configuration changes have been made to the OS or Xcode.
Confirmed Simulator is working on MacBook
I have checked that the Simulator is working ok on the MacBook, by creating a new App project on the MacBook from within Xcode and running it on the Simulator.
Even tried Visual Studio 2022
Out of desperation, I have also tried downloading Visual Studio 2022 Preview which also has the required mobile dev support, but got the same issues.
Any ideas?
Can anyone offer any advice? Would be very gratefully received.
For Scenario 1, it is a known issue and it has been reported here .
According to the latest reply , there will be a release for this issue soon .
For Scenario 2 , I would suggest you
Update everything to the latest stable version (vs for windows , vs for mac , Xcode).
Delete bin and obj folders in Forms and iOS project , rebuild and try again .
If problem persists try to create a new project and test .

Xamarin App running in Ios simulator using visual studio

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.

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

Can ios simulator can be run in Windows

I m working on appium scripting for mobile application automation testing.
I m able to simulate android device using the emulator and run the script in the emulator.
Now my next task is to run in ios. Please let me know it is possible to do it in ios emulator in Windows machine. If so some headsup on it.
You can not. There are platforms like React Native, Flutter, Xamarin, etc which enables you develop iOS applications; but when it comes to debugging and deployment, you have to have a macOS, which in turn requires a Macintosh machine.
Yess you can use Remote simulator to windows by enabling it under
Tools >> Option >> Xamarin >> IOS setting >> Remote simulator to windows.
But you still need active mac agent connection to build your app
You can use Appium studio free community edition for testing iOS physical device from windows machine.
note:- I have tested appium studio personally and think it will be useful for others.

Resources