Debugging Android Apps without USB or root - android

I'm currently developing a small android app which communicates with a FTDI chip over USB so I can't use logcat to get the logs live. Unfortunatly the Android device is a Galaxy Tab 2 with Android 4.1.2 which I'm not allowed to root. That means adb-wireless won't work too. And because it's just a small app setting up a bugtracker system like ACRA seems a bit oversized.
Is there another way to get the logs of my app?
Many thanks

I can't think of any "live" logcat output, but you can view your Logcat Output (which is Buffered) via adb logcat. Test the things in your app you want to do or to get the Error you try to solve, then connect the USB to a Computer running adb and dump the Log.
More information for the logcat Command can be found here

You can make a utility function that opens an HTTP connection and writes to a web server.
This adds a little overhead to your application, but works fine to get log info.
Easy to implement, no rooting required!
Or you could write a little service that runs a web server that responds to requests with a dump on logcat (or a tail or logcat or something).
It might even be possible to write a shell script that uses curl or wget to do this (that is send get requests to a webserver in order to pass logcat output), but you might need to install them, which in turn you might need root for, so... maybe this wouldn't meet your needs.
I guess it might even be possible to create a network share on your workstation, mount it on your android device and just redirect logcat output to a file on the share. But I didn't try it - let me know if you do!

You could use apps like Logcat or others alike, which will give you the same output as your IDE Logcat console.
You can turn on the logging, do your stuff in your app, and return to the logcat app to check out the log, mail it to yourself etc.

I did a little bit more research and it seems that there's no possibility to read the logs easily without having root rights. You're able to read the logcat output using bugtracking libraries like ACRA in your Android app, but it's a lot more effort to include them and analyze the logs.
I'm going to develop on my own (rooted) tablet with adb-wireless now.

Related

Newbie - adb_vendor_keys issue on dji android device

Been browsing this group, found some great answers on here, but none have helped me with my problem.
We have a new ( less than 1 month old) dji device, called a smart controller, it’s basically an android tablet, it’s built into our drone remote controller.
A few days ago it came up wirh an error message duijg # Flight, which was basically a memory overflow.
So we suspect the internal memory has been filled by the local cache files.
The issue is that this has now stopped the device even starting up.
We have tried installing drivers on our pc, including the firmware update application from dji, but this just fails every time we try it.
Today we have been following advice on here, and using Rhe ADB program on our pc, we do at least get a connection to the device.
However we can’t do anything withnht program.
Each time we try any command we get this message
Device unauthorised
This adb server $adb_vendor_keys is not set.
We have tried deleting the public key, on the pc, and creating a new one, but we can’t write that new key to the device.
We are not programmers and don’t know code, so we are doing all this on our pc in a command line prompt.
Before we give up and send it back to China, anyone got any ideas on what we might be able to do?
Thanks in advance.
Without being able the use the physical device. I do not believe there is anything that you can do. Generally speaking the error you are seeing is caused due to a permission prompt that would appear on the device authorizing your computer to interact with it.
If you could get the device to display and disable and re-enable usb debugging a security prompt should display when you connect it to your PC. Without that option I would recommend sending it back

Is it possible to see output from log cat without having the app source code?

I have an app installed on my device.
An app that I developed, but I haven't got the source code anymore.
Is it possible to attach log cat to this app?
yes you can, just enable usb debugging on your android device, and plug the device where you have the application installed on it, by that, you will see all the logs on logcat.
Depends if you've left logs in the code. If you did, the easiest method would be probably going into your Android Studio and checking you Android Monitor tab. You can switch devices / applications there.
If you don't have any logs and your question actually means you want to add some logs in, then I'm afraid you can't reliably do that.

Get LogCat From Android Device Manually

My phone cannot connect to the android ADB but I need to check its logs since it seems to be getting unique errors from an app I made. aLogcat app is outdated and getting "bug reports" from developer options is unreadable for me.
Is there any way for me to get a logcat report of my app while I'm running an application on it?
Edit: I use a droid Mini phone and it won't connect to eclipse. After installing the specific driver for the device it worked.
First of all, consider making ADB work for your device. Provided this is totally impossible, consider using ACRA. If you don't want to integrate fully with it, check their logcat collection code.

Android: How to find out reason for "Unfortunately [...] has stopped"?

when I run my Android application with an emulator, it works perfectly, and so it does on my phone, but on another phone, trying to run the app, I always get the "Unfortunately [...] has stopped" error. How can I find out the reason for this error (Using the emulator, I could look it up in LogCat, but not on a real phone)??
Thanks in advance!
On a real phone, you can use the tool aLogCat to view logs on the device itself. You can also connect it to your computer via USB and use the adb logcat tool, and the logs will be visible from the computer's shell window.
Adb logcat could also be used over a wireless network with a tool like WiFi ADB, should you prefer wireless methods.
Android Remote Stacktrace is a quite useful library/script that allows you to easily add a way for a phone to send its crash logs your way.
Simplest would in this case probably be to add it to a test version you put on the other phone. Since it's not being actively developed (afaik), you may not want to put it in a normal store release build.

android error feedback device

I was wondering if there is any way to get any feedback of what's going on behind the scenes when running an app on an Android device. If I use the emulator and eclipse I can see what's happening in the logcat. But I'm making a program with ROS android and it I cannot run it on the emulator. Now my program crashes and I don't know why. Is there any way I can get more information?
Thanks
You can use adb to debug the app on your device. See http://developer.android.com/guide/developing/device.html
I can think of a couple (less than elegant) ways to try and find out what's going on.
1) Display toasts from potential problem areas (Does it have a screen?)
2) Write logs to the SD card (does it have an SD card??)
EDIT
I wasn't thinking clearly... you have to be able to load the program to the device, so you must be able to connect it to your PC. So, as Agarwal pointed out, you can most likely hook it up, run it on the device/robot/whatever and see what happens with the logcat.

Categories

Resources