Connection refused: ADB connection from Iphone to windows - android

I am trying to build a watch face for Android wear. The Android wear is an emulator and the device that I have is an iPhone connected via USB to my windows laptop
I have followed the instructions from the below link
https://developer.android.com/studio/command-line/adb.html ,
verified device compatibility as per
https://www.android.com/wear/check/
and have also followed responses as per the answers # adb connection over tcp not working now, however I am receiving the following error
unable to connect to :5555: cannot connect :5555: No conn
ection could be made because the target machine actively refused it. (10061)

Actively refused it means that the host sent a reset instead of an ack when you tried to connect. It is therefore not a problem in your code. Either there is a firewall blocking the connection or the process that is hosting the service is not listening on that port. You may also want to check these SO posts: Trouble debugging android wear over bluetooth - Unable to connect to localhost and No connection could be made because the target machine actively refused it? which also stated that the machine exists but that it has no services listening on the specified port, or there is a firewall stopping you. You may check it out.

Thanks. I was able to figure out with some research that getting to have iPhone with a wearable emulator may not be possible and decided to have both my device and wearable as emulators. Though it was difficult, I was able to get both my emulators talk to each other with the below link Pairing Android and Wear emulators and https://kennethmascarenhas.wordpress.com/2014/08/19/developing-for-android-wear-with-emulators/?utm_source=Android%20Weekly&utm_campaign=a97f04efe2-Android_Weekly_116&utm_medium=email&utm_term=0_4eb677ad19-a97f04efe2-337259209 with a minor change to authentication, which I have included as comment in the stackoverflow post

Related

Debug Android application remotely over same vpn

I've developed an Android application which worked fine on my side but failed (not crash) on client side.
I do the research but still can't figure how to do.
From this post Debugging android device over the Internet
I know it can achieved by using abd, but it required both pc connect on the same network, which are not suitable for my case where my client are connect on difference network.
This post suggest another solution which is port forward, but warmed not recommended as this was pretty dangerous.
The following post suggest method of adb -a -P 5037 nodaemon server but I'm not really understand does it work for my situation as i getting error of could not install *smartsocket* listener: cannot bind to 0.0.0.0:5037: Only one usage of each socket address (protocol/network address/port) is normally permitted. (10048)
My question is how do remotely debug (get the logcat) of client application under difference network but was able to connect on the same VPN. Thanks.
Even i had faced the similar problem and this blog talks on same thing and there is some solution already out there which can be used for working on remote android devices, it looks paid one though.

check android auto app log messages while connected to car

I have a question on checking logs/debugging of android auto app when the mobile device is connected to the main Head Unit (car).
During apk installation on the Mobile device from the development machine
using Android Studio, the logs can to checked using adb (Android Debug Bridge).
Since it is a development machine, the calls does not go into functions like onCarConnectionCallbacks.
So tried using DHU (Desktop Head Unit), but DHU is connected using adb forward socket connection, How to check for app log messages simultaneously?
And also how to check log messages or debug the app, when it is connected to the main Head Unit (Car), Should the adb be installed? (Here the mobile is not on development mode).
I am not able to find convincing answers online.
Please give your view on this.
Thanks
Having the port forwarded for the DHU connection won’t affect the ADB streaming the logcat in another terminal. You can checkout the ADB documentation on how to Connect to a device over Wi-Fi, and use a laptop to connect with since the usb connection will be used on the phone to connect to the car or DHU.
For the onConnectionCallbacks, those are still functional even when connecting to the DHU. Sounds like it might be a coding issue with registering the connection callback.

ADB Debug over remote desktop

Essentially I have 2 computers. One a client, on a network that I can't edit, and a 'server' that is running Android Studio, and whose network I can request adjustments made too. I would like to be able to compile an app from android studio to a device connected to the client. The client and server are not on the same network. Is there a way to do this? I've tried a few solutions but none of them work.
Edit: I'm not adverse to changing the remote software if need be
If you can get both the computer with Android Studio and the device on the same wifi network you can use wireless adb.
Described here:
https://developer.android.com/studio/command-line/adb.html#wireless

Connection refused error in Android

I was running my application fine.There were some changes in the network,like my router and internet connection got changed.Suddenly in the LogCat,I see an error like connection refused.I have provided the static IP still I get the same error.
I am running my server on my laptop and the app on the device. Intially I was able to access the application through the app and also through the browser.Can you guide me and does my Android device needs a new setting that I am missing?
Definitely, you faced some networking problem. So, the diagnostic is the same as for any connected device.
check local Android firewall - try to connect to some another server, like facebook.com or google.com
check your laptop firewall settings
draw your network schematic carefully and think what should be working and how
try tcpdump\wireshark to see what's actually going on the wire
Hope you win!
Well the static IP works not sure why it was not working before may be because I was using a LAN connection only for laptop not a same WIFI connection both for laptop and android device.

no dns via ipsec tunnel android 4.4.2 xperiaz C6603 racoon

I've setup a racoon server on my linux router. It was working ok with my xperiaz (C6603) road warrior. However after I applied the latest update to android 4.4.2 (firmware 10.5.A.0.230) it stopped working correctly. I have ping from the phone to each ip (local ip or internet) but when I use FQDN it can't be resolved. I can ping the phone from within my local network too. VPN is IPSec Xauth RSA. Checking with adb DNS server is correctly set:
getprop net.dns1
192.168.6.1
I also tried pushing the same ip as dns2 but no change. I also noticed that after closing the connection to the vpn server net.dns1 remains 192.168.6.1 however the phone is able to correctly resolve addresses. In few minutes it gets changed back to my 3g provider setting.
I tried to redirect all traffic through the tunnel via the advanced vpn setting (Forwarding routes = 0.0.0.0/0) and tried to set DNS statically via the same settings (DNS servers = 192.168.6.1). Even setting the DNS server to my provider's DNS addres didn't work which makes me think the problem is with the android itself.
DNS server is working as far as I can tell:
$ dig #192.168.6.1 dir.bg +short
194.145.63.12
Forwarding is enabled on my router so shouldn't be the problem. I've read about a bug in android but it's in android 2.x and seems to impact wifi connections.
Have you seen similar problems and as I'm not an expert with android and adb, can you tell me what commands are available in adb/shell to trace the problem? Phone is not rooted and it's not possible for the moment to root it.
UPDATE:
the tunnel is working ok when I connect via wifi hotspot. The problem appears to show only via my 3g carrier. Any ideas how to work around this?
After updating to 4.4.4 I still got the same problem. Further testing revealed that the problem is more likely to be in the Android rather than my 3g carrier. Over wifi the VPN worked flawlessly after using wifi tethering from another phone via the same provider it worked ok again so my 3g carrier isn't blocking anything.
Yesterday I finally rooted my phone and installed SDFix to restore full access to my SD card. Now VPN is working ok again even via 3g. I hope someone can confirm/reject that solution as I see no relation between vpn and sd card at all. However I experienced initially the problem with my update to 4.4.2 where Sony started to follow Google's policy about storage access.

Categories

Resources