Attach to a process on the Android device - android

I've published an Android bundle on Play Store for internal testing. Now I've installed it (from Play Store) on a physical device and started. As the application is malfunctioning I want to see the logs as I did by starting debugging right from VS Code (or Android Studio for what it's worth). But I see no such possibility. I've uploaded debug symbols to the release but it didn't change anything.
On VS Code I see following options:
None of those works.
On Android Studio I tried to attach debugger to a running process (the application is running at the moment) and see no available processes on the Samsung device:
I just need to see logs, I don't need a step-by-step debugger.
So the question is: is it possible to attach a debugger to an application installed from Play Store?

Ok, for my needs I found a solution. Android Studio's Logcat shows all logs from the connected device. There I can filter out flutter tagged entries and see my application.
Only thing that puzzles me is the filtering by the package name. Each entry I see shows my package name. But if I click on it and choose Add "package:com.myapp" to Filter no entries are shown anymore. But I can live with that.
Another option is running adb logcat on my device. That's even better one

Related

Android: is there a way to dump crash logs locally on test device with no computer connected

I'm experiencing pesky SIGSEGV faults in my Android app. They are inconsistent to reproduce and mostly happen after my app has been restarted a couple of times. The problem is, when the app restarts, Android Studio stops showing the logs, making it very hard for me to figure out what the issue is. When I restart the app using the Android Studio restart button, it loads a fresh install of the app onto my phone, which is an issue because the errors don't seem to happen on very fresh installs.
My question is: can I somehow have Android Studio still show the live logs WITHOUT reinstalling the app every time, OR can I run the app without being connected to any PC, and dump a crash log file locally to the phone when the app crashes, so that I can open the logs later on?
Filtering logcat
The problem is, when the app restarts, Android Studio stops showing the logs, making it very hard for me to figure out what the issue is.
It sounds like the logcat in android studio is filtering by application. You can change it to no filter and set the text filter to your application's id. This way the logcat will not be cleared once the application process dies/restarts.
Extracting the tombstones
Since this is an Android native crash it will not be sent to bug capturing software such as Crashlytics or Bugfender etc.. you can pull the tombstone[s] directly from the device with adb.
adb bugreport bugreport.zip
Once extracted, the tombstones will be under path /bugreport/FS/data/tombstones/.
Typically 10 tombstones will get saved to device storage but will get overwritten by earlier native crashes once the limit to the number of retained tombstones has been met.
Android documentation: Using bugreport
Android documentation: Debugging tombstones

Is it possible view entire logcat of Android device (i.e. not attached to a specific process)?

Simple question, but is it possible to view the entire logcat output of an Android device in Android Studio? Meaning all of the logs from everything that's happening on the device, not necessarily only those generated by the app in development.
I ask because I have a bug that does not show up on the debug build (i.e. I build it in Android studio and run it on a device), but it DOES show up in the production build for the same code, and I would love to see what is happening on the device.
Essentially, I'm asking if it's possible to select nothing from the following dropdown menu.
Use no filters option in your Android studio Logcat.
How you can select nothing in processes spinner:
Stop your application
Close the emulator
Press launch in android studio
Cancel launching the application
Emulator is still launching
You have no debuggable processes in your spinner.

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.

Getting app logs off of a Samsung Galaxy S6

I do testing on app that I download from Jenkins as a .apk file. I have Android Studio and I have gotten as far as connecting my Samsung galaxy S6, setting it to debugging mode and I can see a bunch of device logs coming up at the bottom of my Android Studio screen.
What I cannot figure out is how to see the logs for the app I am testing. I have tried to filter the logs by using the app name. Do I need to filter the logs using a specific file name? Maybe the file used to install the app? Is there an easy way to get the app logs from my device that I am not seeing?
You need to ensure that:
This is the debug version of the app.
Proguard isn't set up to strip out certain logs.
ADB Integration is enabled.
Sometimes, you have cycle through the USB options (For example, my LG phone needed to be in PTP mode before Android Studio picked it up)
For obvious security reasons, most apps don't want the public to access their logs.

while the apk runs without problems on emulator when installed on Motorola milestone picture and icon doesn't shown as they were on emulator

my problem : the app I have uploaded into my cellular device is shown without the pictures I have insert to it .
steps I have done in order to install:
I have inserted the xxx.apk file into the device via usb
I downloaded an apps installer via the Market
I opened the app using the installer and instead of picture an white background appeared
when I opened the xxx.apk file using file system I found the pictures.
note: even an application icon weren't appearing.
Apparently the res libary having problem to be bined to application.
I might ness to add something to my appliction manifest?
I might need to change something on my device ? (I already made a change and enabled user's not Market application )
I would be very grateful for some life saving answer I need to show my work in a few days in this is the first time i tested her on a real devise.
I also tried an example as shown in hello android book the same example worked perfectly on the emulator where on my android device (Motorola milestone ) the picture and icon weren't shown
Please tell me what I might be doing wrong guys I need to apply my project back at uni(I was the only one in uni who did it on android and in my country most of pep don't even know what android is so getting help outside of forum's like this is not an option ) so please please help me .
I don't know what app installer you downloaded from the Market, but you shouldn't need it. You should be installing the app to your phone using the same SDK tools you used to install it to the emulator. Ie, using Eclipse or the commandline "adb install" commmand.
I'm assuming you used the SDK tools to install the app to the emulators? In which case, start there. Start with looking at what you're doing different between when you installed unsuccessfully to your phone and when you installed to successfully to the SDK.
In my experiences so far, there should be very few differences between working with the emulator and working with the phone.
Well, something is wrong, but what is hard to tell from your question. What pictures are you talking about? Your drawable resources? My guess would be that your application works in the emulator (you have tested it?), but that it doesn't on the phone you're testing with. Have you checked the logcat output?
If you're developing from Eclipse, why not try a debugging session using the phone rather than the emulator?
Hard to narrow down without more details, but a few notes:
Pontus has a point - what's your logcat output? You can use logcat on a real device. Maybe not yours unless it's rooted, but with many phones you can.
Do you link the drawable to your app in the manifest file?
How do you test on emulator vs. device? Do you right-click the app and choose "Run As -> Android Application"? Do you do that for both emulator and device?
When you run on the device, do you first sign it? If so, can you verify the jar/apk and see the contents? Is the drawable under res/drawable?

Categories

Resources