ADB Debug over remote desktop - android

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

Related

What connection use emulator in android studio?

Android studio has its own settings for connection. There I can use proxy. So this way studio will use that proxy instead of computer wifi connection to sync libraries for example.
But for example if my application I send requests to the firebase what connection will be used by emulator? It will use studio proxy or it will use computer wifi for that? And if I use real device will it use mobile internet connection or proxy?
I have tested all scenarios. So the answers are the following.
Everything local depends on local WIFI of the laptop. Android studio has opportunity to set up its own proxy but also wount work without wifi. Android emulator has a wifi spot calls AndroidWifi in settings which indicates laptop wifi.
The real device use its own connection. So these are to separate different parts. If there is no connection on laptop but there is on real device. So you can't add library but you can launch based on HTTP requests app on real device.

How do I capture Android http traffic using charles or wireshark (which is on PC) under VPN connection?

I have googled a lot about setting up fiddlers for capturing android traffic. I have tried each of the suggested options. None of them work when there is an active VPN connection.
Setup: Charles or Wireshark is available on PC. Both PC and android device are on same network and on seperate VPN connections.
Tried approaches:
Configuring Wireshark/Charles – Created a new adhoc wireless network and making the android use the same. Another way was making the laptop as a virtual router or hotspot. None of these methods work when it comes to VPN.
Using TCP/IP monitor available in eclipse – This is a great tool built in eclipse, but needs hostname and port. For the internal website I do not know the port. Since it is standard http setup, I am assuming it should be either 80 or 8080.
Using different fiddlers available on Play store – All good fiddlers like tcpdump need the phone to be rooted and that’s not an option for me.
Tethering of PC network onto mobile - This again fails when it comes to VPN (damn you, VPN)
Anyone with any insight, most welcome !
Thanks!
Have you seen this approach? Have you configured proxy on you device connection?

Android - Is there is a way to remotely open and debug a given Android device?

My scenario is as follow:
I'm working with an app development which a bug occurs in the app when it is in a different country than mine, and only there. The bug is related with a fail in an image download through an URL access. Right now, I haven't figured out yet what it can be. Some subjects I've already looked up are:
Its not related to internationalization and/or culture, because the code does not implement this;
Its not related to firewall/security access, because if the user in the other country opens the image's URL, he can look at the image;
Without rooting the device, is there is a way to remotely open and debug a given Android device, just like a SSH or a VNC?
Similar questions are:
Debugging android app on a device remotely
Remote Debugging
Well,
you can debug a device using a TCP/IP connection (I sometimes debug using WIFI at home). all you need to do is make sure the remote device is connected to the internet and is accessible to your PC with a direct TCP/IP connection.
As the Android device is connected in another location - you'll have to make sure your router's firewall allows outgoing connection for communications in the port ADB is using , and that the target Android device receives communications in that port (if it's behind a router - the router should allow connections under the righ port and forward all comm in that port to the android device).
in other words - you have to "tunnel" your communication to the target device. there are other tunneling solutions/products but I've never used them and I prefer the "manual" way
Good luck,
Dan
EDIT : in Android 11 - adb can work on WIFI natively : https://developer.android.com/studio/run/device#wireless
Perhaps you can have the user install something like aLogcat and have them send you a log with the failure.
Well as remotely debugging a device I don't know but you can use ACRA (Application Crash Report for Android) .
All you need is to set up a google doc, add the lib to your project and when the app crashes it will send a crash report to that google doc. See quick setup here

How can I get my android emulator use my computer's VPN interface?

My company requires VPN to connect to our dev systems and for the first time I'm trying to work on an android app from home. Turns out the emulator doesn't want to use the VPN interface so even though I have connectivity to our dev systems on my VPN-connected laptop the emulator that's running on it does not.
I have thought of 3 solutions to this:
run a VPN client on the emulator, but I was hoping for a simpler solution than that
setting up a proxy server on my local machine
forwarding a port on my local machine
2 and 3 can probably work, but I'd still like to know if there is an easy way to get the emulator to use the VPN interface without a workaround.
I'm running OS X 10.7 and I've already tried adjusting the interface priority order with network>>set service order.
I suppose I can dust off the old dell and try it there, but I would expect the same results.
First start your vpn connection and then restart the emulator, now the emulator should use the host vpn connection.
it's mostly because of the DNS issue, according to the android doc:
At startup, the emulator reads the list of DNS servers that your system is currently using. It then stores the IP addresses of up to four servers on this list and sets up aliases to them on the emulated addresses 10.0.2.3, 10.0.2.4, 10.0.2.5 and 10.0.2.6 as needed.
I encountered this issue and tried something on dns settings but I could not solve it. As #machado said in the comment section below you should boot the emulator via "Cold Boot Now" option. I hope this helps.
What I do on my mac is just make sure 'send all traffic over vpn' is checked.
You'll find this setting after you click advanced while having your vpn connection selected in network preferences.
Works well for my situation, but may not depending on the type of VPN you're connecting to.
I had the same issue and solved it by connecting to cisco vpn after the android emulator has started and connected to the internet.
Works for me in windows 7
I setup a vpn connection on Windows. Then I started the emulator. The emulator and everything on my pc started to use that vpn connection.

Connecting to an Android emulator on another machine

I need to test my android app 24h a day and I have 3 ubuntu boxes to do it.
I would like to connect my development system (MOTODEV Studio 1.3) to a Remote Device.
The interface asks me for an IP address and port for the machine to connect to.
But it doesn't connect. I found that the adb sever on the remote machine doesn't seem to listen to external ports, only internal loopback, making machine-to-machine connections impossible.
Is this true? If so, why there is a section on Device to connect to Android Remote Device on MOTODEV Studio?
I've found an explanation and a workaround in this post (http://rxwen.blogspot.com/2009/11/adb-for-remote-connections.html) but it seems complicated and the post's links don't work, so I'm confused whether there is a solution to do that.
It seems so simple..... I can't believe there is not a way.
The Remote device feature of MOTODEV Studio is intended for TCP/IP connections to a remote phone. It requires a lot of manual intervention at this point to get things working and it's an area where we're definitely in need of better documentation.
I don't have the full workflow in front of me, but the steps you need go like this...
Connect phone to remote host.
Using adb shell on remote host, set the phone to connect over TCP/IP rather than USB. You'll need to find the IP address of the phone manually. If you're using a Motorola phone and the Motorola drivers, it's probably 192.168.16.x
Set up port forwarding from the remote host to the phone for the debug ports (probably 5554 or 5555).
From the local host, set up the address of the remote host in the IP field.
When choosing "Run as" or "Debug As" from the local host, you need to choose the remote device as your target.
We intend to make this workflow more automated in the future, but for now you have to do this manually. It's my observation that remote debugging of embedded systems is still slow and prone to problems with latency and line quality, regardless of whether we're talking about phones or reference boards.
Good luck.

Categories

Resources