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?
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/
Steps to Follow:
First In Android Settings Application go to About Device option.
Click 9 times on Build Number option, so that you can unlock Developer Options setting.
Now In you Setting's Application, you will have Developer Options enabled, go and click on it.
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.
Now open your Android Studio and the application you want to run on the android device.
In Android Studio, at bottom click on Terminal tab, Terminal window opens.
Now through your terminal go to the directory where your Android SDK is stored
In SDK directory go to platform-tools directory.
Now if you list the files in the platform-tools you will see adb there.
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 !
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:
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.
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
Related
I used Unity 2019.
When I connect my android devices (3 devices, tablet included) to Unity and try to run and build any apk, devices are recongized in Unity but the compilation process fails. lt's, writtren :Android device 52000... is not responding
I had this problem with my new phone, which was occurring even after enabling USB debugging and authorizing the PC through the phone. I ended up finding the answer in here Unity's documentation:
Run the adb devices command from the platform-tools directory of your
Android SDK installation and check the output.
If the output list is empty and you are using Windows, you may need to
install the driver for ADB devices. For more details, refer to the
Android SDK/NDK Setup documentation.
If the list contains entries with the unauthorized label, you may need
to authorize your computer on your device and give it permission to
debug it. Check the device’s screen for the corresponding dialog.
If the list contains your device with the device label, build your
Project in Unity again.
I resolve the problem.
In USB connection mode, on my phone, there are 4 options:
Transfer files
transfer images
Connect a MIDI device
Charge this phone.
I ONLY changed the connection mode to TRANSFER IMAGES.
After that, I received a prompt asking me the validate this connection mode. I did it and it works fine.
I resolved this issue, by changing the USB connection mode to Image Transfer(PTP) in my MI device
the problem is very clear. The compilation is successful, which means there is nothing wrong with your code. And the error message in the dialog box is clearly saying that
Make sure USB debugging has been enabled
So, to solve this simply follow the steps below -
Navigate to Settings > About Phone > Scroll to bottom > Tap Build number several times
Go back and now access the Developer options menu, check 'USB debugging' and click 'OK' on the prompt
You can also checkout this link
On android device, when prompted for "Allow USB debugging?", selecting "Always allow from this computer" checkbox solved the problem for me.
In order for my phone to show up the "Allow USB debugging?" dialog, I revoked the USB debugging authorisations from my android device and then ran "adb devices".
Also once I did this, unity was showing my device name instead of just device id.
Here's what worked for me.
Windows key type cmd
cd C:\Users\[name]\AppData\Local\Android\Sdk\platform-tools
adb kill-server
adb start-server
img
here is the image. I can't find my app's process, but others I can see. why did this happen? what should do? Thanks.
Some possible solutions:
On your notification bar, expand it and click the connection. Then select connect as Camera (PTP) (not as media device)
Try with another USB cable.
Go to your SDK manager and install Google USB Driver (I see you updated your answer regarding this)
Follow the instructions on OEM USD Drivers
if you get errors like below:
Unable to get view server version from device;
Unable to get view server protocol version from device
Unable to get the focused window from device
Unable to debug device
try to check these points below:
if signed app running on the phone, DDMS can't get the process info;
otherwise, can.
if use Virtual Device, then the DDMS&HierarchyView is useful;
reinstall app from IDE (if app process running stop it from IDE or force stop if through android setting)
if nothing happened try restart ADB
$ adb kill-server
$ adb start-server
I recently switched to connecting to the phone via WiFi. I am able to compile and upload programs through Eclipse. However, I do not receive any logcat ouput. The phone is also shown in the DDMS view and when my program is started it also displays the name and pid. Is it possible to get the logcat trace via wireless or do I have to switch back to using a USB connection?
UPDATE:
Maybe I did not make it clear enough in my initial post. There is no problem with the connection itself. I can dump the logcat by using a terminal with 'adb logcat -d'. What I want is to see the live logcat in Eclipse's logcat viewer. Not sure if it is of any importance, but I am using Eclipse 3.8 in Debian Jessie.
(1) connect phone with usb, then type in command line:
adb tcpip 5555
you can disconnect your phone from usb now
(if the reason for using wifi is that usb does not work on your machine, just do the above on another computer
(2) find out the IP address of your mobile device (somewhere under settings .... phone status)
(3) in command line type:
adb connect [IP of your mobile]
NOTE: all devices need to be connected to same wifi; avoid using public wifis
In your eclipse,
just go to: windows->preferences->Android->logcat and follow the following setup:
1. double-click action: "go to problem (error line)
2. switch to: java
3. both checkboxes are checked
if setup is fine, clean the project and restart eclipse
Restart Your ADB Server
1) open cmd
2) change directory to platform-tools
3)type adb kill-server
4)then adb start-server
I am not sure what exactly happened, but it is working now. I did not do anything that I had not tried earlier. It just started working after several attempts. Might be a faulty Eclipse installation, it did crash earlier today.
I known there is lots of answers about this question, but still my mobile device not connected to eclipse IDE.
The following is what I already did:
1. restart adb or type command in cmd "adb kill-server/adb restart-server", eclipse find nothing in the devices.
2. execute netstat -aon|findstr "5037", finding there is only one process "adb" occupy the port
3. check the phone driver in device management, finding the phone is install correctly.
4. execute "adb devices":
List of devices attach
1f06cbba device
I thought may it's my phone's problem, so i remove it, and create a virtual device avd, the eclipse still don't work.
My Operating System is Windows 7 and Eclipse IDE Kepler.
can any body help me to successful run my first android helloworld?
Thanks a lot!!
additional explanation
debug mode is in phone is ON
adb is in the variable %path%(maybe some should answered)
try the latest adt-bunble in adroid website, it still don't work.
Try turning "developer options" on in your device. (Option you haven't tried).
To access these settings, open the Developer options in the system Settings. On Android 4.2 and higher, the Developer options screen is hidden by default. To make it available, go to Settings > About phone and tap Build number seven times. Return to the previous screen to find Developer options.
Have you added adb in your class path variables? If not , you should append the class path with following paths :
path-to-sdk/android-sdk/platform-tools
path-to-sdk/android-sdk/tools
Try re-installing ADT Plugin. Worked for me last time.
Install your current mobile Adb USB driver and update Google USB driver
Check the MTP/PTP mode for your device:
http://lh3.ggpht.com/-8UMNs7Vg_dY/UVC6_6PnbDI/AAAAAAAAAIg/NjKOvAp9cDs/02-select-camera-ptp-mode_thumb%25255B1%25255D.png%3Fimgmax%3D800
In some devices you can find this under Settings->Storage->Menu Options(three vertical bullet squares).
When you say->the phone debug mode is open, i assume your developer options usb debugging is already enabled
There are lots of times Eclipse can't connect to emulator that I turned on from AVD Manager, and just starts a new emulator by itself,( two emulators are the same ):((. How can I make eclipse find the emulator ?
some times restarting adb solves your problem
adb kill-server
adb start-server
for working easier in command line in windows, add the path of adb.exe to that Windows' path. For example add ";C:\Program Files\Android\android-sdk\platform-tools" to System Properties-> Advanced-> Environment Variables-> System Variables-> Path
One of the reasons of problems in device connection is a long USB cable or a two-piece cables like keyboard USB. try to connect your device to PC directly by a short cable.
I guess that you might suffer from the issue that the manually started emulator got disconnected somehow, shown with a message like
Error: emulator-5554 disconnected
in the Eclipse console view. There are several related questions and answers on stackoverflow like Why do I get a emulator-5554 disconnected message,
but for me none of those answers helped.
Whenever I see the error message for disconnection occur, I just shutdown that emulator and start it again. Normally that already "fixes" the problem, it just works on the next attempt (for me).
I was just experiencing this issue also. I agree with breceivemail, the ADB reconnected to the emulated device after reset, but there is a shortcut using Eclipse:
In the DDMS view => Devices window => View Menu (the down triangle in the header) => reset adb
You can choose the target device manually by changing the run configurations.
Run -> Run configurations -> choose your App -> Target tab -> select "Always promt to pick device"
If your device isn't available you will at least don't start a new Emulator.
If the emulator is still active, you can use adb to connect to it via tcp. In this way you can connect a disconnected emulator to your development system's loopback one port higher, just like if you are using emulator-5554, you can connect to it by using a higher port.
adb connect localhost:5555
There was been an issue with this technique, where the emulator control becomes inactive, and the developer cannot send GPS coordinates or SMSs or calls to emulator.
There is a one click method to do this
Open notepad
Type the below code
#echo off
adb connect localhost:5555
Save the file as your_file_name.BAT
Copy the file to Android SDK/platform_tools
Create a shortcut, give it a custom icon, use it anywhere you like
Open the DDMS view from Eclipse, and simply click on the emulator name you want connect to in 'Emulator' tab.