1

I had no issues with debugging some add-ins that I wrote with Kodi on Linux.

Debugging on an Android device without root is another story. I have no way of looking at the logs on the device, as the different apps are using different UIDs - Kodi is using one and the terminal emulator that I used is using another and it is not able to read the debug log produced by Kodi.

I would like to know if you have some best practices.

The best method so far was to use the "Kodi Logfile Uploader" add-on. It allows you to upload the Kodi debug log to a server and look at it using your browser.

wojciii
  • 4,253
  • 1
  • 30
  • 39
  • I don't know about Kodi development specifically, but Android apps typically write their log messages to the system's "logcat" facility, which you can read in Android Studio when your device is connected in USB debugging mode. You don't need root to debug an Android app. – Wyzard May 20 '17 at 20:48
  • If you *must* write logs to a file on the device, put the file in shared storage so the user (and other apps) can access it. – Wyzard May 20 '17 at 20:50
  • I had this problem on a Phillips Android TV. I had no way of accessing adb logs or getting a shell using adb. Event if I could the UID of the shell would be different from the UID of the Kodi app (I assume) without root. Any media that I inserted was mounted RO and I was unable to copy the logs from Kodi to it. – wojciii May 20 '17 at 21:15
  • Yes, Android uses UIDs to isolate apps from each other. But you wouldn't use ADB to get a shell, you'd use it to read the system logs directly (`adb logcat`). If the device doesn't provide ADB access, though, that's a different story. – Wyzard May 20 '17 at 21:18
  • While some kodi logs will be written to logcat (since Kodi is an Android app), the interesting logs are written to a file after you enable debug in Kodi. I'm after the debug logs from modules written in Python. – wojciii May 20 '17 at 21:22

1 Answers1

0

First, usually you don't need root assess to view Kodi logs. Normally, they are located in <internal_storage>/Android/data/org.xbmc.kodi/files/.kodi/tempfolder. All you need is a file manager that can view "hidden", that is, . prefixed, folders and files, for example Total Commander.

And if you need more advanced debugging experience, I'd recommend my Web-PDB debugger for Kodi that allows to use Python's built-in PDB debugger remotely from a web-browser.

Roman Miroshnychenko
  • 1,496
  • 1
  • 10
  • 16