Adam Davis
Adam Davis

Reputation: 93605

How does Visual Studio choose which iOS simulator to start?

I have Xcode 8.3.3 installed, and Visual Studio works with that for both compilation and simulation.

I installed Xcode 9.0.1, and want to test the app on the iPhone X to make sure that there aren't any display issues.

I don't want to compile with Xcode 9.0.1, I just want to use the simulator.

I don't see where in Visual Studio for Mac I choose the simulator to run. How do I configure Visual Studio to start a specific simulator?

Upvotes: 1

Views: 1107

Answers (1)

SushiHangover
SushiHangover

Reputation: 74174

Xamarin directly calls into the SimulatorKit.framework in Xcode9 vs CoreSimulator.framework in Xcode8 in order to start Simulator.app within each respected Xcode bundle and make calls into it.

So basically what you are asking is not possible within the VS4M IDE, but from the cmd-line it is using Xcode tools.

You can use simctl (via xcrun) to run a particular sim device and install an app bundle into it.

Get a list of all the supported sims (you need the device id (GUID):

xcrun simctl list

Boot a sim:

xcrun simctl boot BDC5B693-9957-4034-BEFD-D3545F875DF6

Display the booted sim:

open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app

Install an app bundle in the booted sim:

xcrun simctl install booted /user/sushi/code/gitlab/iPadProGenomeDNADashboard/iOS/bin/iPhoneSimulator/Debug/device-builds/GenomeDNADashboard.app

Doing this enables you to install a VS4M/Xcode8-based app bundle into a iPhone 8/8s/X/... Xcode9-based simulator and test the UI. You, of course, can not debug it this way.

Upvotes: 1

Related Questions