How to connect mobile to PC using ADB
Hello,
In this Post I will be discussing about how to connect your mobile phone to PC using ADB command.
Lets go step by step to implement this.
STEP ONE:
Install Android Studio on your PC.
STEP TWO:
Create “ANDROID_HOME” environment variable by giving android/sdk path in it.
STEP THREE:
Enable “USB Debugging” in your phone.- Go to your Phone Settings >> About >> Tap the Build Number/MIUI version 7 times to enable “Developer Options”.
In Developer Options >> Enable USB Debugging.
In Developer Options >> Enable USB Debugging(Security Settings)
.
STEP FOUR:
Connect your phone to your PC using USB.Run the command “adb devices”. It will give output as follows:
List of devices attached <encrypted device id> device
Run the command
adb tcpip 5555
, it will restart adb on default port.Go to your Phone Settings >> Status >> Check Ip of your phone.
Run the command in command prompt of your pc:
adb connect <ip address of your phone> <Press Enter>
If the everything is successful, command prompt will displayed message asconnected to <ip address of your phone>
.Again run the command
adb devices
, it will show 2 devices as follows:
List of devices attached<encrypted device id> device
<ip of your phone> device
Now, disconnect your phone from pc and again run the command
adb devices
, it will show only 1 device connected as follows:
List of devices attached<ip of your phone> device
Congratulations, you have successfully connected your device to your PC, now you don’t need to keep your device connected through USB all the time.