[Q] Pushing files via adb from one android device to another - Android Q&A, Help & Troubleshooting

As long as I have the requisite SDK files and a terminal on an Android device, or if I'm doing this programmatically in an app I'd develop, can I use adb to push a file from one device to another that's connected via USB? The devices will be a Nexus 4 and probably a Nexus 7. The N7 would be the sender, fwiw. I'm hoping that it's not required that the device executing the adb push commands be a computer as opposed to a mobile device.
I'm assuming that I can find a cable that's micro USB (if that's what it's called) at both ends to connect the two devices.
Is it possible to do the same thing via a Bluetooth connection? Or can adb only recognize a device connected via USB?

maigre said:
As long as I have the requisite SDK files and a terminal on an Android device, or if I'm doing this programmatically in an app I'd develop, can I use adb to push a file from one device to another that's connected via USB? The devices will be a Nexus 4 and probably a Nexus 7. The N7 would be the sender, fwiw. I'm hoping that it's not required that the device executing the adb push commands be a computer as opposed to a mobile device.
I'm assuming that I can find a cable that's micro USB (if that's what it's called) at both ends to connect the two devices.
Is it possible to do the same thing via a Bluetooth connection? Or can adb only recognize a device connected via USB?
Click to expand...
Click to collapse
If you tried this you would need a usb otg cable for connecting the devices. But I don't think ADB client software exists on phones just computers. Why would you want his when Android has multiple better choices? Turn on NFC and tap the device backs together for example.

shadowofdarkness said:
If you tried this you would need a usb otg cable for connecting the devices. But I don't think ADB client software exists on phones just computers. Why would you want his when Android has multiple better choices? Turn on NFC and tap the device backs together for example.
Click to expand...
Click to collapse
I have adb on my Nexus devices. I didn't even put it there, though BusyBox might have. It's in /system/bin. I can execute commands from a terminal. But I haven't tried it with another device. I'll get an OTG cable.
I'd use NFC or make one of the devices a ftp server, but that doesn't meet the needs of the project I’m working on. This isn't for personal use or convenience. I need to have one device send another a file within a certain physical environment that precludes those things.

maigre said:
I have adb on my Nexus devices. I didn't even put it there, though BusyBox might have. It's in /system/bin. I can execute commands from a terminal. But I haven't tried it with another device. I'll get an OTG cable.
I'd use NFC or make one of the devices a ftp server, but that doesn't meet the needs of the project I’m working on. This isn't for personal use or convenience. I need to have one device send another a file within a certain physical environment that precludes those things.
Click to expand...
Click to collapse
Hello Maigre,
Have you finished your experiment with the OTG cable ? I would try to do the same kind of operation.
And if I add and USB cable to the USB-OTG cable, do you know if it's working ? (I found only a micro-USB male to USB female OTG cable, and I would use it with a USB male to micro-USB male cable).
Thank you in advance,
Greg

Related

[how to] usb otg

This will enable you to use USB on the go (OTG) feature that comes with Android 3.1 on our Jetstream. However, I for one don't think its truly on the go because you do need an external power source for it to work. But it allows me to connect my hard disk and work with it without the intervention of a computer which is more than great for me. But would surely like it if you could directly plug in a pen drive (not yet possible I think as far as I could search).
I have note made any of these, have just researched, tried a lot and managed to get it to work on my Jetstream and am just compiling the steps and methods I followed here.
Thanks to sztupy for his thread http://forum.xda-developers.com/showthread.php?t=1450298 for giving the basic idea.
Thanks to hellcat82 for his software NTFS Mount found at http://forum.xda-developers.com/showpost.php?p=13337600
Pre-requisites:
1. Must be rooted with Superuser and Busybox loaded
2. NTFS Mount software (use version 1.2 as 1.3 has some issues with Busybox as per the above mentioned thread and personal experience) - alternate is USB Mount by the same developer available on the Play store at https://play.google.com/store/apps/details?id=au.dach.drivemount (however I have not had success with it)
Hardware Requirements:
1. USB OTG Cable. Can be found at http://www.ebay.com/itm/Micro-USB-H...370670?pt=PDA_Accessories&hash=item3a731ccdae
Just a sample, costs around $ 2. I got mine from a local hardware store for Rs. 300 ($6)
2. USB Y cable. Can be found at http://www.ebay.com/itm/USB-2-0-Min...552?pt=LH_DefaultDomain_0&hash=item1e624b8dd0
Just a sample, costs around $ 2. I had one lying around at home.
3. USB Charger. Can be found at http://www.ebay.com/itm/Black-Plug-...er_MP3_Player_Accessories&hash=item1c254df23a
Just a sample, cousts again around $ 2. I got mine from a local hardware store for Rs. 170 ($3)
4. USB Hub (OPTIONAL) - this will enable you to connect more than 1 device at a time. If plan on using this, then you can get one with an external power source and skip the USB Charger.
Procedure:
1. 1st, after obtaining root, confirm that USB Host more is enabled on the Jetstream by checking the build.prop under /system using Root Explorer found towards the end of the screen. It should read as:
# support USB Host
rp.usb_host = 1
If not, then you must enable it by allowing R/W mode.
2. Next step would be to set up the hardware in the right manner. Note this must be done before connecting anything to the tablet.
The USB Y cable comes with 2 male USB ports and a single female USB port. The USB device to be connected must be attached to female port. The USB power charger must be attached to the side Male port and the USB OTG (micro USB to USB female) goes to the main Male port. With this all necessary connections are made. Refer to the attached picture (thanks to sztupy again) for details on other ways of connecting and using including with USB Hub (I personally have not tried the hub).
3. Put on the power source that is connected to the entire system and in case the external hard disk also uses one, that needs to be put on as well.
4. Lastly, connect the Micro USB cable with all the above connected to it to the tablet.
5. In order for the device to read/write or access the USB storage, next step depends on if the device is FAT32/NTFS
a) for FAT32 - you can go to the settings, storage and scroll down to USB storage. You will be able to see the details of the connected hardware and can click on Mount to mount and use. Unmount later to disconnet.
b) for NTFS - you must open NTFS Mount software. From the drop down list of devices, select a device (mine always shows sda1) and click on mount. Unmount from here itself later when done.
By following this, you would be able to access your USB external storage (pen drive/hard disk) with ease from your tablet directly.
Note: in order to access the files, you must use Root Explorer/Astro File Manager.
FAT32 device appear under USB folder of sdcard (i.e inbuilt memory)
NTFS devices appear under /mnt/sda1
Attachments:
1. usbhost_2.jpg - a diagram with the detailed setup (thanks to sztupy)
2. NTFSMount1_2.apk - NTFS Mount (thanks to hellcat82)
Hope this helps.
Is it truly necessary to have the OTG usb cable? I currently have a powered hub. Shouldn't I be able to use the provided JetStream usb cable and tie the devices together through the hub?
Sent from my HTC PG09410 using xda premium
aka.karasawa said:
Is it truly necessary to have the OTG usb cable? I currently have a powered hub. Shouldn't I be able to use the provided JetStream usb cable and tie the devices together through the hub?
Sent from my HTC PG09410 using xda premium
Click to expand...
Click to collapse
Hi, sorry for delay, was out for an exam.
I don't know if or not it will work. As I said I have just researched and seen what others have implemented and put it together.
Perhaps you could try and let us all know because I don't have a USB Hub (powered or otherwise) and hence have not tried it out.
This all seems a little much for OTG support considering it was just plug and play with my SGS2 and also my SGS4G. I am hoping to see some more development in this area as this type of support is nice to have on a tablet of this caliber.
aka.karasawa said:
Is it truly necessary to have the OTG usb cable? I currently have a powered hub. Shouldn't I be able to use the provided JetStream usb cable and tie the devices together through the hub?
Sent from my HTC PG09410 using xda premium
Click to expand...
Click to collapse
Tried this... it didn't work

[Q] Single usb cable - adb & multiple devices

Hi,
Does anyone know if any cable is available where you can plug multiple devices into one end of the cable, the other into the computer, and when you install an application from say, Eclipse, it installs it to all the connected devices in one go?
I have about 4 devices running various versions of Android I use for testing, and when I have them all set up together, it gets tedious manually pushing the code from Eclipse to all the devices.
I would think you'd be able to use ADB over wifi. However, since I'm not a developer, take my advice with a grain of salt.
Hi,
this is physically impossible as this would blow your USB port on the PC. If every device tries to draw 500mAh and the port only gives 500mAh there would either be no connection or the USB port would just melt
ADB over WiFi sounds reasonable though...
TheSSJ said:
Hi,
this is physically impossible as this would blow your USB port on the PC. If every device tries to draw 500mAh and the port only gives 500mAh there would either be no connection or the USB port would just melt
ADB over WiFi sounds reasonable though...
Click to expand...
Click to collapse
I tried adb over Wifi but it's been a bit strange for me, occasionally my USB connection isn't recognized later, or the adb connection randomly drops.
It still has the same problem as I need to manually initiate a push from Eclipse to every phone.
Please use the Q&A Forum for questions &
Read the Forum Rules Ref Posting
Moving to Q&A
Eclipse ALWAYS will ask you for the device to install a project (if there are various).
I don't know eclipse since I don't dev but I know a little about ADB and I doubt it has any built in way to install to multiple devices. But you could make a script to make it easy from the command line with multiple cables. Something like this but set the proper serial numbers.
Run it like this "multiinstall.sh some.apk"
#!/bin/bash
adb -s aa1231 install $1
adb -s 324eo4 install $1
adb -s 238642 install $1
adb -s 366284 install $1

View/Control Android device from PC (without ROOT)

Hi all. What I need is a way to control Android device (s) from PC via Wi-Fi. I found a lot of apps (and Desktop programs) to do it, but I didn't found a way to View OR control the Android device WITHOUT ROOT. I work on the company which asked me to find a way to do this without root with their Android devices. After googling a lot I started to think that where is no way to do this, because either way I need to root them . Is it true or maybe there is somewhere an app which could do this? It doesn't care if it's paid or not.
I have downloaded and tester these apps:
MyMobiler - Doesn't work because when I restart Android device, app doesn't start WiFi, just keyboard mode only. I need that when the app starts it should run itself and start WiFi automatically.
VMLite VNC Server - Don't know why but it didn't worked for me. Just cannot start server from the browser.
Thank you for any responses and appreciate any help.
What error messages do you get from vmlite vnc server? Make sure you enable USB debugging. We have tens of thousands of users using our app, and your device should work.
Well, actually now I tried to launch VMLite VNC one more time and IT WORKED (don't know how, because earlier I tried it and I was unable to enter to VNC Viewer in the Browser). So yeah, in this case it works perfectly now, but I just realized, that I have no way of connected more Android devices. Because what I need to do is to connect multiple Android devices to computer with USB (as I understand it's required for the first time) and when use it with WiFi. For now I see that I only capable of connecting single Android device with desktop program and everytime I want to connect to Android deice from computer, I need to connect it via USB (where is no way to save Android devices to use it any time I want to via WiFi). Or am I wrong? And it is a problem because in my company all Android devices are far away from each other. Anyway, thank your for such an awesome app, I really don't know how it is capable of connecting to my Android device WITHOUT ROOT (because I found like 10 apps, read a lot of forums, and every solution was with ROOTED devices, I am very interseting of the actual app functionality), but thank you.
You can connect to multiple devices using multiple USB cables. There is a drop down list to display devices, and you choose one by one to start the server. Alternatively, you can write some scripts to auto start the vnc servers.
There are quite some testing companies using our app this way to automate regression tests.
Alternatively, you can write some scripts to auto start the vnc servers.
Click to expand...
Click to collapse
Can I get more information about it? Thank you.
Basically you can automate the starting process using adb command:
adb shell "am start -a android.intent.action.MAIN -n com.vmlite.vncserver/.MainActivity"
adb shell /data/data/com.vmlite.vncserver/files/vmlitevncserver
Deimantas007 said:
Can I get more information about it? Thank you.
Click to expand...
Click to collapse
Thank you for this script (it's very cool, I didn't know this kind of stuff before), but it requires USB connection as well.
I googled a few things and found this app - ADB Wireless (no-root) on Google Play Store. Basically it connects ADB via WiFi and I don't need no USB cable and connection with it. But VMLite Android App Controller program on my Desktop doesn't recognize it (it requires USB connection). Can I actually connect Android device with PC with this method or I am missing something and there is no way of doing it with this method? Thank you (I promise, this is the last question from me, no more dumb questions).
I don't think it will work for you. You mentioned your android device will reboot, right?
If your device gets rebooted, you will have to use a USB connection to a PC. the ADB wireless app has same requirement.
Steps to get it working: (from ADB Wireless app page)
1. Enable USB Debugging on your phone.
2. Connect your phone via usb cable to your PC.
3. Run adb tcpip 5555.
4. Run ADB Wireless (no root).
5. Connect to the IP address.
Deimantas007 said:
Thank you for this script (it's very cool, I didn't know this kind of stuff before), but it requires USB connection as well.
I googled a few things and found this app - ADB Wireless (no-root) on Google Play Store. Basically it connects ADB via WiFi and I don't need no USB cable and connection with it. But VMLite Android App Controller program on my Desktop doesn't recognize it (it requires USB connection). Can I actually connect Android device with PC with this method or I am missing something and there is no way of doing it with this method? Thank you (I promise, this is the last question from me, no more dumb questions).
Click to expand...
Click to collapse
huisinro said:
I don't think it will work for you. You mentioned your android device will reboot, right?
If your device gets rebooted, you will have to use a USB connection to a PC. the ADB wireless app has same requirement.
Steps to get it working: (from ADB Wireless app page)
1. Enable USB Debugging on your phone.
2. Connect your phone via usb cable to your PC.
3. Run adb tcpip 5555.
4. Run ADB Wireless (no root).
5. Connect to the IP address.
Click to expand...
Click to collapse
What's right. It needs to connect my phone via USB. But I thought that maybe there is a way to automate this process, I mean maybe there is a solution to TURN DEBUGGING MODE between phone and pc programs via WiFi connection (not USB) and communicate with VMLite VNC Server program on startup. Either way, again, thank you for your software (app). I will say to my boss that we need to stay where we are at the moment. It's just awesome to have an app which doesn't require ROOT.

LG USB Drivers

I have second hand LG-LS970 running 4.1.2 and am looking to root it. Before I do I wanted to use a USB program like LGFlashTool to copy the stock roms off and give me a way to back out if I soft brick it. I cannot seem to get the drivers to show up in device manager. What am I doing wrong?
astromaphilli14 said:
I have second hand LG-LS970 running 4.1.2 and am looking to root it. Before I do I wanted to use a USB program like LGFlashTool to copy the stock roms off and give me a way to back out if I soft brick it. I cannot seem to get the drivers to show up in device manager. What am I doing wrong?
Click to expand...
Click to collapse
First off have you installed the official drivers from LG's website?
shimp208 said:
First off have you installed the official drivers from LG's website?
Click to expand...
Click to collapse
yes, and I hoped that it was going to show as a device under ports in device manager?! Is it just a standard TypeB USB cable?
astromaphilli14 said:
yes, and I hoped that it was going to show as a device under ports in device manager?! Is it just a standard TypeB USB cable?
Click to expand...
Click to collapse
Sorry for the delay I was out of town the last couple of days. It should indeed be just a standard Type B USB cable, are you using the cable that came with your phone? Also make sure it's a Type B USB cable that is capable of both Power and Data transfer. Some cables are just capable of power transfer and not data transfer since they don't have the d+ and d- wires inside them.
shimp208 said:
Sorry for the delay I was out of town the last couple of days. It should indeed be just a standard Type B USB cable, are you using the cable that came with your phone? Also make sure it's a Type B USB cable that is capable of both Power and Data transfer. Some cables are just capable of power transfer and not data transfer since they don't have the d+ and d- wires inside them.
Click to expand...
Click to collapse
I have another one, not the original one and it works as data transfer and power to PC for other 'droid phones. Should it show up as a device in device manager?
astromaphilli14 said:
I have another one, not the original one and it works as data transfer and power to PC for other 'droid phones. Should it show up as a device in device manager?
Click to expand...
Click to collapse
It should show up in device manager if that is cable that you are using. Does the device show up in Windows Explorer as an attached storage device? Also make sure in settings on your phone you have USB Debugging enabled, I have had issues in the past with drivers being installed and devices not showing up. What happens is once USB Debugging is enabled the device will pop up in Windows Explorer and say it's installing the drivers. Just let it install the drivers it thinks it needs and it should work. Let me know if this helps ! If your still having problems still happy to help :good:.

RCA Viking II, RCT6603W47 - Factory Blocked ADB Usage

The RCA Viking II, RCT6603W47M7, came to me crippled by default. I can't connect the device via USB.
I found an interesting item in the device's 'build.prop' -
"# USB Charge only function
ro.sys.usb.charging.only=yes".
Of course, I couldn't edit it because the device isn't rooted. It also has android 6.0, which makes it very difficult to root with a root app.
I tried everything I could possibly think of to no avail. I then installed "wifi file transfer pro" (Google Play), designed to allow file transfers between android and pc via a web browser. It works fine, but of course it can't manipulate read only files.
I then tried adb via wifi. Here's what happened:
1. Without the app
>adb connect 192.168.1.39:5555
>adb connect cannot connect to <ip>: A connection attempt failed because the
connected party did not properly respond after a period of time, or established
connection failed because connected host has failed to respond. (10060)
2. With the app
First command/result:
>adb connect 192.168.1.39:1234
>connected to 192.168.1.39:1234
Second command/result:
>adb shell
>error: no devices/emulators found
Conclusion: ADB works partially, but it's still crippled. Catch 22: PC still needs usb
connection, even if temporarily. Just as an aside: Is RCA violating anything here?
How can I use my USB port except for charging?
Any Results?
ftokc said:
The RCA Viking II, RCT6603W47M7, came to me crippled by default. I can't connect the device via USB.
I found an interesting item in the device's 'build.prop' -
"# USB Charge only function
ro.sys.usb.charging.only=yes".
Of course, I couldn't edit it because the device isn't rooted. It also has android 6.0, which makes it very difficult to root with a root app.
I tried everything I could possibly think of to no avail. I then installed "wifi file transfer pro" (Google Play), designed to allow file transfers between android and pc via a web browser. It works fine, but of course it can't manipulate read only files.
I then tried adb via wifi. Here's what happened:
1. Without the app
>adb connect 192.168.1.39:5555
>adb connect cannot connect to <ip>: A connection attempt failed because the
connected party did not properly respond after a period of time, or established
connection failed because connected host has failed to respond. (10060)
2. With the app
First command/result:
>adb connect 192.168.1.39:1234
>connected to 192.168.1.39:1234
Second command/result:
>adb shell
>error: no devices/emulators found
Conclusion: ADB works partially, but it's still crippled. Catch 22: PC still needs usb
connection, even if temporarily. Just as an aside: Is RCA violating anything here?
How can I use my USB port except for charging?
Click to expand...
Click to collapse
I just grabbed one of these on sale...
Did you ever find a way around the ADB Bug?
No! ; ) I gave up for a while.
RaiderWill said:
I just grabbed one of these on sale...
Did you ever find a way around the ADB Bug?
Click to expand...
Click to collapse
ftokc said:
No! ; ) I gave up for a while.
Click to expand...
Click to collapse
Do either of you two have a firmware backup I can use to try to get mine working? Bought it used from online retailer and it's running demo firmware. It says there is a settings lock.
RaiderWill said:
I just grabbed one of these on sale...
Did you ever find a way around the ADB Bug?
Click to expand...
Click to collapse
I'm pretty sure you have to use USB male to USB male cord.
I got my RCT6603W47 because it has a GPS, and every year or so search for any reports of modding success. Is anyone aware of another brand (badge) of the same hardware? cnet has the specs - just search "RCT6603W47 specs"

Categories

Resources