microsoft / vscode-mono-debug

A simple VS Code debug adapter for mono
Other
159 stars 173 forks source link

Support Xamarin #34

Open VysotskiVadim opened 7 years ago

VysotskiVadim commented 7 years ago

This is some kind of proof of concept, which shows that it's possible to debug Xamarin application using VS Code. I'd like you to review the idea and probably help me with advice.

Now it supports only Xamarin.Android, but Xamarin.IOS is similar. To start debugging build and deploy Xamarin.Android application via command line or ide, then define "packageName": "com.yourapp.name" in launch configuration, then run debugger. Debugger expects that you have adb in path. I tested debugger only on mac os.

Xamarin uses some "special" way to connect sdb, you can find more details here https://github.com/xamarin/xamarin-macios/blob/xamarin-mac-3.4.0.33/runtime/monotouch-debug.m#L1270 android has similar code, so I just send few packages before starting connection.

I'm going to continue implementing Xamarin.Anroid debug, then I will implement Xamarin.IOS debug.

Please, share you thoughts about this feature with me.

VysotskiVadim commented 7 years ago

Added example

borgdylan commented 7 years ago

I have made this work in the past by setting properties by means of ADB, and using the attach support already available.

VysotskiVadim commented 7 years ago

@borgdylan , you're right, it is how debugger works.

But it's not enough for comfortable work: debugger functionality should include:

  1. Install application on device: for first release we can work only with one device, but in future it should be some kind of drop down where we can select device. I believe installing should be done by MsBuild tasks because build system know where to find compilation artifacts, and Xamarin already have nice infrastructure for installing. Now I use Install target from Xamarin.Android, but unfortunately I hasn't found something similar for Xamarin.IOS. Any way it's possible to install via libmobiledevice.
  2. Launch application. It's not a problem for Android, hasn't investigated for IOS yet.
  3. Connect output from device.
  4. Connect debugger.
msftclas commented 6 years ago

CLA assistant check
All CLA requirements met.

VysotskiVadim commented 6 years ago

Demo with current functionality: https://youtu.be/RnWTy1D031k

SimantoR commented 5 years ago

Hi, loving this project. This could very well enable Xamarin App development in Linux systems. Anyone tried this on Ubuntu or any other Linux distro yet?

VysotskiVadim commented 5 years ago

@SimantoR, yes check vscode-xamarin-debug, it's tested on Ubuntu.