Command:
adb devices
Result example:
List of devices attached emulator-5554 device PhoneRT45Fr54 offline 123.454.67.45 no device
First column - device serial number
Second column - connection status
Android documentation