How can I check adb device is connected in batch files? I wrote "adb devices" in the batch file, but I want it as a condition so the app working smoothly and automatically So if the user is not connected his device print no device and exit the app, Otherwise resume the app.
Pipe the output to find and analyse the errorlevel:
adb devices -l | find "device product:" >nul
if errorlevel 1 (
echo No connected devices
) else (
echo Found!
..............
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With