Search code examples
androidandroid-studioadbandroid-auto

check android auto app log messages while connected to car


I have a question on checking logs/debugging of android auto app when the mobile device is connected to the main Head Unit (car).

During apk installation on the Mobile device from the development machine using Android Studio, the logs can to checked using adb (Android Debug Bridge). Since it is a development machine, the calls does not go into functions like onCarConnectionCallbacks.

So tried using DHU (Desktop Head Unit), but DHU is connected using adb forward socket connection, How to check for app log messages simultaneously?

And also how to check log messages or debug the app, when it is connected to the main Head Unit (Car), Should the adb be installed? (Here the mobile is not on development mode).

I am not able to find convincing answers online. Please give your view on this. Thanks


Solution

  • Having the port forwarded for the DHU connection won’t affect the ADB streaming the logcat in another terminal. You can checkout the ADB documentation on how to Connect to a device over Wi-Fi, and use a laptop to connect with since the usb connection will be used on the phone to connect to the car or DHU.

    For the onConnectionCallbacks, those are still functional even when connecting to the DHU. Sounds like it might be a coding issue with registering the connection callback.