android studio doesn't detect my device on my ubuntu laptop
Solution 1
First of all,
Open terminal and do following:
Do
lsusb
command to check your device is indeed connected.Do
adb devices
to check if your device is connected then it is detected as in adb mode.
2.a. if the above command is not found, do sudo apt-get install android-tools-adb
and then check if it is listed.
Secondly, post results of step 1 and 2 with your question to help us in finding a correct solution.
Troubleshooting:
- Make sure adb mode in enabled.
- Make sure you have opted for
Allow
option when prompted for in your device upon connecting to your ubuntu system. - This one is from some past LG users, Try connecting your device in PTP mode rather than MTP mode, it surprisingly works.
- If it atill doesn't work, (most likely your case), try googling. I landed upon this page by pressing I'M FEELING LUCKY, you should try to feel lucky once in a while. Source for step number 3 and 4
follow the steps as mentioned upon page:
- Create a file:
/etc/udev/rules.d/70-android.rules
. - Write:
SUBSYSTEM=="usb", ATTR{idVendor}=="1004", MODE="0666"
to the file. - Assign proper permission via
sudo chmod a+rx /etc/udev/rules.d/70-android.rules
- Reboot the system and restart udev.
As a second step of troubleshooting (make sure you again repeated troubleshooting from step1 in case you failed at this step)
Again, the process:
- Create a file:
/etc/udev/rules.d/51-android.rules
. - Write:
SUBSYSTEM=="usb", ATTR{idProduct}=="1004", MODE="0666"
to the file. - Assign proper permission via
sudo chmod a+rx /etc/udev/rules.d/70-android.rules
- Reboot the system and restart udev.
Solution 2
I faced the same issue but it was my mistake. I didn't turn on the " USB DEBUGGING MODE ".
Settings > Developer Option > Enable USB Debugging Mode.
Solution 3
Make sure you have adb installed in your ubuntu system. If not then type -
sudo apt-get install adb
Provide your system password and press 'Y' asked during installation process.
Then disconnect your device through USB and then reconnect it. You will have to grant permission for debugging which prompts on your device just after reconnecting.
Solution 4
Try to revoke USB debugging authorizations and then connect your device, it should show permission prompt for authorization.
go to
settings -> developer options -> revoke USB debugging authorizations.
Solution 5
I tried restarting adb using root priviledges and it worked for me. Use these commands in the terminal:
sudo adb kill-server
sudo adb start-server
Hope it works for you too...
Admin
Updated on July 10, 2022Comments
-
Admin almost 2 years
I am trying to run an app from Android Studio on my Ubuntu laptop.
I have enabled USB debugging, but it is still not working.
When I press run in Android Studio, it does not detect my device (LG G3 Lollipop).
I could not find any help :(
-
barnacle.m over 6 yearsVERY strangely, switching to PTP mode resulted in my Nexus 5X (running android 8.0) showing up in the adb list correctly. This answer gets an upvote for at least helping somebody!
-
ki9 about 6 yearsShould it be
51-android.rules
or70-android.rules
? -
Himanshu Shankar almost 6 years@Keith it may have changed for you, as the answer is old.
-
ki9 almost 6 yearsYeah, but the answer mentions both.
-
Asalle about 4 yearsthanks man, I've been struggling with this for a second now..
-
Yoones Mehdian about 4 yearsit was the case for me. Android 5 Shiaomi