Sony, logcat not showing the log for my app? - android

Logcat is showing all logs: Log.i(), Log.e() but not Log.d().
If I switch to another device such as my Reami 3S then for the same app log is displayed.
Sony is runngin Android 6 and developer options is turn on.
I found my answer where people used secret code for USB control menu, but I can't found for Sony E5 (f3311).
Pls, help me. This logs need me for logging retrofit. Without it I can't show HttpLoggingInterceptor.

You should activate the maximum log level in your device, in the answer below one of the solutions is
Dial
*#*#2846579#*#*
and you will see a hidden menu. Go to the Project Menu > Background Setting > Log setting and define the log availability (log switch) and level (log level setting).
Source: Huawei, logcat not showing the log for my app?

Related

Can I Use e.PrintStackTrace() or Breakpoints When Using Android USB Device?

In the Android app I'm currently working on I have all my try/catches to print out a stack trace but when using a physical android device via USB these errors do not seem to get printed. Further more, when I attempt to create a debug log on the device, it never shows up. My assumption is that I have to start relying on Log.d and print everything to the logcat. Is this correct?
Edit: I should also mention that these stack traces appear when using an emulator as well.
Also, I have noticed when debugging on a physical device when I hit break points it locks the application but it does not allow me to continue with debugging, a.k.a pass over the break point. Is this an error or simply how it preforms? Break points work fine on the genymotion emulator.
You are doing something in wrong way, be sure not to debug and look for logs at the same time and be sure you are using right filter at loging.
And at last be sure that you turn on debug mode on at your release version of app(or what version you are using at device).
For the logs, you should have to check is the log is enable, by using the following steps in eclipse:
* Go in Windows -> Preferences.
* After that, select Android -> LogCat.
* And set the option "Show logcat view if message priority is atleast:" to "VERBOSE".

Logcat in Android Device Monitor only display certain messages

I am not using Eclipse or Android Studio, I am just compiling my code myself and installing with adb.
If an uncaught exception or error occurs, it prints the the line number of the code that triggered it, but not the message.
If I call Log.d or Log.i, etc. , nothing happens. If I catch an exception and call e.printStackTrace() or System.err.println(), nothing happens.
What could be the issue?
Update: By the way, I am accessing logcat via the Android Device Monitor.
Update: It works fine using adb logcat. I just need it to work from Android Device Monitor now.
Make sure you don't have any filter set.If you just use the following command you should be able to see all the logs.
adb logcat
if you want to see only logs with particular tag:
adb logcat -s "TAG"
Also make sure when you building the apk,you don't have any code that is disabling the logs-because its a release binary.
If you are viewing through IDE logcat view remove the filter.It must be there left hand side corner.If the filter level is error,you need to make it verbose.
I think your log level is too high for Log.i and Log.d (for example, if your log level is 'error' you only get error messages)
So set your log level to verbose to display all logs.
You can find the log level indicator in the top right of your Android tab in Android studio

Huawei, logcat not showing the log for my app?

OK, logcat is showing system logs but it is not showing application log on my Huawei Ascend. If I switch to another device such as my Galaxy Nexus or Nexus 7 then for the same app (same APK even) log is displayed.
The Huawei Ascend is running Android 4.1.1, it has USB debugging switched on in developer options. This occurs for logcat run from either the command line or from IntelliJ. And I'm making sure that the correct device is selected - in fact I'm only plugging a single device in at a time. I've tried restarting adb, clearing it's buffer etc
I can see that the app is starting on the Huawei, I even get system logs showing that the Activity has started. But unlike on the other devices I get no app log in the Activity#onCreate (or from anywhere else).
08-08 20:55:44.050: INFO/WindowManager(431): Switching to real app window: Window{41ae8780 au.com.xandar.wirelesstiming.timekeeper/au.com.xandar.wirelesstiming.timekeeper.TimeKeeperActivity paused=false}
08-08 20:55:44.180: INFO/ActivityManager(431): Displayed au.com.xandar.wirelesstiming.timekeeper/.TimeKeeperActivity: +387ms
How can the application log not be getting delivered?
OK, since I had another Huawei Ascend I ran into the same problem. This time I have the exact answer. Follow these instructions (from denispyr's answer on Why doesn't logcat show anything in my Android?)
Dial
*#*#2846579#*#*
and you will see a hidden menu. Go to the Project Menu > Background Setting > Log setting and define the log availability (log switch) and level (log level setting).
And then make sure you restart your phone.
Please note this probably only applies to Huawei phones.
Also note that if you're on a Huawei tablet (e.g. MediaPad M3), instead of dialing, you launch the Huawei Calculator in landscape and enter ()()2846579()().
For Huawei with Android 8.0+
we must dial the code: *#*#2846579#*#*
and selecting the option AP Log will be enough to display the messages in the LogCat.
If any one having Letv Phone (LeEco Le Max 2 or 1) above solution won't work. Try the below USSD. Fig.1 for reference.
Press Dialer *#*#76937#*#*
Select "Enable All Logs"
Instead of using
Log.d(TAG, msg);
Try this.
Log.wtf(TAG, msg);
work for me.
I have a HUAWEI Y3 II aka LUA-L21.
The accepted answer didn't work for me.
It led to some MTKLogger settings screen, which is different than described in the answer, and didn't help at all.
My solution
Dial *#*#2846580#*#* (please note this code is different from the one in the accepted answer)
You just entered a settings screen called EngineerMode (again, different from accepted answer's ProjectMenu)
In the first Telephony tab, click the Log Control item
Activate both switches (set Mtklog control to catch all log and adb radio log to catch radio log by adb)
Back in the previous screen, swipe to the Log and Debugging tab
Open Debug Utils
Change Debug Level from User Mode to Engineer Mode
For good measure, restart your phone
Screens
Changing Log control
Changing Debug utils
Additional notes
Just to clarify my original problem; logcat was showing some of my app's log entries, just not my own messages - I saw entries belonging to my process com.example.myapp, but never anything I was printing out myself, in my code, using Log.d("TAG", "hello world");
There was plenty of stuff like this:
4260-4270/com.example.myapp I/art: Debugger is no longer active
4260-4412/com.example.myapp I/System.out: [CDS]rx timeout:1
4260-4412/com.example.myapp D/NativeCrypto: doing handshake ++
4260-4603/com.example.myapp D/OpenGLRenderer: Flushing caches (mode 0)
4260-4603/com.example.myapp D/Surface: Surface::disconnect(this=0xb85285d8,api=1)
4260-4260/com.example.myapp D/ActivityThread: ACT-STOP_ACTIVITY_HIDE handled : 0 / android.os.BinderProxy#2333cbdf
...but never anything like this:
4260-4603/com.example.myapp D/MainActivity: hello from onCreate!
The above steps solved the issue for me.
Some newer versions of Huawei Phones (I am using a Y9s 2019) have some settings changed.
Process is now
Dial *#*#2846579#*#*
Background Settings -> AP LOG Settings -> Open.
If you still can't see the logs, restart both your phone and Android Studio/Eclipse
Open your Dialer app and enter the following code: *#*#2846579#*#*.
1-Enter the Background Settings page.
2-Click on “Log Settings”
3-Check all 3 options to enable full logging.
4-Ignore the "will affect performance" warning.
5-Reboot the phone.
Try downloading a Logcat app(eg aLogCat) on your device itself and see if you are having the same problem.
I know its not a complete solution, but this way you may be able to figure out whats going wrong by reading the application logs.
Try this:
In Eclipse editor:
Reset adb from windows-->devices and then try again ...
please check your project is highlighted with green color (simply select your projrct name)

BackupManagerService error when enabling mobile data on custom build ics 4.0.4

We are trying to build a custom build of Android ICS (4.0.4 version) for our own hardware board. On this environment, we are currently observing that when we start the GPRS through PPP in the COMMAND LINE, it is connected successfully and we are able to browse the internet also successfully.
But however, when we try to enable the same in "Mobile Networks" menu option of the "Settings" menu in our Android build (through our touch screen), we find that the GPRS connectivity is not starting.
On debugging, we find that the logcat output when we go in for this screen in our custom Android build for the same is as follows (some parts of relevant section):
i am able to get my log messages till AsyncChannel send(msg) in AsyncChannel.java class but after sendmessage not getting into the callback mechanism and onSetUserDataEnabled(enabled)
Is it a permission related issue?
the logcat snippet when i turn on mobile data is:
D/ConnectivityService( 2467): setMobileDataEnabled(true)
D/ConnectivityService( 2467): Data enabled: user=false, policy=true
W/BackupManagerService( 2467): dataChanged but no participant pkg='com.android.providers.settings' uid=1001
complete locat o/p is here
We would highly be obliged if anyone had faced the same issue before and if so how we can get this resolved. Thanks in advance for your help.
thanks

What to do when app crashes and logcat shows no errors

The app works fine in the emulator, but after installation on a phone, it crashes every time on launch, and logcat shows no errors.
What am I supposed to do when something like this happens?
My Suggestion for easier resolution of your problem :
Run the app from the eclipse in debug mode on the Phone . It will make it run on debug mode. You will most likely get more debug output.
Turn on ADB in the phone.
Connect the Phone to the PC
Run as "Debug Configuration" from eclipse.
It should run from your phone and Eclipse will ask for your choice for first time before running that.
Turning the Debug Mode on ( Note : This isn't the 'ADB connection' we are referring to ) , It will enable further logging of the application and doesn't do garbage collection normally.
( You will notice a 'Waiting for debug connection' dialogue , if the applications are forced to work in debug mode ).
For e.g :It makes the Async threads keep running and doesn't stop running. Crude and irrelevant for your case . But just as an example.
So , Since the Applications in the phone are forced to run in debug mode , it will get the logcat with detailed errors down to the specific threads.
However, the debug mode is better used when it's used in conjunction with "Debug As" run configuration from Eclipse. And keep in mind that it will automatically turn on that debug application mode ( And there by the dialog box also) , the logcat will show you more details and plus it will break-point at the errors which occur ,in their sequence of occurence.
Regarding what Ares told,
When you want to do the debugging of a process directly,
You can go to the DDMS panel in Eclipse,
On the right side tab menu Devices ,
Select the process you want to debug . and click on the green symbol ( Says, Start Debugging process )
It will automatically go to the source when it breaks if you have the source code in that eclipse work-space.
Additional hint:
On huawei phones, logcat doesn't show debug messages and excpetions, if the phone is in default system settings.
In order to enable logcat full logs on Huawei phones, you must do the following:
Open the factory settings menu by dialing *#*#2846579#*#*
Navigate to Project Menu / Background Setting / Log setting
On older phones: define the log availability (log switch) and level (log level setting).
On never phones: tick AP Log (which seems to enable app logging in general) and CP Log (seems to enable debug logging)
Close the menu with your backbutton (no restart needed)
Source: https://stackoverflow.com/a/18395092/1075072
Install a tool like AndroidSystemInfo that can show you the logfile on the phone - even when you are away from the host computer.
It is pretty unusual that Android leaves no trace whatsoever.
Does your app perhaps require features that the phone does not have (e.g. a camera or gps or nfc)?
In Eclipse you should go to DDMS, then click on device's name or android.os in Devices panel. And turn your device in debug mode.
Put your own logs to track what block of code cause crashe, or just debug it.
You can reset adb (In Devices -> View menu -> Reset adb)
Click on the selected online device/emulator to show the logcat
Disconnect the cable and again connect it. (Or restart the emulator)
Restart Eclipse
I restarted my emulator and cleaned my build. This got rid of both the non-logging and the spurious crash I was having

Categories

Resources