In AndroidDevice.handle_usb_disconnect, we never explicitly stop snippet client's port forwarding.
Then during service restoration, a new host port is allocated for the snippet client.
This causes leftover ports in adb port forwarding, which on rare occasions can trigger an adb bug where adb forward --list command fails, which crashes Mobly.
In
AndroidDevice.handle_usb_disconnect
, we never explicitly stop snippet client's port forwarding. Then during service restoration, a new host port is allocated for the snippet client.This causes leftover ports in adb port forwarding, which on rare occasions can trigger an adb bug where
adb forward --list
command fails, which crashes Mobly.