Does anyone know how to make a device adb another device.
i.e
Device1 I create a folder apks and copy and paste 5 apk files.
then I use micro usb to micro usb to connect to another device.
then from device1 i adb all these 5 apk files to device2
using something like this a guess ?
adb install 1.apk & adb install 2apk & adb install 3.apk & adb install 4.apk & adb install 5.apk
I know this is possible as I know someone who does it. But their won't reveal how it is done. Thank you
AFAIK, connecting two android devices via USB is meaningless.
You can use adb over tcpip (over WiFi) in order to accomplish this.
Here is what you need to do:
Make sure both devices are on the same network. This can be done by connecting them to the same AP, by peering them together using WiFi direct or
by setting one of the devices as a hotspot and connecting the second to it.
Configure device 2 adbd to work over tcpip (this is done from your desktop shell):
adb tcpip <port number>
From device 1 shell run:
adb connect <device 2 ip>:<port number>
adb install 1.apk
adb install 2.apk2
and so forth...
Related
I want to access my phone data from the computer and for this I have to allow the computer to do it from the phone.
The problem is that the phone's screen doesn't work, so is there any way to allow the computer to access the phone's data from my computer?
Oh, and if it matters, I'm using ubuntu and android....
You can use adb if the phone has USB debugging turned on. adb is a program that allows you to access a connected android device. just use adb shell to get an interactive shell on the device, or adb shell command to run a command. To push files to the device use adb push, and to pull them from the device use adb pull
ADB is installed in the computer, and usb debugging is enabled on devices. Also I have connected one device over wifi successfully. How to connect more devices without having to mention the serial number of the device for every additional device with the -s flag like: adb -s <serial> tcpip <port>
Yes there is a way to do so without having to type the serial number.
Say you have 2 devices A (IP: 192.168.1.32) and B (IP: 192.168.1.33) that you want to connect to ADB over wifi:
Connect device A with a USB cable to the computer (but not B)
adb -d tcpip 5555
adb connect 192.168.1.32
Disconnect device A, and connect device B with a USB cable to the computer
adb -d tcpip 5555
adb connect 192.168.1.33
A slight change in the Abdul Wasae answer, based on my experience .
devices A (IP: 192.168.1.32)
devices B (IP: 192.168.1.33)
Connect device A with a USB cable to the computer (but not B)
adb -d tcpip 5555
adb connect 192.168.1.32
Disconnect device A, and connect device B with a USB cable to the
computer,This time you need to change the port !!
adb -d tcpip 5554
Here you need to specify port as well
adb connect 192.168.1.33:5554
I also have documented this here in more detail
Connecting multiple devices over wifi using adb
I have this problem long time ago so I decided to create this simple bash script.
Assuming that you already added the adb to the path:
export PATH=${PATH}:/home/YOUR-USERNAME/path/to/adb
You just need to follow this steps:
Run this commands: to create your script (typically, you want $HOME/bin for storing your own scripts)
cd ~
mkdir bin
cd bin
touch adb_connect
Open and copy the script using any editor like gedit.
gedit adb_connect
And make your file executable.
sudo chmod +x adb_connect
Modify your path to add the directory where your script is located:
export PATH=$PATH:$HOME/bin
Finally, now connect your device using USB and run the script:
adb_connect
Your device must be connect now, disconnect the USB cable and repeat steps 5 and 6 to add more devices. If a successful connection occurs, it will have this output:
Connecting to LGV498bdcb2c5
restarting in TCP mode port: 7105
connected to 192.168.20.105:7105
I need remote ADB shell..
I know that we have to issue "ADB tcpip ".. to change ADB server to TCP listening mode.
But, the problem is that my phone is not rooted, and I do not have USB cable.
I can't issue tcpip command since I do not have USB cable,,
I can't change default.prop file as the phone is not rooted.
Is there any other ways to change ADB server to TCP listening mode???
I found an articel that says you can execute setprop persist.adb.tcp.port 5555 to make tcpip mode autostart after reboot.
The problem is, you must run this command as root.
On my device unfortunally the command su doeas not exist.
Here is the orginal Permanent network debugging on android
EDIT: I discovered, that the su command is only available when your device is rooted.
So the solution only works when you have a rooted phone
The simple answer is: no, you can't.
As you said, you can't access the prop file and don't have a cable to change with ADB. The only way is you find the port via an Android terminal emulator (a.k.a Termux)
For anyone looking for a better answer:
YES, YOU CAN!!
When you try to execute "adb tcpip 5555" without an USB cable, it returns:
"error: no devices/emulators found"
Emulators?? After googling I found the way and made a batch file that connects my device directly through WIFI, no cables needed at all:
set /p ip= Device IP:
:CONNECT
if "%CD%"=="C:\" goto ROOT
cd ..
goto CONNECT
:ROOT
cd ...Android\Sdk\emulator
echo.
echo Starting emulator...
start /MIN emulator -avd Nexus_5X_API_29_x86 -no-window
(you can check other avaliable devices with "emulator -list-avds")
cd ..
cd platform-tools
adb wait-for-device
echo.
echo Emulator started.
echo Connecting with device...
adb tcpip 5555
adb connect %ip%
echo.
echo Closing emulator...
(you need it just to be able to execute "adb tcpip 5555")
adb -s emulator-5554 emu kill
(you can check the name with "adb devices")
To enable wireless debug need to configure the ADB command. (in mac os)
Step1:- First of all need to enable adb command. (check SDK tool and install command-line tools)
Step2:- connect the device with a USB cable after that run the below command.
command: adb devices
the above command will show a list of connected mobiles.
Step3:- after that, we need to configure TCPIP protocol:
e.g : adb tcpip 5556
Step4:- Run command to connect the device.
command: adb connect your_ip:port_address
eg:- adb connect 192.168.1.152:5556
If you are using the stock android os system, then you can enable remote debugging in Settting -> developer options.
I have a few devices enabled for over the air debugging. Is it possible to list the adb devices on the network? Something similar or to the same effect as adb devices but for devices that are enabled for over the air debugging.
If you do these steps exactly and run the adb devices command, the android device should appear under the List of Attached Devices. First open a command window and make sure you are either in the same directory as adb or have adb in your PATH variable. Then execute the following list of commands:
$adb usb
restarting in USB mode
$ adb devices
List of devices attached
######## device
$ adb tcpip 5555
restarting in TCP mode port: 5555
Get the IP address of your android device. (Usually under System settings then Network settings, you can look up how to get the IP address on your specific device). The IP address should look something like 12.34.56.78 (this could vary though). Once you have the IP address continue with the following commands:
$ adb connect 12.34.56.78
connected to 12.34.56.78:5555
Remove the USB cable from the device
$ adb devices
List of devices attached
12.34.56.78:5555 device
Source
That's not possible with the Android SDK, as it would involve a huge network scan without any clue, just blind-pinging port 5555 of every possible address on the network.
But probably you can do it with a network scanner that looks for port 5555 open.
I'm basically trying to do this:
How can I connect to Android with ADB over TCP?
with the Droid X2.
I have USB Debugging on, and my phone is plugged in via USB.
The IP Address is 10.0.78.33 (I have verified that I can do TCP communication to the phone on that IP, and I can ping it).
I go to the command line and do the following:
>>adb tcpip 5555
restarting in TCP mode port: 5555
>>adb connect 10.0.78.33:5555
unable to connect to 10.0.78.33:5555
Any thoughts on why this doesn't work? Do I need root access in order to do this? I'm trying to avoid rooting the phone.
Thanks!
Step 1 . Go to Androidsdk\platform-tools on PC/Laptop
Step 2 :
Connect your device via USB and run:
adb kill-server
then run
adb tcpip 5555
you will see below message...
daemon not running. starting it now on port 5037 *
daemon started successfully * restarting in TCP mode port: 5555
Step3:
Now open new CMD window,
Go to Androidsdk\platform-tools
Now run
adb connect xx.xx.xx.xx:5555 (xx.xx.xx.xx is device IP)
Step4: Disconnect your device from USB and it will work as if connected from your Android studio.
Symptoms
With my phone, this problem happens a lot. I get these symptoms:
ping x.x.x.x times out
adb connect x.x.x.x times out ("unable to connect")
telnet x.x.x.x 5555 times out
Workaround
I need to disable and re-enable WiFi on my phone before running adb connect on my computer. Then I can both ping, telnet, and adb connect to the phone.
I'm using a Sony Xperia M C1904 running CyanogenMod 12.1.
Your device hasn't to be rooted. I've developed a plugin for IntelliJ/Android Studio to connect your device over wifi pressing just one button. Here is the code and here the plugin ready to be used.
The usage is quite simple. Here you have a gif:
In my case i need pair device with code.
in phone "For developers" -> "Wifi debug" -> "Connect with code"
adb pair x.x.x.x:xxxxx password
adb connect x.x.x.x:xxxxx
Root IS needed to change that system properties. However, it is not needed to start adb over wifi.
You can forward the ports while connected through USB and then tell the adb daemon to listen over a certain frequency:
ADB over wirless
I've encoutered the same problem, and my device was rooted. The problem actually came from adbd Insecure.
If you installed adbd Insecure on your device, it will prevent you from connecting to your device via WiFi. You have to uncheck the "Enable insecure adbd" in the app adbd Insecure.
See FIXED: Can't connect to adb over wifi
The problem with me for my Samsung Tab 1 was an adb process was already running on port 5037 on my Xubuntu 14.04 machine, which I was unaware about until I typed pgrep -l -u username. To fix this, I terminated the adb process using pkill adb, navigated to my platform tools folder and ran adb tcpip 5037 and then connected to my device using the 5037 port number. Boom! Worked like a charm.
Android wifi ADB was earlier working on my IDE but after Updating Android Studio (my current is Android Studio 3.3) it is not working and always prompt as "Unable to connect to device......Same network"
After spending much time i was unbale to resolve the issue.
Then i tried - WIFI ADB ULTIMATE by
https://github.com/huazhouwang/WIFIADB/tree/master/WIFIADBIntelliJPlugin
It worked for me.
I know it's an old thread and OP is asking in very common scenario but I would like to mention what happened with me.
I was able to connect to ADB over wifi through below steps:
connect android phone to computer via USB (critical initial step)
open terminal in android studio & navigate to where the adb is installed
execute command adb tcpip 5555. this will restart the adb in TCP mode port: 5555
execute command adb connect <ip address>
for first time you might need to give access to adb from phone when asked
after connection establishes, you can disconnect the usb cable and you're good to go.
This worked all the time when I'm on my home wifi.
Twist:
I got the error saying failed to connect to '172.16.224.20:5555': Connection refused, when i tried to connect from Starbucks cafe wifi (or any other public wifi).
After some research I realized that
many public wifi has some configuration restrictions which doesn't
allow adb over wifi
.
I couldn't connect adb to my Nexus5 Phone over 5Ghz WLAN but it did work with the slower 2,4 Ghz instantly.
After you run setprop service.adb.tcp.port 5555 and restart adb you won't see the device if you run adb devices on the host.
Instead, you have to run adb connect 10.0.78.33:5555
I hope this will helpful and worked for me
Disconnect phone from studio.
Go to developer options in phone.
Under USB debugging, there is an option to Revoke USB debugging authorisations.
Then click ok.
Then again connect phone to studio via USB.
Then click on connect button in ADB Wifi.
Now you can run and debug apps without USB