Yes, it is possible using mlaunch tool in the way that Visual Studio does. It is still closed source but by reading its help page and xamarin-macios code. There is no need for IPA build but simply build for debug environment, use mlaunch for installing the app to the simulator/device and run it afterward.
Example: install and launch app after msbuild
/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mlaunch --launchsim=bin/iPhoneSimulator/Debug/IOS_PROJECT_NAME.app --device::v2:runtime=com.apple.CoreSimulator.SimRuntime.iOS-12-4,devicetype=com.apple.CoreSimulator.SimDeviceType.iPhone-XR
You should see Press enter to terminate the application message when the command is executed.
Explain
msbuild /t:Build
Locate the mlaunch
usually in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mlaunch
. Just find your Xamarin.iOS.framework path
List all available simulator with its runtime and device type value
mlaunch --listsim simulators.xml
Open the output file simulators.xml and select a simulator, i.e. iPhone XR, keep the value of SimRuntime
SimDeviceType
for the next step
- Install your debug Xamarin.iOS app bundle and launch on the simulator
mlaunch --launchsim=[IOS_APP_PATH] --device::v2:runtime=[SimRuntime],devicetype=[SimDeviceType]
--launchsim
is the relative path to your Xamarin.iOS app bundle built by msbuild task in the first step, usually bin/iPhoneSimulator/Debug/IOS_PROJECT_NAME.app
--device
composes of SimRuntime and SimDeviceType that you got from the XML file.