I am using MAD-Bee(Managed ADB) library to access ADB in C#. I am just trying to get list of devices attached to PC. I am getting list of devices properly when I use ADB from command prompt, but I get 0 in my C# form.
Here's the code I've tried -
AndroidDebugBridge mADB;
String mAdbPath;
IList<Device> mDeviceList = null;
public Form1()
{
InitializeComponent();
mAdbPath = Environment.GetEnvironmentVariable("ANDROID_ROOT");
mADB = AndroidDebugBridge.CreateBridge(mAdbPath + "\\platform-tools\\adb.exe", true);
mADB.Start();
var list = mADB.Devices;
Console.WriteLine(""+list.Count);
}
The problem is MAD-bee doesn't have any proper documentation or guide on how to start with it. Any help in this?
I would like to suggest you use another library in C# for your application.
I found AndroidLib.dll on XDA which has provided a way of interfacing my C# application.
The Thread can be found here:
http://forum.xda-developers.com/showthread.php?t=1512685
He has a GITHUB for the source and in the GITHUB he has example projects in Visual Studio solutions files to learn from as well as detailed usage.
Woops found it now -
More information is available in these tests -
MadBee Tests