1. Turn on the phone USB debugging function
Show "Developer Options" (Developer options are hidden by default, generally need to go to "settings"-"about phone" seven consecutive clicks, you can show "developer Options")
Set developer options to On
Turn on USB debugging
2. Connect the device to the computer via USB and use the "LSUSB" command to view the device's vendor ID and Product ID
3. Switch to the root user and create the following file:
/etc/udev/rules.d/51-android.rules
and add the following content:
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4ee2", MODE="0666", GROUP="<username>"
Where the values of Idvendor and idproduct are the data that was previously found; username is the user of the computer
4. Authorization
chmod a+r /etc/udev/rules.d/51-android.rules
5. Restart the USB service
Sudo/etc/init.d/dev restart
For more detailed information, please refer to: Google official documentation
USB connected phone Debug in Ubuntu