adb device list is empty for one particular device - android

I have two identical devices(not mobile phone) in which I am trying to update an apk file.
Device 1, I connect to my laptop using USB cable. I get a prompt to open the internal storage system of the device which is basically a SD card.
Now I run the adb devices command and I get the list of devices attached as "0123456789ABCDEF device"
Then I disconnect the device 1 and connect device 2(Also reconnect the USB cable, adb kill-server and start it again). I get the same prompt to open the internal storage system. Then I run the adb devices and it the list is empty.
In both cases, I can see my devices correctly under the portable devices. I can not enable the USB debugging mode in the devices as the devices always brings an application after power up. So I can not reach settings screen.
Any help is appreciated. If you any questions to support, i would be able to answer.

I think this question is because the vid of device2 is differnet from device1. You need to add the vid of device2 in adb_usb.ini file in C:/Users/your_pc_name/.android directory. You can get the vid from Computer-Device Management.

Related

INSTALL_FAILED_USER_RESTRICTED: Install canceled by user install apps via adb (no Sim Card)

I am trying to install an app on my Android device via adb and this error appears all the time.
My device does NOT have a sim card, so I cannot activate install via usb or usb debugging security setting.
Worth mentioning:
-usb debugging is on and device model is Redmi Note8 Pro.
-installing via adb was working well and the issue appears after the recent device factory reset.
Insert a sim, enable Install via USB and remove the sim.
Toggle will remain switched on even after removing the sim.

Android WiFi ADB plugin not working. Giving error

I installed the Android WiFi ADB plugin to run the app wirelessly. But it's not working it's giving error that Phone and PC should be connected on the same network. I use my phone hotspot to run the internet on my PC. Then I use another phone but then also same error. Someone says it will not work because you use the mobile hotspot for an internet connection on your PC. But when I try to connect another phone then also the same issue. But the same way my friend also does. he also uses the internet using a mobile hotspot but it's working fine on his phone. I have a POCO F1 Phone.
I'm answering this hoping this may help others as well as I find it helpful for my use.
First, Turn on ADB in your phone's developer options. You can search Your_phone_model developer options to find that.
Second, After turning on ADB, Connect your phone with data cable to your laptop/desktop.
Open a Command prompt window, Type adb tcpip 5555, Press allow in adb prompt shown in your phone, it will show restarting adb in tcpip mode. Now, disconnect the USB cable. You can use different port number to connect another device.
Type adb connect your_phone_ip:5555 as for example adb connect 192.168.43.1:5555 in case of hotspot. You can check Phone's IP in WIFI's advanced setting of your phone or in status section.
Now, Everytime your device restarts, repeat steps 3-4.
You can also make a script, just type adb connect your_phone_ip:5555 in a notepad file, save it as name.bat file, right click on it and send to desktop (create shortcut), in the settings on the shortcut, set any shortcut keys. Now, anytime you want to connect, just press the shortcut keys. That's how I do it. You can further open Android studio by this script so it will open Android Studio as well.
Remember, whenever it says Device is Offline, restarts your phone's wifi and reconnect it.

How to store all the android applications to the SD Card by default

I am trying out this adb shell procedure to store all my android apps to the SD Card on my new samsung galaxy tab 4.i have tried the following shell command on my laptop while staying connected with my tab via usb cable and it showed me an error.i am attaching the screenshot here.it keeps on saying "Device Unauthorized".how can i resolve this?
Your device is unauthorized. This means that you either have USB debugging off, or the adb server has messed up.
If you have the USB debugging on, try to revoke the USB debugging and restart the adb server, as suggested in
https://stackoverflow.com/a/25546300/3970830
After connecting the device, you have to accept the connection in the dialog on the device screen.
The error message is giving you the solution. Check your device for a confirmation dialog. It should be asking you to authorize the computer to connect, or something to that effect.

Eclipse testing my applications on a phone,via usb connection ,on OS X (Yosemite)

So, what I want to do ,is to be able to run my applications from eclipse, directly on my phone.So when I run them, the .apk gets installed and the app runs on my phone, just like it would in a virtual device.
Although, the phone won't show up in my list of "Running Android devices".
I have tried this: http://developer.android.com/tools/device.html -did not work for me ,or perhaps it worked partially but I hit a little bump at the end.When I run the adb devices command, I get this:
List of devices attached
323052d0eae6c0ed unauthorized
Any ideas how to solve this would be highly appreciated!
NOTE: I am trying to do this on a macbook which runs OS X Yosemite.
It's likely that the device is no longer authorized on ADB for whatever reason.
1. Check if authorized:
<ANDROID_SDK_HOME>\platform-tools>adb devices
List of devices attached
4df798d76f98cf6d unauthorized
2. Revoke USB Debugging on phone
If the device is shown as unauthorized, go to the developer options on the phone and click "Revoke USB debugging authorization" (tested with JellyBean & Samsung GalaxyIII).
3. Restart ADB Server:
Then restarted adb server
adb kill-server
adb start-server
4. Reconnect the device
The device will ask if you are agree to connect the computer id.
You need to confirm it.
5. Now Check the device
It is now authorized!
adb devices
<ANDROID_SDK_HOME>\platform-tools>adb devices
List of devices attached
4df798d76f98cf6d device
After doing this Need to install the Samsung Kies to show up the phone in the list of "Running Android devices".

Android Host Mode USB debugging

I am developing an application where my android phone connects to a USB accessory. However, when the accessory is connected is there any easy way to debug the application?
Can we use a micro usb hub or similar device?
When debugging applications that use USB accessory or host features, you most likely will have USB hardware connected to your Android-powered device. This will prevent you from having an adb connection to the Android-powered device via USB. You can still access adb over a network connection. To enable adb over a network connection:
Connect the Android-powered device via USB to your computer.
From your SDK platform-tools/ directory, enter adb tcpip 5555 at the command prompt.
Enter adb connect <device-ip-address>:5555 You should now be connected to the Android- powered device and can issue the usual adb commands like adb logcat.
To set your device to listen on USB, enter adb usb.
source: Android developer site
You could write an app that reads the logcat output on the phone and displays it on the screen and/or saves it to a file which you can pull with adb afterwards.
The app must be given READ_LOGS permission, which you can do with adb shell pm grant com.package.appname android.permission.READ_LOGS (at least on a rooted phone).
Another alternative might be to log over WiFi. adb has an option to connect over TCP/IP, but this is not something I've tried so I don't know how difficult it is to set up or how well it works.
Unless your logs are really verbose it's sometimes enough to run through your USB accessory use-case and then unplug the accessory and connect the phone to your computer to catch the logcat output. The logs are buffered up to a certain amount, so you can get a reasonable amount of logs using this method.
You could run an Android image in Virtualbox. This would allow you to connect your USB device to the virtual device, and debug over the bridged network connection.
I haven't figured out how to convert the SDK .img OS images to VDIs for use in Virtualbox, but there are plenty of canned VDIs out there.

Categories

Resources