Repository navigation
Capturing Logs
A log shows what failed. You can capture a log in two ways. Option A uses the app and needs no computer. Option B uses adb on a computer. Only Option B also records the Android Auto side of the connection.
- Option A is enough for most problems on the device that runs Open Headunit. Examples are a black screen, bad video, bad audio and a connection that drops.
- Option B is necessary when we must see what Android Auto did. This includes every Self Mode problem and most wireless connection problems.
On Android 13 and newer, an app can read only its own log lines. Thus the export from the app cannot contain the Android Auto lines. Only adb can record them.
If you are not sure, do both options. Do Option A on the device that runs Open Headunit. Do Option B on the phone.
| Your setup | Device that runs Open Headunit | Phone that runs Android Auto |
|---|---|---|
| A head unit or a tablet. The phone connects over WiFi or USB. | Option A | Option B |
| Self Mode. Open Headunit and Android Auto run on the same phone. | Option B on that phone. Add the Open Headunit number in step 4. | The same phone |
Start each capture before you tap the WiFi button or the USB button in Open Headunit. Let the problem continue for approximately one minute. Then stop the capture.
- Open Open Headunit.
- Go to Settings.
- Select the Advanced tab at the top.
- Scroll down to the Debug section.
- Tap Log Level.
- Select Verbose. Do not select Silent, because it stops all logs.
- Tap Start Capturing Logs. The row then shows Stop Capturing Logs.
- Do the steps that cause the problem.
- Immediately after the problem, tap Export Logs. The Logs Exported dialog shows the path of the file.
- Tap Share.
- Send the
HUR_Log_*.txtfile.
Read these two notes before you start:
- Export the log immediately after the problem. The capture holds a maximum of 16 MB. When it is full, the app deletes the oldest lines. An export one hour later can be without the lines of the problem.
- Android can ask you to allow access to the device logs. If it does, allow access in less than 10 seconds. After 10 seconds, the export stops and shows "Failed to export logs".
You can also find Export Logs during projection. Open the Android Auto exit dialog, then go to Quick Settings.
The setup takes approximately 10 minutes and you do it one time. After the setup, a capture needs only a small number of commands.
The capture keeps only the parts of the phone that we need: Android Auto, Bluetooth and WiFi. Thus the file is small, and it does not contain your other apps.
The filter needs Android 12 or newer on the phone. For Android 11 or older, see the end of this page.
Windows:
- Download SDK Platform Tools for Windows from https://developer.android.com/tools/releases/platform-tools.
- Unzip the file to
C:\platform-tools. - Open that folder in File Explorer.
- Click the address bar.
- Type
cmdand push Enter. A Command Prompt window opens in that folder.
macOS: Run brew install --cask android-platform-tools. If you do not use Homebrew, do these steps:
- Download the macOS zip from the same page.
- Unzip the file.
- In Terminal, use
cdto go into the folder.
Linux: On Debian or Ubuntu, run sudo apt install adb. On other distributions, install the equivalent package.
On Windows, do not use PowerShell. PowerShell changes the commands below and saves the file in a format that is hard to search. Type all the commands in the Command Prompt window. On macOS and Linux, type the commands in Terminal.
- Go to Settings -> About phone.
- Tap Build number seven times. The phone then tells you that you are a developer.
- Go to Settings -> System -> Developer options.
- Turn on USB debugging.
-
Connect the phone to the computer with a USB cable.
-
Run this command:
adb devices -
On the phone, a dialog asks you to allow USB debugging from this computer. Select "always allow".
-
Accept the dialog.
The command then shows your phone with the word device. If it shows unauthorized, you did not accept the dialog yet.
Android Auto stops a Self Mode session each time the USB port of the phone changes state. Any cable that you connect or disconnect causes this. This is how Android Auto works, not how the app works. Thus, if you connect the cable during the session, the session that you want to record stops.
Connect the cable before you start Self Mode. Do not touch the cable until the capture is complete.
If the phone has Android 11 or newer, you can use Wireless debugging and no cable. It is in the same Developer options screen:
- Turn on Wireless debugging.
- Tap Pair device with pairing code. The phone shows an IP address, a port and a six digit code.
- On the computer, run
adb pairwith the IP address and port that the phone shows. For example:adb pair 192.168.1.50:37123 - Type the six digit code.
- Look at the main Wireless debugging screen. It shows the IP address and a different port.
- Run
adb connectwith that IP address and port. For example:adb connect 192.168.1.50:41234
Each app on the phone has a number, its user id. The capture uses these numbers to keep only the lines that we need. The Android Auto number is different on each phone.
-
Run this command:
adb shell pm list packages -U com.google.android.projection.gearhead -
The command shows a line like
package:com.google.android.projection.gearhead uid:10234. Write down the number afteruid:. -
Self Mode only: Open Headunit runs on the same phone, so also find its number. Run this command and write down the number after
uid::adb shell pm list packages -U com.andrerinas.headunitrevived
If a command shows nothing, that app is not installed on this phone.
-
Write the second command below with your numbers. Replace
10234with the Android Auto number from step 4. -
Self Mode only: Add the Open Headunit number after the Android Auto number. Use a comma and no spaces, for example
--uid=10234,10456,1000,1002,1010. -
Run the two commands:
adb logcat -c adb logcat -b main -b system -b events -b crash -v threadtime --uid=10234,1000,1002,1010 > phone-log.txtThe first command removes the old lines. The second command starts the capture. The window then shows no change. This is correct, because the command writes to the file.
-
Do the steps that cause the problem.
-
After the problem occurs, wait approximately one minute.
-
Push Ctrl+C. The capture stops.
The numbers after --uid are these. The file gets nothing else from the phone.
| Number | What it is |
|---|---|
| Your number from step 4 | Android Auto. For Self Mode, also Open Headunit. |
1000 |
The Android system. It decides which WiFi network the phone connects to. |
1002 |
Bluetooth |
1010 |
The WiFi helper programs, for example wificond
|
The file phone-log.txt is in the folder where you ran the commands.
- Attach
phone-log.txtto your issue or discussion. - If you also did Option A, attach the Open Headunit log too.
GitHub accepts a maximum of 25 MB for each file. If a file is larger, zip it first.
The filtered log from step 5 contains only Android Auto, the Android system, Bluetooth and WiFi. It still contains these items:
- The names of WiFi networks near you.
- The name of your phone.
- The names of your paired Bluetooth devices.
On Android 11 or older, the log contains all of the phone, and also the names of the apps on it.
If you remove lines by hand, the log becomes useless to us. Attach the log as a file. Do not paste it into a comment. If you do not want to share this data, do not send the log.
-
adb devicesshows no device. Change the USB mode of the phone from "Charging" to File transfer. On Windows, also install the Google USB Driver or the USB driver from the maker of your phone. -
adb devicesshowsunauthorized. You did not accept the dialog on the phone. Do these steps:- Run
adb kill-server. - Disconnect the cable.
- Connect the cable again.
- Accept the dialog on the phone.
- Run
-
adb devicesshowsoffline. Disconnect the cable and connect it again. Then runadb devicesagain. -
logcatdoes not accept--uid. The filter needs Android 12 or newer. On an older phone, use this command in step 5 instead:adb logcat -b main -b system -b events -v threadtime > phone-log.txt -
pm list packages -Ushows nouid:. Run this command, and use the number afteruserId=:adb shell "dumpsys package com.google.android.projection.gearhead | grep -m1 userId" -
The file is empty or almost empty. Do these checks:
- Make sure that the Android Auto number is in
--uid, with commas and no spaces. - Make sure that you used Command Prompt, not PowerShell.
Some ROMs from device makers also limit the log service. This occurs mostly on old phones and head units. The cause is the device, not the app, and the app cannot prevent it.
- Make sure that the Android Auto number is in