Nextcoud Debug With ADB

2023-03-18

A while back I was having issues with my families android phones not backing up photos automatically. Nextcloud had removed the ability to view logs from within the mobile app, so I had to resort to other means to figure out the issue. My issue ended up being old TLS version on the server, but this process got me on the path to discovering the root of the issue.

First things first make sure adb (Android Device Bridge) is installed. Locally (windows desktop) it’s not on $PATH but in C:\Users\Walker\Documents\Platform-tools To use outside of $PATH, navigate to the directory where the adb.exe is stored and launch it via ./adb.exe To get a new copy of adb, download it from google adb documentation adb can be installed without installing Android Studio .

Nextcloud specific Debugging

Pulled from here
Getting debug info via logcat
Nextcloud-Android-with-Linux

With a linux computer:

  • enable USB-Debugging in your smartphones developer settings and connect it via USB
  • open command prompt/terminal
  • enter adb logcat | grep "$(adb shell ps | awk '/com.nextcloud.client/{print $2}')" > logcatOutput.txt to save the output to this file

Note: You must have adb installed first!

Android-On-Windows

On Windows:

  • download and install Minimal ADB and fastboot
  • enable USB-Debugging in your smartphones developer settings and connect it via USB
  • launch Minimal ADB and fastboot
  • enter adb shell ps | findstr com.nextcloud.client and use the second place of this output (it is the first integer, e.g. 18841) as processID in the following command:
  • adb logcat | findstr <processID> > %HOMEPATH%\Downloads\logcatOutput.txt (This will produce a logcatOutput.txt file in your downloads)
  • if the processID is 18841, an example command is: adb logcat | findstr 18841 > %HOMEPATH%\Downloads\logcatOutput.txt (You might cancel the process after a while manually: it will not be exited automatically.)

Rooted Android

On a device (with root)

  • open terminal app (can be enabled in developer options)
  • get root access via “su”
  • enter logcat -d -f /sdcard/logcatOutput.txt
  • you will have to filter the output manually, as above approach is not working on device

or

Note: Your device needs to be rooted for this approach!


Enter your instance's address


More posts like this