I am trying to debug via WIFI using a MI Box S device in Ubuntu 20.04/Android studio.
I have been successful doing this in Windows 10 (but would rathe develop in Linux)
I have been successful doing this with other devices (Android phones/tv boxes)
I have followed all the instructions on setting thins up with adb
The problem is that the device is not being seen by the system
lsusb does not list it
I've added the following line to /etc/udev/rules.d/51-android-rules
SUBSYSTEM=="usb", ATTR{idVendor}=="2717", MODE="0666", GROUP="plugdev"
Nothing seems to work.
Is there something I'm missing? a Driver, Some configuration?
Thanks in advance
I tried to use my Acer Chromebook tab to debug my app in Android Studio but I have some troubles ...
I followed this documentation : https://developer.android.com/topic/arc/development-environment#debug_with_adb
The last command I typed is "sudo ectool usbpd 0 dr_swap"
And when I type sudo "ectool usbpd 0", I have this :
"Port C0: enabled, connected State:SNK_DISCOVERY Role:SNK UFP, Polarity:CC1"
I have nothing in Android or when I use sdk tools with the command "adb devices", the list is empty.
Could you help me please ?
It looks like from your question that you are attempting to debug using USB rather than using ADB over network. Since you mentioned that you are using an Acer Chromebook, I do not believe that they support USB debugging (based on this Chromium Document).
Instead, what I would encourage is that you utilize ADB over network instead (don't forget to put your laptop in developer mode).
I have a Samsung Galaxy S8 and whenever I try to debug an app in Android Studio the app crashes and disconnects the phone from the PC.
I don't know if it's the drivers for the phone that I need to re-install or if there is a bug in the operating system or maybe something else.
I'm running Android Studio 3.1 under Linux Mint 18.3 Sylvia edition, and I'm running KDE.
Yes, there is a driver for Linux. You can get it from here:
https://dl.google.com/android/repository/platform-tools-latest-linux.zip
try following these steps to set it up correctly (I have it from https://www.xda-developers.com/install-adb-windows-macos-linux/)
Extract the ZIP to an easily-accessible location (like the Desktop for example).
Open a Terminal window.
Enter the following command: cd /path/to/extracted/folder/
This will change the directory to where you extracted the ADB files.
So for example:cd /Users/Doug/Desktop/platform-tools/
Connect your device to your Linux machine with your USB cable. Change the connection mode to “file transfer (MTP)” mode. This is not always necessary for every device, but it’s recommended so you don’t run into any issues.
Once the Terminal is in the same folder your ADB tools are in, you can execute the following command to launch the ADB daemon: adb devices
Back on your smartphone or tablet device, you’ll see a prompt asking you to allow USB debugging. Go ahead and grant it.install adb
Finally, re-enter the command from step #7. If everything was successful, you should now see your device’s serial number in the Terminal window output.
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 :(
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.
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.
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.
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.
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...
For my situation with Ubuntu 16.04, with my device properly connected via USB, confirmed by lsusb
The solution is let the Studio aware of the Android/Sdk folder by defining
export ANDROID_HOME=<the Android/Sdk folder>
in ~/.bashrc
(I have installed the SDK at a custom location)
Then start a new shell, from there re-start the studio, then it works.
I solved with this: https://stackoverflow.com/a/37109216/5081063
If the problem is only on Android Studio and not in your OS you can solve with that.
So first check if adb recognize any devices with:
$ adb devices
If yes, open Android Studio and follow these steps:
Go to Run > Edit Configurations...
Under Deployment Target Options select Show Device Chooser Dialog from the drop-down-list
if you are doing it first time in Ubuntu Linux, then Use sudo apt-get install to install the adb package. This gives you a community-maintained default set of udev rules for all Android devices.
or, use
sudo adb kill-server
sudo adb start-server
and check using
sudo adb devices
you can also check uncheck the usb debugging option, in your developer option in the phone.
follow this link for more info.
Run apps on a hardware device
Enable USB Debugging from Settings->Developer Options
Enable Developer Mode by clicking on build number several times
My device appeared as unrecognized and when I ran adb devices fom android-tools directory it said: adb not a command. Strange. So what I did is installed adb tools additionally and then run adb devices:
sudo apt-get install android-tools-adb
89LY0810Y unauthorized
Then I saw the dialog on my device and selected: Always authorize.
Please make sure your device is in debug mode.
If you have tried many terminal commands to connect your physical device to android studio in ubuntu and you failed to connect try this :- Connect your device and change your USB preference(device notification) to PTP,android studio will detect your device.see this image
I had the same problem, as I had enabled the USB Debugger but it was my first try so I didn't know what to expect. If you answer "yes" to "use as storage device," you will set it to mtp, if you answer no, after that you will have the option to connect on debug mode and it will appear.
I was using a Samsung A31 and Debian
After trying a lot of different solutions, I notice that the problem was my cable, so I changed it and now it works.
Thanks to RazorHail Answer.
Right now, I have my Android SDK and ADB set it up on my Linux system. I have created an emulator under Android AVD Manager and it runs. The problem is that I am trying to connect to an emulator using ADB shell but every time when I do
adb devices
there is nothing being listed under the command. But when I physically connect an Android device into a computer, adb is able to recognize the physical device.
I have tried
adb kill-server
and
adb start-server
I have also ran everything under ROOT privileges and can't happen to narrow down what is the problem.
If you haven't already, please enable "USB Debugging" in the the emulated Android instance. If you already have, what is the output of lsusb? Are the ports open? Scan 5037 and 5500-5600 on the emulators IP address (assuming you are using a UNIX-based OS and have networking enabled in the emulator).
(see also: https://developer.android.com/tools/help/adb.html)