37

I am looking for a way to debug a device remotely over the Internet.

I am getting a lot of bug reports from my users which I can't even reproduce. It would be easy to solve them if I could debug the device over the Internet as if it were connected to my PC. Is this possible?

I heard about debugging over wifi in local network, maybe there is similar way to achieve it over the Internet?

Lukas Knuth
  • 25,449
  • 15
  • 83
  • 111
glodos
  • 1,203
  • 3
  • 13
  • 21

5 Answers5

6

It is possible to setup Android device for debugging over Internet, however it requires USB connection to enable it or root access on the device. In addition to that you will have to setup port forwarding to device to accept incoming ADB connections from the the Internet. It hardly can help unless users of your app are developers with great desire to cooperate.

You can find detailed instructions here: http://www.cleansoft.lv/debugging-android-applications-remotely/

samfromlv
  • 1,001
  • 1
  • 10
  • 17
  • 1
    Couldn't you do it without port forwarding, by logging in remotely to the user's desktop, and then using adb *on that desktop* to connect to the Android device by USB cable? – LarsH Sep 03 '15 at 17:26
3

You can use Crashlytics in your app.. It helps you to get the detailed crash logs. Whenever an app crashes, it will send you the detailed crash report, from which you can figure out what is happening at the client side. Get more info about adding crashlytics to the app from here.

Send this new app to the client so can have workaround:

Pezhvak
  • 9,633
  • 7
  • 29
  • 39
Ichigo Kurosaki
  • 3,765
  • 8
  • 41
  • 56
  • how can the developer test the solution if he-she cannot reproduce it in the local machine? – Diego May 26 '21 at 01:11
3

Steps to Follow:

  1. First In Android Settings Application go to About Device option.
    1. Click 9 times on Build Number option, so that you can unlock Developer Options setting.
    2. Now In you Setting's Application, you will have Developer Options enabled, go and click on it.
    3. set following options on : Stay Awake, USB Debugging and if you have Internet Adb option in menu set that also enabled if not then dont worry continue the steps.
    4. Now open your Android Studio and the application you want to run on the android device.
    5. In Android Studio, at bottom click on Terminal tab, Terminal window opens.
    6. Now through your terminal go to the directory where your Android SDK is stored
    7. In SDK directory go to platform-tools directory.
    8. Now if you list the files in the platform-tools you will see adb there.
    9. Running following Commands.

as an example.

adb connect <ip-address-of-your-device>:5555

as an example:

adb connect 10.10.0.21:5555

The terminal should show something like below

adb server is out of date. killing...
*daemon started successfully*
connected to 10.10.0.21:5555

Now run shell command

adb shell

you will get the prompt something like this, i my case i used android x86 device for debugging.

shell@x86_64:/$

Now if you go to the task bar in the android studio and click on Run options and then Run'app' you will be able to see the device as your Deployment Target.

Hope it helps !

Shahbaz Ali
  • 1,262
  • 1
  • 12
  • 13
2

You can also use adb via tcp ip:

adb connect ip:port
  • Use a remote access (teamviewer or droid apk) to enable debugging in android developer tools.
  • In the router where the android is connected remember to create port forwards to the android ip.

In your machine with adb installed do:

adb connect public_ip:port

After being connected, you can do:

adb logcat

or

adb shell

Or any adb command you want to.

Curious Mind
  • 659
  • 10
  • 26
-1

try Debugging Firefox for Android over Wifi it's working with me

https://developer.mozilla.org/en-US/docs/Tools/Remote_Debugging/Debugging_Firefox_for_Android_over_Wifi

  • 2
    A link to a solution is welcome, but please ensure your answer is useful without it: [add context around the link](http://meta.stackexchange.com/a/8259) so your fellow users will have some idea what it is and why it’s there, then quote the most relevant part of the page you're linking to in case the target page is unavailable. [Answers that are little more than a link may be deleted](http://stackoverflow.com/help/deleted-answers). – mrun Jun 14 '17 at 10:27