43

I am new to Android development and bought a cheap Huawei Sonic (U8650 apparently) so I could test my first attempts at making an app on an actual device.

However, whenever I try to use 'adb logcat' or 'adb shell' then 'logcat' on the device I get:

Unable to open log device '/dev/log/main': No such file or directory

I have already enabled Usb debugging in Settings -> Developer.

I just don't know enough about Android to know if this is something I can even fix.

I have found two other questions with similar problems:

/dev/log/main not found

??-?? ??:??:??.???: INFO/<unknown>(<unknown>): Unable to open log device '/dev/log/main': No such file or directory

...but they both turned out to be using some kind of non standard kernel that had logging disabled. Mine is a stock phone out of the box.

It's a very cheap but snappy Android 2.3 phone, so hopefully it wasn't a total waste of money.

Any help would be greatly appreciated.

Community
  • 1
  • 1
Devgeeks
  • 5,659
  • 4
  • 28
  • 35

7 Answers7

73

Dial this: *#*#2846579#*#*
Service menu will appear.
Go to "ProjectMenu" -> "Background Setting" -> "Log Setting"

Open "Log switch" and set it to ON.
Open "Log level setting" and set the log level you wish.

Reboot the phone.

iTake
  • 4,082
  • 3
  • 33
  • 26
33
  1. Open: /system/etc/init.d/××× (not the same file on different ROMs, find the right file)
  2. Find the line that says: rm /dev/log/main
  3. Change the line to: # rm /dev/log/main (comments out the line, rm = remove, in case you were wondering)
  4. Save and reboot
Volo
  • 28,673
  • 12
  • 97
  • 125
grenjar
  • 339
  • 3
  • 2
17

I'm sharing my case and solution:

My cellphone had a jellybean version oriented to performance (To be exact a Slim Bean ROM) with a Semaphore kernel (You can recognize it because when the cellphone is starting, the semaphore logo is shown). These kind of ROM have by default disabled the logging so I had to download the Semaphore Manager application (You can download it from here). After that, in the section "Modules" I had to turn on the Logger option as it is shown in the picture

enter image description here

Restart and the logcat should be working now!

Jav_1
  • 462
  • 5
  • 12
  • 3
    exact solution for me on Samsung Galaxy S - Captivate, with Slim Bean 4.2.2 and Semaphore Kernel. – Rizwan Sohaib Aug 05 '13 at 07:12
  • Hmm.. anyone got an answer for S8500 wave device running android 4.4 tigrouzen ROM ?None of the previous work. Tried manually putting that file in its place got back read: Unexpected length error. – kellogs Feb 18 '14 at 09:56
16

I have actually found an answer for this finally!

I was having another aimless look to see if anything had been updated about this anywhere and came across a post on xda-developers about a slightly different Huawei device with the same problem.

http://forum.xda-developers.com/showpost.php?p=17774398&postcount=93

It actually worked. I have complete logcat logging on my Huawei Sonic (U8650) now.

Three cheers for not giving up.


Solution, copied from the xda (in case it is removed etc):

There is a hidden service-menu where you can set loggin up. The
service-menu is started by "dialing" this phone number:

*#*#2846579#*#*
Marcin Orlowski
  • 72,056
  • 11
  • 123
  • 141
Devgeeks
  • 5,659
  • 4
  • 28
  • 35
  • 2
    Also answered in another stackoverflow question: http://stackoverflow.com/questions/7021939/what-to-do-if-manufacturer-removed-folders-under-dev-log-folder-means-no-logca – tonys Oct 11 '11 at 10:34
  • 11
    When I type the phone# sequence on either of my phones they both do the same thing: erase the ph# from the screen and do nothing... – Brad Hein Nov 12 '12 at 23:00
2

it was enough to restart the Huawei device

adb shell
reboot
ViliusK
  • 11,345
  • 4
  • 67
  • 71
2

I have a custom rom on my Samsung Captivate, but my approach may work for others as well:

Open up CMD or Terminal and type:

adb shell
logcat-enable
reboot

The rom I have is Continuum v6.1, but this still may work for others.
If you have the terminal emulator on the phone, you also may be able to do:

logcat-enable

and then just reboot the phone. I didn't try that, but it probably would work too. My phone is also rooted - don't know if that makes a difference.

Reed
  • 14,703
  • 8
  • 66
  • 110
  • @ulidtko I"m not surprised. I guess it's a function of certain kernels. Some include the logcat-enable and logcat-disable commands, but stock kernels likely would not. If I figure something more out, I'll post it. – Reed Nov 15 '11 at 23:49
0

I'm having exactly the same problem. Someone from xda-developers wrote something as follows in msg #33

http://forum.xda-developers.com/showthread.php?t=1169869&page=4

One of the reason it can't be rooted is this phone had removed the "Logcat" mechanism from android. So, this makes most of rooting ways malfunction.

Maybe right maybe wrong i don't know.Anyway it gives some idea about the case.

  • Yeah, I have actually managed to root the device (using the instructions in that same thread, actually: http://forum.xda-developers.com/showpost.php?p=16107543&postcount=24), but I guess I would need some way of replacing the ROM currently on it with one that hasn't had logcat stripped... – Devgeeks Aug 10 '11 at 02:11
  • 2
    I tried Roms here :(http://wiki.modaco.com/index.php/Huawei_Firmware_U8650).It is said Spanish Yoigo works but my device is set to work with ROM of selling carrier so caught up with a sim lock.I managed a way using java.util.logging API and wrote a piece of code to dump logs into a file on sdcard. –  Aug 10 '11 at 08:50