JakeWharton / pidcat

Colored logcat script which only shows log entries for a specific application package.
Apache License 2.0
4.84k stars 500 forks source link

Nothing printed with Huawei Honor8 #139

Open DoDoENT opened 7 years ago

DoDoENT commented 7 years ago

I tried running like this:

adb logcat -v brief | pidcat -w50 -ld

This command works for me for all other devices, but not for Huawei Honor8. Logging in Android studio works for this device.

Here is an example log of adb logcat -v brief from that device:

$ adb logcat -v brief
int logctl_get(): open '/dev/hwlog_switch' fail -1, 13. Permission denied

Note: log switch off, only log_main and log_events will have logs!
--------- beginning of system
D/DefContainer(12025): Copying /data/local/tmp/com.microblink.photopay to base.apk
I/ActivityManager( 1018): cleanUpApplicationRecordLocked, reset pid: 9540, euid: 0
I/ActivityManager( 1018): collectReceiverComponents for intent: Intent { act=android.intent.action.SIG_STR flg=0x20000010 (has extras) }, receivers: null
W/ContextImpl( 1018): Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:872 com.android.server.pm.HwPackageManagerService.parseInstalledPkgInfo:2269 com.android.server.pm.PackageManagerService.parseInstalledPkgInfo:18278 com.android.server.pm.PackageManagerService.access$1400:340 com.android.server.pm.PackageManagerService$PackageHandler.doHandleMessage:1535 
V/HwPackageManagerService( 1018): POST_INSTALL:  pkgName = com.microblink.photopay, pkgUri = /data/local/tmp/com.microblink.photopay, pkgVerName = 4.4.0, pkgVerCode = 160, resultCode = 1, pkgUpdate = false
I/ActivityManager( 1018): Killing 9520:0:com.android.calendar/u0a8 (adj 15): empty for 4694s
I/ActivityManager( 1018): collectReceiverComponents for intent: Intent { act=android.intent.action.PACKAGE_ADDED dat=package:com.microblink.photopay flg=0x4000010 (has extras) }, receivers: [ResolveInfo{5a0ca8e com.huawei.gamebox.global/com.huawei.appmarket.service.installresult.control.InstallerReceiver p=2147483647 m=0x208000 euid=0}, ResolveInfo{b01b2af com.android.contacts/.compatibility.ContactsProviderReceiver p=1000 m=0x208000 euid=0}, ResolveInfo{68496bc com.android.providers.contacts/.PackageIntentReceiver m=0x208000 euid=0}, ResolveInfo{dc9a645 com.google.android.partnersetup/.RlzPingBroadcastReceiver m=0x208000 euid=0}, ResolveInfo{de3019a com.google.android.partnersetup/.AppInstalledReceiver m=0x208000 euid=0}, ResolveInfo{b40cacb com.huawei.systemmanager/com.huawei.notificationmanager.receiver.Receiver m=0x208000 euid=0}, ResolveInfo{c6262a8 com.huawei.systemmanager/com.huawei.permissionmanager.ui.AppInstallationReceiver m=0x208000 euid=0}, ResolveInfo{5e361c1 com.huawei.systemmanager/.optimize.OptimizeReceiver m=0x208000 euid=0}, ResolveInfo{5df9d66 com.huawei.systemmanager/.power.receiver.BootBroadcastReceiver m=0x208000 euid=0}, ResolveInfo{50f48a7 com.huawei.systemmanager/.netassistant.netapp.receiver.AppChangeReceiver m=0x208000 euid=0}, ResolveInfo{7cf0154 com.huawei.systemmanager/.antivirus.AntiVirusReceiver m=0x208000 euid=0}, ResolveInfo{8358fd com.huawei.systemmanager/.addviewmonitor.AppChangeReceiver m=0x208000 euid=0}, ResolveInfo{db829f2 com.huawei.systemmanager/.rainbow.client.background.broadcast.SecurityBroadcastReceiver m=0x208000 euid=0}, ResolveInfo{75dc843 com.huawei.systemmanager/.spacecleanner.receiver.SpaceCleanReceiver m=0x208000 euid=0}, ResolveInfo{cc4dec0 com.android.gallery3d/com.huawei.gallery.photoshare.receiver.GalleryPackageMonitor m=0x208000 euid=0}, ResolveInfo{43187f9 com.android.phone/.vvm.omtp.VvmPackageInstallReceiver m=0x208000 euid=0}, ResolveInfo{41af33e com.android.settings/.applications.BlackListReceiver m=0x208000 euid=0}, ResolveInfo{58aa59f com.huawei.securitymgr/.AppUninstallReceiver m=0x208000 euid=0}, ResolveInfo{27926ec com.nuance.swype.emui/com.nuance.swype.input.appspecific.AppUsage m=0x208000 euid=0}, ResolveInfo{df9aab5 com.android.vending/com.google.android.finsky.receivers.PackageMonitorReceiver$RegisteredReceiver m=0x208000 euid=0}, ResolveInfo{24f054a com.google.android.gms/.chimera.GmsIntentOperationService$PersistentTrustedReceiver m=0x208000 euid=0}, ResolveInfo{7dfcbb com.google.android.gms/.gass.chimera.PackageChangeBroadcastReceiver m=0x208000 euid=0}, ResolveInfo{c47c5d8 com.google.android.gms/.gcm.GcmPackageTracker$GcmPackageChangeReceiver m=0x208000 euid=0}, ResolveInfo{5e73d31 com.google.android.gms/.games.chimera.GamesSystemBroadcastReceiverProxy m=0x208000 euid=0}, ResolveInfo{d002c16 com.google.android.googlequicksearchbox/com.google.android.apps.gsa.googlequicksearchbox.GelStubAppWatcher m=0x208000 euid=0}, ResolveInfo{585a997 com.google.android.googlequicksearchbox/com.google.android.apps.gsa.search.core.icingsync.IcingCorporaChangedReceiver m=0x208000 euid=0}, ResolveInfo{55f6784 com.google.android.apps.docs/.receivers.AppPackageAddRemoveReceiver m=0x208000 euid=0}, ResolveInfo{f417b6d com.facebook.katana/com.facebook.feed.platformads.AppInstallReceiver m=0x208000 euid=0}, ResolveInfo{5caf3a2 com.facebook.katana/com.facebook.pkg.event.PackageEventBroadcastReceiver m=0x208000 euid=0}]
V/NetworkPolicy( 1018): ACTION_PACKAGE_ADDED for uid=10127
I/ActivityManager( 1018): new Process app=ProcessRecord{b2d77f0 0:0:com.huawei.gamebox.global/u0a101}, name: com.huawei.gamebox.global, euid: 0
I/ActivityManager( 1018): Start proc 12105:com.huawei.gamebox.global/u0a101 for broadcast com.huawei.gamebox.global/com.huawei.appmarket.service.installresult.control.InstallerReceiver
I/ActivityManager( 1018): retrieveServiceLocked, callerApp: ProcessRecord{ed4ab14 1459:0:com.android.systemui/u0a28}, flags: 400
I/ActivityManager( 1018): bindServiceLocked, r: ServiceRecord{b10d4a1 u0 euid: 0 com.android.systemui/.statusbar.toolbox.ToolBoxService}, euid: 0
I/HwInputMethodManagerService( 1018): isSecureIMEExist = false
W/ActivityManager( 1018): Permission Denial: Accessing service ComponentInfo{com.google.android.music/com.google.android.music.dial.DialMediaRouteProviderService} from pid=9536, uid=10010 that is not exported from uid 10083
I/HwMtmBroadcastResourceManager( 1018): removeReceiver mtm Broadcast
I/ActivityManager( 1018): cleanUpApplicationRecordLocked, reset pid: 9520, euid: 0
D/ActivityThread(12105): ActivityThread,attachApplication
D/ActivityManager( 1018): ActivityManagerService,attachApplication,callingPid = 12105
I/HwMtmBroadcastResourceManager( 1018): removeReceiver mtm Broadcast
I/HwMtmBroadcastResourceManager( 1018): removeReceiver mtm Broadcast
I/HwMtmBroadcastResourceManager( 1018): removeReceiver mtm Broadcast
E/ActivityThread( 5801): Failed to find provider info for com.huawei.parentcontrol
E/ActivityThread( 5801): Failed to find provider info for com.huawei.parentcontrol
I/SmartHeartBeat( 1018): listenAppUpdate, package: com.microblink.photopay has been Updated
I/ActivityManager( 1018): collectReceiverComponents for intent: Intent { act=android.search.action.SEARCHABLES_CHANGED flg=0x24000010 }, receivers: null
I/ActivityManager( 1018): Killing 10343:0:com.huawei.systemmanager/1000 (adj 15): empty for 3145s
I/ActivityManager( 1018): new Process app=ProcessRecord{77d600e 0:0:com.google.android.partnersetup/u0a14}, name: com.google.android.partnersetup, euid: 0
I/ActivityManager( 1018): Start proc 12138:com.google.android.partnersetup/u0a14 for broadcast com.google.android.partnersetup/.RlzPingBroadcastReceiver
I/ActivityManager( 1018): collectReceiverComponents for intent: Intent { act=com.huawei.gamebox.global.service.downloadservice.Receiver flg=0x10 }, receivers: null
D/ActivityThread(12138): ActivityThread,attachApplication
D/ActivityManager( 1018): ActivityManagerService,attachApplication,callingPid = 12138
I/ActivityManager( 1018): cleanUpApplicationRecordLocked, reset pid: 10343, euid: 0
I/ActivityManager( 1018): retrieveServiceLocked, callerApp: ProcessRecord{77d600e 12138:0:com.google.android.partnersetup/u0a14}, flags: 400
I/ActivityManager( 1018): bindServiceLocked, r: ServiceRecord{6ece83c u0 euid: 0 com.google.android.partnersetup/.RlzPingIntentService}, euid: 0
I/ActivityManager( 1018): retrieveServiceLocked, callerApp: ProcessRecord{77d600e 12138:0:com.google.android.partnersetup/u0a14}, flags: 400
I/ActivityManager( 1018): bindServiceLocked, r: ServiceRecord{c0959c5 u0 euid: 0 com.google.android.partnersetup/.AppInstalledService}, euid: 0
I/ActivityManager( 1018): retrieveServiceLocked, callerApp: ProcessRecord{f0b5863 1660:0:com.huawei.systemmanager:service/1000}, flags: 400
I/ActivityManager( 1018): bindServiceLocked, r: ServiceRecord{cb36f1a u0 euid: 0 com.huawei.systemmanager/.util.content.HsmIntentService_bg}, euid: 0
I/ActivityManager( 1018): new Process app=ProcessRecord{c5c6a4b 0:0:com.huawei.systemmanager/1000}, name: com.huawei.systemmanager, euid: 0
I/ActivityManager( 1018): Start proc 12161:com.huawei.systemmanager/1000 for broadcast com.huawei.systemmanager/com.huawei.permissionmanager.ui.AppInstallationReceiver
I/ActivityManager( 1018): Killing 10312:0:com.opera.browser:alarm_receiver/u0a108 (adj 15): empty for 3145s
D/ActivityThread(12161): ActivityThread,attachApplication
D/ActivityManager( 1018): ActivityManagerService,attachApplication,callingPid = 12161
I/ActivityManager( 1018): cleanUpApplicationRecordLocked, reset pid: 10312, euid: 0
V/HwNotificationManagerService( 1018): Notification db cfg changed
V/HwNotificationManagerService( 1018): HwCfgLoadingRunnable: Starts 
V/HwNotificationManagerService( 1018): HwCfgLoadingRunnable: get cfg size:45
V/HwNotificationManagerService( 1018): HwCfgLoadingRunnable: Ends. 
W/ContextImpl(12161): Calling a method in the system process without a qualified user: android.app.ContextImpl.startService:1381 android.content.ContextWrapper.startService:581 com.huawei.systemmanager.SystemManagerApplication.startMainService:199 com.huawei.systemmanager.SystemManagerApplication.startServices:100 com.huawei.systemmanager.SystemManagerApplication.onCreate:83 
I/ActivityManager( 1018): resolve info: ResolveInfo{72acd41 com.microblink.photopay/.MenuActivity m=0x0 euid=0}, euid: 0
W/ContextImpl(12161): Calling a method in the system process without a qualified user: android.app.ContextImpl.startService:1381 android.content.ContextWrapper.startService:581 com.huawei.systemmanager.SystemManagerApplication.startPreventModeService:145 com.huawei.systemmanager.SystemManagerApplication.startServices:101 com.huawei.systemmanager.SystemManagerApplication.onCreate:83 
I/ActivityManager( 1018): ActivityRecord info: ActivityInfo{90962e6 com.microblink.photopay.MenuActivity}, euid=0
V/HwWindowManagerService( 1018): moveTaskToTop mTaskChanged:true
I/ActivityManager( 1018): create new task record, multiLaunchId: 0, intent = Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.microblink.photopay/.MenuActivity }
V/HwWindowManagerService( 1018): moveTaskToTop mTaskChanged:true
V/HwWindowManagerService( 1018): moveTaskToTop mTaskChanged:true
V/HwWindowManagerService( 1018): setFocusedApp update app ops, mTaskChanged set to:false
I/ActivityManager( 1018): mService.startProcessLocked for activity: ActivityRecord{9056027 u0 com.microblink.photopay/.MenuActivity t75}, appinfo euid: 0
I/ActivityManager( 1018): new Process app=ProcessRecord{5807c3b 0:0:com.microblink.photopay/u0a127}, name: com.microblink.photopay, euid: 0
W/ContextImpl(12161): Calling a method in the system process without a qualified user: android.app.ContextImpl.startService:1381 android.content.ContextWrapper.startService:581 com.huawei.systemmanager.SystemManagerApplication.startPermissionService:150 com.huawei.systemmanager.SystemManagerApplication.startServices:102 com.huawei.systemmanager.SystemManagerApplication.onCreate:83 
I/ActivityManager( 1018): Start proc 12208:com.microblink.photopay/u0a127 for activity com.microblink.photopay/.MenuActivity
I/ActivityManager( 1018): collectReceiverComponents for intent: Intent { act=com.huawei.android.action.WIDGET_FOCUS_CHANGE flg=0x10 (has extras) }, receivers: null
W/ContextImpl(12161): Calling a method in the system process without a qualified user: android.app.ContextImpl.startService:1381 android.content.ContextWrapper.startService:581 com.huawei.systemmanager.SystemManagerApplication.startBgStaticsService:161 com.huawei.systemmanager.SystemManagerApplication.startServices:104 com.huawei.systemmanager.SystemManagerApplication.onCreate:83 
W/ContextImpl(12161): Calling a method in the system process without a qualified user: android.app.ContextImpl.startService:1381 android.content.ContextWrapper.startService:581 com.huawei.systemmanager.SystemManagerApplication.startNetControllService:168 com.huawei.systemmanager.SystemManagerApplication.startServices:105 com.huawei.systemmanager.SystemManagerApplication.onCreate:83 
W/ContextImpl(12161): Calling a method in the system process without a qualified user: android.app.ContextImpl.startService:1381 android.content.ContextWrapper.startService:581 com.huawei.systemmanager.SystemManagerApplication.startAppLockService:173 com.huawei.systemmanager.SystemManagerApplication.startServices:106 com.huawei.systemmanager.SystemManagerApplication.onCreate:83 
W/ContextImpl(12161): Calling a method in the system process without a qualified user: android.app.ContextImpl.startService:1381 android.content.ContextWrapper.startService:581 com.huawei.systemmanager.SystemManagerApplication.startSpaceCleanService:178 com.huawei.systemmanager.SystemManagerApplication.startServices:110 com.huawei.systemmanager.SystemManagerApplication.onCreate:83 
W/ContextImpl(12161): Calling a method in the system process without a qualified user: android.app.ContextImpl.startService:1381 android.content.ContextWrapper.startService:581 com.huawei.systemmanager.SystemManagerApplication.startStarupService:183 com.huawei.systemmanager.SystemManagerApplication.startServices:111 com.huawei.systemmanager.SystemManagerApplication.onCreate:83 
gonzalonm commented 7 years ago

It can be related with Huawei devices. You may dial to *#*#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). More info here.

Good luck!

olegat commented 7 years ago

Possibly a duplicate of (or related to) Issue #142

teslacoil commented 7 years ago

I noticed the same issue on the Huawei P9. It's because of the blank line here:

int logctl_get(): open '/dev/hwlog_switch' fail -1, 13. Permission denied

Note: log switch off, only log_main and log_events will have logs!
--------- beginning of system

https://github.com/JakeWharton/pidcat/blob/8bd97429c063246f1d453730c124f57bd501225a/pidcat.py#L262 Locally I just commented out that check for empty lines. I'm not sure if it's actually needed for some use case or device, but if it is, the fix could be to only actually break on empty lines after the --------- beginning of system

pzgz commented 7 years ago

I have excatly the same issue, on Mate9 Pro. And thanks to @teslacoil 's good catch. That's the right point. I have forked the project and added one argument so that we can disable the break on empty line feature if we needed. Let me know if I need to create a PR to this repo.

nomadalex commented 7 years ago

pull request #145 fix this