Is there any safe way or just we need to un-plug the USB cable directly? Didn't get the solution anywhere. Sorry, if my doubt is silly as I am new to Android Development & just bought my new costly Android phone. So I do not want any damage or harm to my phone.
When I connected my phone, it says, "USB debugging connected" & "Connected in Media transf. mode". How to disconnect? please corporate. Thanks!
Change the USB settings on the phone from 'mass storage device' to 'charging'; this will stop the phone from being automounted on the PC. This won't affect adb, which uses a different mechanism to talk to the phone. Then you can just yank the plug whenever you feel like it.
(If you leave it in 'mass storage device' mode there's a chance that you'll corrupt the filesystem on the SD card when you pull the plug. Plus, the application you're working on won't be able to access the SD card anyway.)
like David Given said, keep your phone into Charging Mode (not media storage) to avoid any data loss on SD Card and keep the USB debugging On. Afterwards, you may simply plug/unplug your phone without any worries.