Android TV ADT-1 adb connect port changed? - android

Hi as of yesterday I was able to build and push apk files to the ADT-1 Android TV device via WiFi. Then the device had an update and now I'm no longer able to connect to the device. I think the port number adb is allowed to connect on has changed... but to what?
Yes I've made sure the IP address is valid and am using the port number 4321. Pinging the device works. But its giving me the error:
unable to connect to 10.0.0.86:4321:4321
I've tried to connect via ethernet and WiFi. Both fail.

I directly hooked it up to a laptop and manually forced it to use port 4321 again via: "adb tcpip 4321"
Now I can connect with my main dev computer from across the room again.

Grumpf. Look like they removed the necessary "service.adb.tcp.port=4321" from build.prop in 5.0.2.
Why, oh why?

Related

Android WiFi ADB plugin not working. Giving error

I installed the Android WiFi ADB plugin to run the app wirelessly. But it's not working it's giving error that Phone and PC should be connected on the same network. I use my phone hotspot to run the internet on my PC. Then I use another phone but then also same error. Someone says it will not work because you use the mobile hotspot for an internet connection on your PC. But when I try to connect another phone then also the same issue. But the same way my friend also does. he also uses the internet using a mobile hotspot but it's working fine on his phone. I have a POCO F1 Phone.
I'm answering this hoping this may help others as well as I find it helpful for my use.
First, Turn on ADB in your phone's developer options. You can search Your_phone_model developer options to find that.
Second, After turning on ADB, Connect your phone with data cable to your laptop/desktop.
Open a Command prompt window, Type adb tcpip 5555, Press allow in adb prompt shown in your phone, it will show restarting adb in tcpip mode. Now, disconnect the USB cable. You can use different port number to connect another device.
Type adb connect your_phone_ip:5555 as for example adb connect 192.168.43.1:5555 in case of hotspot. You can check Phone's IP in WIFI's advanced setting of your phone or in status section.
Now, Everytime your device restarts, repeat steps 3-4.
You can also make a script, just type adb connect your_phone_ip:5555 in a notepad file, save it as name.bat file, right click on it and send to desktop (create shortcut), in the settings on the shortcut, set any shortcut keys. Now, anytime you want to connect, just press the shortcut keys. That's how I do it. You can further open Android studio by this script so it will open Android Studio as well.
Remember, whenever it says Device is Offline, restarts your phone's wifi and reconnect it.

Android Studio - how to use my wifi in order to connect to internet

I searched on how to get an Internet connection from my emulator in Android Studio and it was suggested I start up the emulator from the command line as follows: emulator -avd Pixel_3a_XL_API_29 -dns-server 8.8.8.8. This indeed has provided an Internet connection when I do from the command line, after adb shell, then run-as com.example.myapplication, then ping abcnews.go.com. this returns packets from the server "...r.cloudfront.net". Looking up this server, it appears to be for Amazon AWS, and is "free", up to some data limit I haven't looked up yet. This is OK short-term, but I would prefer to use my home wifi rather than go thru a different server. What's the best way to have my Android Studio emulator be able to connect to the Internet via my home wifi? (do I need a plugin?) TIA, Steve
First of all, emulator below API 25 doesn't support wifi.
Second, you can't connect the emulator directly to your WiFi.
The WiFi in the emulator provides a virtual hotspot to which the emulator automatically connects.
So, best practice would be that you connect your PC to your home WiFi and then run the emulator on your PC.

ADB - Using adb CONNECT command

I'm trying to make a tool that connects to your android phone wirelessly with the connect command.
I know the command and how to set up the ports, the problem is that you have to enter your ip manually. If i want it to be a tool, it should automatically connect to the right ip for the user's phone.
I've tried using localhost to connect
adb connect localhost:5555
But that does not work. If this is possible, please write a comment!
I'm sorry if i didnt explain it properly. English is not my main language.
You're not entering the command correctly. You should be connecting to the device's ip. adb connect [deviceIP]:5555.

get ip address of bluetooth tethering device on android

I have a specific problem:
I have a Android 1.6 device that uses bluetooth to connect to a smartphone (android) and use tethering to access internet...
Bluetooth itself cannot be used for anything else except that connection.
It also doesn't have a wifi.
Now, I'm trying to make an app for that device that will connect to a "server" app on the smartphone!
What is the easiest way of doing this? I have a simular app running but I have to manualy type the IP of the "server" (if smartphone is on wifi).
Can I somehow programatically get the IP of the tethering smartphone or something if it using bluetooth tethering?
Thanks!
You could run a terminal emulator on your smartphone and try running the following commands:
getprop net.dns1
ip addr show
ip route show
netcfg
Perhaps you can run those commands from within your app? Otherwise, you would have to read through the Android API manual, which can be found here.
UPDATE: as of Android Nougat 7.x, ifconfig is present, and netcfg is gone.
This question, also seems to be related and may be of use.

How to use adb over Mobile AP (Portable wifi hotspot)

First : I know about abdWireless app. But my problem is different.
I am using my Android mobile as Mobile AP (Portable WiFi hotspot) for using internet on my computer. I want to use adb in wireless mode but the problem is - when i enable Mobile AP on my android mobile WiFi gets turned off and i am unable to use abdWireless app.
I want to use both wireless ADB and Mobile AP at the same time.
Is there any way to do it ???
Developers have created apps for this:
https://play.google.com/store/apps/details?id=com.ttxapps.wifiadb
Once you start this app, you can connect to your phone like this:
adb connect ip_address_of_the_device
However, your phone must be rooted!
Please let me know if this helps!
On mac:
You need to run: ifconfig
Followed by run: arp -a
In my case, the first listed IP is router IP, ie. IP of your android device with hotspot(let it be: ip_address_of_the_hotspot_device).
Then run either: adb connect ip_address_of_the_hotspot_device or adb connect ip_address_of_the_hotspot_device:5555

Categories

Resources