Microsoft MVPDNN MVPXamarin Certified
I'm Andrew Hoefling, and I work for FileOnQ as a Lead Software Engineer building mobile technologies for Government, Financial and First Responders using Xamarin.
As a consultant I work on several different projects throughout a calendar year and I may need to circle back to old projects. It is very useful for me to have a virtual machine I can just boot up to pick up exactly where I left off. This also makes creating a new development enviornment super easy for me, I just spin up a new virtual machine and I am ready to go.
I have ran into several headaches while having a virtualized development enviornment in the mobile world. There are all sorts of DevOps problems you run into from not being able to nest virtualized machines to getting all the networking to play nicely together.
I do a lot of travelling and I typically bring my work with me which then requires me to have all my networking setup correctly.
Currently I work on a Xamarin.Forms project where I use an Azure Virtual Machine as my development machine and I use my laptop as my Android Emulator.
Typically when I am working at home I connect my Azure Virtual Machine to my office network via OpenVPN and everything is perfect. I am then able to use the Android Device Bridge to easily connect the machines together for active debugging.
While I am on the road travelling things get a little bit more complicated. I now need to make sure I am able to connect to my home network via Open VPN through my android device.
The simple solution is install the VPN client from your android device or emulator and connect back to your VPN. Once this is completed you can easily connect the Android Device to your Visual Studio environment via Android Device Bridge (ADB)
You will need the following pre-reqs prior to starting this how-to guide.
ovpn
OpenVPN for Android
.ovpn
+
Import
su
setprop service.adb.tcp.port 5555
5555
stop adbd
start adbd
Now you are all set from the android side of things, follow the Virtual Machine Guide to finish up the process.
Since our Android device is all configured and connected to our VPN it is time to connect the device to our development machine via Android Device Bridge (ADB).
Tools->Android
adb connect 192.168.1.1:5555
At this point you should receive a message that you are connected and you should see your device appearing in your debug options. Click debug and start the deploy/debug process.