adb tcpip auto - Android Q&A, Help & Troubleshooting

hello everone ,
i need assistance,
i was having my old laptop setup with adb TCPIP listener (meaning: once any device on my Wi-Fi network usb debugging switch on will recieve the adb prompt to allow or reject)
now i have lost my ssd and all data gone with that setup, its it was really long time ago i have done it.
now i have to use ( adb connect IP :5555) for each device instead.
all i need is to make my laptop always listening to any usb debugging switched on to target it.
i have search everywhere for that app but with no luck.
all my commands fail.
adb shell ip -f inet addr show wlan0
adb shell "ip addr show wlan0 | grep -e 'inet[^6]'"
etc .

waw ! no one have idea ?

Related

Help rooting mt slide 2.2.1

I really hope someone can help me. I don't know what else to do.
My rooted slide was stolen last week. Just got a new one but of course it with 2.2.1 and I am trying to root it. I made the gold card, installed Adb, and followed all the directions find here to root the phone but below is what I am getting.
I really need to get this phone rooted.
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\Ladyr>cd c:\
c:\>cd c:\android\android-sdk\android-sdk-windows\platform-tools
c:\Android\android-sdk\android-sdk-windows\platform-tools>adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
HT069PS08148 device
c:\Android\android-sdk\android-sdk-windows\platform-tools>adb push flash_image/d
ata/local
Android Debug Bridge version 1.0.26
-d - directs command to the only connected USB devic
e
returns an error if more than one USB device is
present.
-e - directs command to the only running emulator.
returns an error if more than one emulator is r
unning.
-s <serial number> - directs command to the USB device or emulator w
ith
the given serial number. Overrides ANDROID_SERI
AL
environment variable.
-p <product name or path> - simple product name like 'sooner', or
a relative/absolute path to a product
out directory like 'out/target/product/sooner'.
If -p is not specified, the ANDROID_PRODUCT_OUT
environment variable is used, which must
be an absolute path.
devices - list all connected devices
connect <host>[:<port>] - connect to a device via TCP/IP
Port 5555 is used by default if no port number
is specified.
disconnect [<host>[:<port>]] - disconnect from a TCP/IP device.
Port 5555 is used by default if no port number
is specified.
Using this ocmmand with no additional arguments
will disconnect from all connected TCP/IP devic
es.
device commands:
adb push <local> <remote> - copy file/dir to device
adb pull <remote> [<local>] - copy file/dir from device
adb sync [ <directory> ] - copy host->device only if changed
(-l means list but don't copy)
(see 'adb help all')
adb shell - run remote shell interactively
adb shell <command> - run remote shell command
adb emu <command> - run emulator console command
adb logcat [ <filter-spec> ] - View device log
adb forward <local> <remote> - forward socket connections
forward specs are one of:
tcp:<port>
localabstract:<unix domain socket name>
localreserved:<unix domain socket name>
localfilesystem:<unix domain socket name>
dev:<character device name>
jdwp:<process pid> (remote only)
adb jdwp - list PIDs of processes hosting a JDWP transport
adb install [-l] [-r] [-s] <file> - push this package file to the device and i
nstall it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data
)
('-s' means install on SD card instead of inter
nal storage)
adb uninstall [-k] <package> - remove this app package from the device
('-k' means keep the data and cache directories
)
adb bugreport - return all information from the device
that should be included in a bug report.
adb help - show this help message
adb version - show version num
DATAOPTS:
(no option) - don't touch the data partition
-w - wipe the data partition
-d - flash the data partition
scripting:
adb wait-for-device - block until device is online
adb start-server - ensure that there is a server running
adb kill-server - kill the server if it is running
adb get-state - prints: offline | bootloader | device
adb get-serialno - prints: <serial-number>
adb status-window - continuously print device status for a specifie
d device
adb remount - remounts the /system partition on the device re
ad-write
adb reboot [bootloader|recovery] - reboots the device, optionally into the boo
tloader or recovery program
adb reboot-bootloader - reboots the device into the bootloader
adb root - restarts the adbd daemon with root permissions
adb usb - restarts the adbd daemon listening on USB
adb tcpip <port> - restarts the adbd daemon listening on TCP on th
e specified port
networking:
adb ppp <tty> [parameters] - Run PPP over USB.
Note: you should not automatically start a PPP connection.
<tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
[parameters] - Eg. defaultroute debug dump local notty usepeerdns
adb sync notes: adb sync [ <directory> ]
<localdir> can be interpreted in several ways:
- If <directory> is not specified, both /system and /data partitions will be u
pdated.
- If it is "system" or "data", only the corresponding partition
is updated.
environmental variables:
ADB_TRACE - Print debug information. A comma separated list
of the following values
1 or all, adb, sockets, packets, rwx, usb, sync
, sysdeps, transport, jdwp
ANDROID_SERIAL - The serial number to connect to. -s takes prior
ity over this if given.
ANDROID_LOG_TAGS - When used with the logcat option, only these de
bug tags are printed.
c:\Android\android-sdk\android-sdk-windows\platform-tools>
I don't think you are using the correct windows path for you file you are trying to push. Try using the file paths in your adb commands.
do it this way works in 5 min no gold card needed http://forum.xda-developers.com/showthread.php?t=1108316 .WORKS everytime just did it again 3 hours ago.....
just thank me if it works
Thank you, I am not rooted thanks to you. had one small problem but was easy to remdy.
kitila said:
do it this way works in 5 min no gold card needed http://forum.xda-developers.com/showthread.php?t=1108316 .WORKS everytime just did it again 3 hours ago.....
just thank me if it works
Click to expand...
Click to collapse
Hey sry.I already had to update.zip on my sd root so I didn't know...but ty for telling me....but yea it still rooted ur phone u just didn't have the cwm..so um yea I did help u root you phone just didn't help u get cwm.....so wooot for me lol
Didn't work for me.
kitila said:
do it this way works in 5 min no gold card needed http://forum.xda-developers.com/showthread.php?t=1108316 .WORKS everytime just did it again 3 hours ago.....
just thank me if it works
Click to expand...
Click to collapse
I tried the superoneclick and all I got was device not found or wating for device. I couldn't find a error fix for that so that is where I stopped. I have a new MT3GS 2.2.1. Nothing I have tried from last june in 2010 until today has worked. Even in a shell when I do adb it just comes up device not found and yes I have done all the changes to the phone with the charge only shutting down the wifi and debugging oh and screen on. I had to get a new phone since I did a OTA update and when I try to make a call my phone reboots all the time. T-Mobile sent me new phones but they all do the same thing and it is a HTC problem so I need to root and get rid of HTC
Did someone have the files for the goldcard method and can be gentle enough to send them to me Ill be really thanksfull, please I have done the oficial update and lost my root. Help me out please I know how to do everything just needs the files cause links are dead.
Pm me or send to my email please
[email protected]
Sent from my T-Mobile myTouch 3G Slide using XDA Premium App

native adb

Does anyone know how to connect your phone, to its own native adb. If your running 4.0 or better like the new 4.0.1 sense on evo 4g lte you have the native adb, in the terminal you can start it by typing adb start-server, but I cannot connect the phone to it.
This is nice to use to connect to other phones and use it as a debug station, but does anyone know how to connect to the phones adb server from the terminal on its own phone. When I start the server it says its listening on 5083 I have tried adb forward tcp:5555 tcp:55, tried adb tcpip 5555, but none of the forwarding ports seems to work. I have started adb on the phone and adb over wifi but still do not see the ip in adb.
Some help on this would be nice, I will keep thinking, but any help would be nice.
Some ideas might be to start a wifi server using the phones wifi tether, or hotspot to connect to itself
ip addr add 192.168.1.10/24 dev eth0
ip addr add 192.168.1.10/24 dev wlan0
maybe we can manually add and connect the devices threw wifi hotspot or tether with this. someone want to take this on and get back to me
Screen shot..
https://www.dropbox.com/sc/69v6co2l4nrd8qg/0PQqlpzI1M
I got the sdk runing natively following this..... http://fieldefect.info/w/NativeCompileAPK
he uses qemu-user-static and an i386 chroot to run the SDK, done natively on arm debian chroot.
I prefer to use multistrap over debootstrap, also I modify his run-i386 scripts to work with x86_64 chroot.
I connect adb to adbd like so,
setprop service.adb.tcp.port 5555
stop adbd
start adbd
adb connect 127.0.0.1
then try
adb shell
or
adb devices
to confirm.
My screenshot has some output from netstat which may answer your questions about ips/ports. you can see localhost
is listening on both 5038 and 5037. port 5037 belongs to adbd. adb will connect to 127.0.0.1:5037 but only gives errors.
PM me if you have questions ill gladly help.
Yea I have a chrooted ubuntu 10.04 img that I have mounted, I was going to do it that way install the sdk and use the localhost. but I was hoping to keep the chroot out of it. At least it works that way very nice. Only reason I didnt want to use a chroot is its gonna be alot of switching between terminals, was hoping for easy way to use 1 terminal. I suppose i can use 2 windows on the one terminal.
Thanks for the post.
as root
Code:
[email protected]:/ adb kill-server
[email protected]:/ adb start-server
[email protected]:/ adb connect 192.168.1.3
unable to connect to 192.168.1.3:5555
[email protected]:/ adb connect 192.168.1.3:5083
unable to connect to 192.168.1.3:5083
[email protected]:/ adb connect 127.0.0.1
unable to connect to 127.0.0.1:5555
[COLOR="Red"][email protected]:/ adb connect 127.0.0.1:5038
connected to 127.0.0.1:5038[/COLOR]
[email protected]:/ adb devices
list of attached devices
234234234234 offline
I got the adb to start and connect, but the phone still says offline. This is all native not with any chroot or anything else. any ideas?
try port 5037
email me about the other thing [email protected]
I connected using the second post like this
terminal #:
#adb kill-server
#stop adbd
#setprop service.adb.tcp.port 5555
#setprop service.adb.tcp.port 5083
#adb connect 127.0.0.1:5083
#adb devices:
127.0.0.1:5083 device

Android Pranks via ADB

Prank Android phone users with ADB:
Connect to phone wirelessly:
Connect phone via USB
adb tcpip 5555
adb connect <Your phone IP>:5555
Disconnect USB
(To get IP address type adb shell ip -f inet addr show wlan0)
(To return to using USB for adb, type adb usb)
Record Screen:
adb shell screenrecord /sdcard/demo.mp4
(to record)
adb pull /sdcard/demo.mp4
(to copy the file)
Send Text:
adb shell input text "This%Sis%Stext"
(%S is a space)
Send Keypress:
adb shell input keyevent <keycode>
(This can be used to quit to the launcher, send random keys, etc.)
(Keycodes listed here: https:<double slash>elementalx<dot>org<slash>button-mapper<slash>android-key-codes<slash>)

How to turn on and off the WiFi through ADB (no root)?

I found I can use these ADB commands to turn on and of the WiFi of a rooted phone:
Code:
adb shell su -c 'svc wifi enable'
adb shell su -c 'svc wifi disable'
However, I'm interested in doing it without having to root the phone for an automatic testing I'm doing. Do you guys know if this is possible?
I found this project which allows me to connect to a WiFi through ADB commands not being a root user. I was wondering if anyone knows how to disconnect also from ADB and not being a root user.
UPDATE:
I've been recently trying:
Code:
C:\adb>adb shell am start -a android.intent.action.MAIN -n com.android.settings/.wifi.WifiSettings
adb server is out of date. killing...
* daemon started successfully *
Starting: Intent { act=android.intent.action.MAIN cmp=com.android.settings/.wifi.WifiSettings }
Warning: Activity not started, its current task has been brought to the front
and
Code:
C:\adb>adb -s serial_number shell am start -a android.intent.action.MAIN -n com.android.settings/.wifi.WifiSettings
Starting: Intent { act=android.intent.action.MAIN cmp=com.android.settings/.wifi.WifiSettings }
Warning: Activity not started, its current task has been brought to the front
I also found doing this type of command:
Code:
adb shell input keyevent 20 & adb shell input keyevent 23
I can navigate and click. The problem seems to be that I always finish in a different state so the next time I input the command
Code:
adb -s serial_number shell am start -a android.intent.action.MAIN -n com.android.settings/.wifi.WifiSettings
I start in a different place and start clicking elsewhere. I've tried returning home, but that doesn't fix the issue. Is there any way to start always from the same point inside the WiFi settings?
Thanks!
natiya said:
I found I can use these ADB commands to turn on and of the WiFi of a rooted phone:
Code:
adb shell su -c 'svc wifi enable'
adb shell su -c 'svc wifi disable'
However, I'm interested in doing it without having to root the phone for an automatic testing I'm doing. Do you guys know if this is possible?
Click to expand...
Click to collapse
Turn WiFi off
Code:
adb shell settings put global airplane_mode_on 1
adb shell settings put global wifi_on 0
adb shell settings put global wifi_scan_always_enabled 0
Afterwards you've to re-boot the device.
Turn WiFi on
Code:
adb shell settings put global airplane_mode 0
adb shell settings put global wifi_on 1
adb shell settings put global wifi_scan_always_enabled 1
jwoegerbauer said:
Turn WiFi off
Code:
adb shell settings put global airplane_mode_on 1
adb shell settings put global wifi_on 0
adb shell settings put global wifi_scan_always_enabled 0
Afterwards you've to re-boot the device.
Turn WiFi on
Code:
adb shell settings put global airplane_mode 0
adb shell settings put global wifi_on 1
adb shell settings put global wifi_scan_always_enabled 1
Click to expand...
Click to collapse
Thank you, but those don't produce any change on my device. Actually, if I put the first two commands without doing "adb kill-server" in between, I get this message:
error: more than one device/emulator
Click to expand...
Click to collapse
But the output when they work is:
adb server is out of date. killing...
* daemon started successfully *
Click to expand...
Click to collapse
and nothing happens.
I've been recently trying:
Code:
C:\adb>adb shell am start -a android.intent.action.MAIN -n com.android.settings/.wifi.WifiSettings
adb server is out of date. killing...
* daemon started successfully *
Starting: Intent { act=android.intent.action.MAIN cmp=com.android.settings/.wifi.WifiSettings }
Warning: Activity not started, its current task has been brought to the front
and
Code:
C:\adb>adb -s serial_number shell am start -a android.intent.action.MAIN -n com.android.settings/.wifi.WifiSettings
Starting: Intent { act=android.intent.action.MAIN cmp=com.android.settings/.wifi.WifiSettings }
Warning: Activity not started, its current task has been brought to the front
This opens the screen where you can turn on and off the WiFi but it doesn't do it...not sure if I'm missing something!
Just to be shure, make shure your using the latest version of ADB offered by google here:
https://developer.android.com/studio/releases/platform-tools
You could use adb wifi
After activating when using usb it and connecting through the same wifi:
svc wifi enable
works without root
I'm a little late to this thread, but if it still helps the OP, non-rooted Android 10 and below allowed wireless adb connections AFTER a USB connection was first established (adb start-server && adb tcpip 5555 && adb connect [IP]:5555), but that changed (for the better) in Android 11 and above with the new new Developer options Wireless debugging random port assignments (adb connect [IP]:[PORT] or adb pair [IP]:[PORT] [PIN]) such that the adb wireless connection never needs USB cable ever again.
Given Android 11 allows Developer options Wireless debugging via a random port, and Android 12 new Developer options Wireless debugging allows that to be accessed even easier with a new Developer options Wireless debugging tile, the only thing missing is a way to turn the non-rooted Android Wi-Fi on or off via adb (which was the OP's original question after all).
Maybe this will work if we can figure out how to tap the buttons?
adb shell "am start -a android.settings.WIFI_SETTINGS"
Click to expand...
Click to collapse
For swiping on the phone from adb this works...
C:\> adb shell input swipe 500 1000 500 100
This will instantly swipe from center to the top of the screen.
You can add a time period, e.g., take 3 seconds to swipe that.
C:\> adb shell input swipe 500 1000 500 100 3000
Click to expand...
Click to collapse
But you want to tap the buttons, right?
If we can figure out the positions, maybe this would work?
C:\> adb shell am start -n com.google.android.gms/.ads.settings.AdsSettingsActivity
That should pop up an Android "Reset Advertising ID" settings page.
C:\> adb shell input tap 500 400
If run after the command above, that will tap the button to
asking to "Opt out of Ads Personalization" in that Activity
if that button is like mine, at the X=500 & Y=400 location.
On my phone, this is the "Reset advertising ID" button location:
adb shell input tap 500 200
On my phone, this is the "OK" button on that GUI above.
adb shell input tap 700 1000
C:\> adb shell am force-stop com.google.android.gms
If run after bringing up the advertising-id reset Activity,
it will close the activity without doing anything else.
Click to expand...
Click to collapse
Here is a somewhat related post...
[adb,scrcpy,vysor] What ports does Android 12 randomly set when Wi-Fi connecting via Wireless debugging adb "pair" or "connect" commands?
Type adb tcpip 5555 in the command line or Terminal and press Enter.
Find your phone's IP address in Settings > About Phone > Status > IP Address.
Back in the command line or Terminal, type adb connect [your Android's IP address].
Finally, press Enter again.
Regards,
J Wick

ssh into Termux over usb with offline smartphone

I have a Oneplus 8 with kali nethunter rooted with Termux installed.
I want to connect into the device using ssh over USB but something strange happen: ssh doesn't work if the device is offline, but if I connect the device to LAN once, the sshd service start to work.
So:
I plug the device with usb-c
open termux and set the password with `passwd`
install openssh
start sshd
Then:
Bash:
adb devices
# List of devices attached
# mserialnum00 device
adb forward tcp:8022 tcp:8022
ssh.exe -p 8022 localhost
This will work only if I connect the device at least once to the LAN.

Categories

Resources