ADB over wireless without USB - android

I know it.s possible to connect with adb to a non-rooted android device by connecting by USB and running the command:
adb tcpip 5555
adb connect {device ip}
But last week my phone got wet and it.s impossible to connect/charge via USB. I can charge it with a wireless charger (it.s a Nexus 4)
So i.m left with a device that works perfectly but it.s not rooted and you can.t connect the USB.
Is there any way I can connect adb via wireless so I can still develop with this phone?
Or is it possible to root my phone without USB? (I rrpeat, i.m using a Nexus 4).

You can use memory card. Install ClockworkMod first, copy ROM to memory card, push the card (sdcard) to device, flash it via ClockworkMod.

Related

Unpluging usb cable also disconnects wireless adb connection [duplicate]

I develop on my tablet using android studio.
The tablet is connected to the computer by wifi using
adb connect <ip_andress>:5555
My application contains listeners for USB devices attached/detached.
But unfourtunately, when I connect/disconnect usb device to/from the tablet, the adb connection is getting killed, and I can no longer see the device under "adb devices".
It is not a adb-connection-by-wifi what gets killed. It is just that USB enumerations affect the sys.usb.* system properties which on many devices is causing restart of adbd regardless whether it's being used over USB or tcpip.
Do grep "stop adbd" /init*rc to see what I mean.
You could either comment out those stop adbd lines or just disconnect the USB cable before running your adb connect command.
I was never able to connect my cellphone with my computar through wi-fi.
I had already given up. I followed all the instructions and tips, and nothing worked.
Finally, I did what no one said to do.
I've connected the phone to the WiFi network provided by the cable modem itself and not to some (not all) additional networks that are included in the router.
At home I use one of these networks, because I use a Deco Tp-Link router, which propagates the signal to my entire house, but this network is NOT compatible with ADB. It does not identify it as belonging to the same network.
After this, I use the normal procedure described here.
a) Connect cellphone with a USB cable
b) Find the IP_Phone depends on system in the cell phone. Here I use Settings, About Phone, Status and IP address.
c) Run the following adb commands in Command Prompt (Windows) or Terminal (Linux), where IP_Phone is the IP above mentioned. Normally adb.exe is an executable stored in computer path. adb is already included in Android Studio package.
adb tcpip 5555
adb connect IP_Phone
d) Now disconnect USB cable and it's ready. The cellphone model continues to appear in the status line in the top of Android Studio.
-/-
The best wifi is that defined in Cable Modem. It, unlike an any account defined in my router, answers to a ping command.
ping IP_Phone
Disconnect the usb cable just before running adb connect <*ip_address_of_your_phone*>

How to get adb logs via bluetooth?

How to get adb logs via bluetooth?
need to connect an android device to my laptop to get the adb logs, but through usb cable its not working.
Dude, you don't need Bluetooth to do so, you can get ADB logs via Wi-Fi.
The steps:
Connect your device to your laptop via USB (yes, you've read right, if your USB cable is not working, you can use an alternative USB cable temporarily or borrow one from your friends).
Type adb tcpip 5555 in the terminal
Type adb connect XXX.XXX.X.X (the X's represent the local IP address of your mobile device, if you don't know your device's IP, go to Settings > Wi-Fi > Advanced).
You can disconnect your device from your laptop and now you can debug your apps wirelessly.
If you really need Bluetooth to use ADB. Bad news! That's not even possible.

Any way to have adb remember devices once connected wirelessly?

The whole point of setting up wireless adb was so that I would not have to connect it to via usb everytime.
via this question : https://stackoverflow.com/a/3623727/4645236 I started wireless debugging with a device. Worked great! Super convenient without a doubt.
Now I am wondering if there is a way keep this setting and not have to plug in every time...
I'd like to wirelessly connect to the device via the PC terminal in one command,
even if the server has been killed and restarted.
Is this possible? Or do I have to use a script?
As long as the ADB daemon on your device is not restarted you can connect to your device via WiFi (ADB over tcp) without it connected through usb.
if it restarts, you will have to connect to the device via usb and run:
adb tcpip <port>
simply turn on your wireless adb on the device and connect however you do so wirelessly is all it takes. so example is (adb connect 192.168.1.xxx). thats it. Shouldn't have any memory issues.

Galaxy Nexus execute AT commands?

Would it be possible to send AT commands to the Galaxy Nexus using Hyperterminal or an other program?
If so, is there also a way to directly execute the commands on the phone?
I haven't send AT commands to the Galaxy Nexus, but it is possible with other mobile phones. They act like Plug and Pr/lay devices when you connect them to a Windows computer.
Plug the phone in, then check Windows Device Manager to see if there's a modem port for the phone.
If you can see the phone as a modem, then that's the port to which you can send AT commands via Hyperterminal.
I'm not aware of any phones that let you enter AT commands into the phone via its keypad (that's what you mean, isn't it?). The interface just isn't there.
If the phone shows up on the computer as a Windows Mobile Broadband device, you could also use Mobile Broadband API - documentation here. You would have to write some code for that.
It depends on the driver support whether this is possible or not.
It's possible on Linux (haven't tried on Win), but you'll need root on your GNex:
Connect rooted GNex to Linux PC with USB cable (debug mode and superuser access over adb must be enabled)
Go into adb shell and change to root with su command:
adb shell
su
as root execute the following:
echo MODEM > /sys/devices/tuna_otg/usb_sel
This would drop you out of the adb shell and you should now have 7 new pseudo-tty devices in /dev named ttyACM[0-6]. You should now be able to use /dev/ttyACM0 to send AT commands to you GNex.
Personally, I use atinout to send the AT commands.

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