what is the adb command to put device in offline mode - android

Is there an adb command to put the device offline?I tried following but doesn't seem to work
COMMAND:-
adb devices offline

You can put a device in "offline" state by using push(or install) and reconnect commands:
1.push a file(or install a apk) to phone
adb -s [serial] push somefile /data/local/tmp
2.reconnect while push is still in progress
adb -s [serial] reconnect
SERIAL means serial number listed in the output of 'adb devices' command.
Repeat step 1 and 2, after a while, you can find this device is in offline state from output of "adb devices".
You can put this device in "device" state by using kill-server and start-server.
"reconnect" command is only supported by higher version of adb, 1.0.36 and later as far as I know.

Related

Multiple devices issue in tcpip

I'm using termux in Android
I connect my using tcpip
I can't excute command reason show multiple devices connected
adb devices
List of devices attached
emulator-5554 device
adb allows multiple devices to be connected which will not allow to run the shell
you can try restarting the server using the following command and try again
adb kill-server
adb start-server
it worked for me some one already mentioned about the -s Serial number ( phone / emulator id )
adb -s SERIAL shell
so that will also be a good option to try
you can also try command line to connect with the target using
adb connect xxx.xxx.xxx.xxx:port
you may also try
adb disconnect
and retry
Good luck

ADB No Device Found Android

I found Kitkat version allow to record screen using adb commands, So i am trying to record video using adb shell command with below command.
Official Reference this
$ adb shell screenrecord/sdcard/video.mp4
i am using HTC Desire 620g , Driver is updated, USB debugging is checked, it's connected to windows system with MTP Mode.
also tried Revoke USB debugging authorisations.
but still cmd shows this strange behavior ..!
How to solve it..?
There is a space between screenrecord and the file path:
adb shell screenrecord /sdcard/recording.mp4
Then to download the file:
adb pull /sdcard/recording.mp4

Adb install apk failure

my problem is about android and the adb commands. I'm working on a Nexus 5 and i want to install and apk with adb commands. So i start with adb devices, my mobile is detected by the computer so i go to the repertory where the apk is located and i launch adb install name.apk
It returns :
* daemon not running. starting it now on port 5038 *
* daemon started successfully *
error: device not found
- waiting for device -
The Nexus 5 is rooted, and usb debug is activated
adb devices give me some sort of serial number of the mobile
If adb devices gives you a list of devices, then you could try to take serial number of your device and call adb -s <serialNumber> install name.apk. Here is more options you could try.
If you are using Ubuntu try restarting the adb server by giving sudo permission.cd > adb location and do sudo ./adb kill-server and sudo ./adb start-server.

ADB tcpip command without cable

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.

How do you connect your terminal with the Android emulator

I have tried the navigate to the android tool folder and entering the "adb shell" command but it doesn't seem to work. My terminal seems only to recognize the adb part of the command and gives me an error message. What am I doing wrong???
List all connected devices by typing adb devices
Check, if there are any devices listed. If not you may want to check that your device is connected and/or your emulator is running.
If it works and you have for example your emulator running and your usb-device connected use:
adb shell if you only have device connected.
adb -d shell to connect to an USB-Device.
adb -e shell to connect to an emulated device.
If you have more than one emulator or usb devices you might want to use:
adb -s <DEVICE> shell
Note:
Make sure that the path to the android-sdk is properly set-up in your environment. To quickcheck, fire up a shell and type adb version. If that command succeeds, you're set up. If not, add /path/to/android-sdk/tools and /path/to/android/platform-tools to your $PATH env variable. On windows the android sdk is typically located in C:\Users\<username>\AppData\Local\Android\sdk.

Categories

Resources