This project has moved. For the latest updates, please go here.

imlement adb wait-for-device event

Jul 27, 2014 at 12:52 AM
I want to create method that will be called when i connect the device.

I saw the DeviceConnected event, but i down't know how to use it.

Some one can post some example how to do this?

Thanks a lot.
Aug 24, 2014 at 5:52 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Mar 10, 2015 at 7:00 PM
AndroidDebugBridge adb = AndroidDebugBridge.CreateBridge(adbPath, false);
adb.DeviceConnected += DeviceConnect;
adb.DeviceDisconnected += DeviceDisconnect;

function signatures
public void DeviceConnect(object sender, DeviceEventArgs deviceEventArgs)
// your connect code here

public void DeviceDisconnect(object sender, DeviceEventArgs deviceEventArgs)
// your disconnect code here
Marked as answer by camalot on 3/11/2015 at 8:55 AM