# How can I see console errors on a phone?

**URL:** <https://forum.communityhealthtoolkit.org/t/how-can-i-see-console-errors-on-a-phone/85>\
**Category:** Technical Support\
**Tags:** debug, mobile, error\
**Created:** [September 30, 2016, 6:01am UTC](https://forum.communityhealthtoolkit.org/t/how-can-i-see-console-errors-on-a-phone/85 "2016-09-30T06:01:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![medicbot](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/medicbot/32/32_2.png) [@medicbot](https://forum.communityhealthtoolkit.org/u/medicbot)\
**Post date:** [September 30, 2016, 6:01am UTC](https://forum.communityhealthtoolkit.org/t/how-can-i-see-console-errors-on-a-phone/85/1 "2016-09-30T06:01:00Z")

</div>

**Imported Question** by [estelle](http://medicmobile.cloud.answerhub.com/users/11/estelle.html) · [Sep 30, 2016 at 09:41 AM](http://medicmobile.cloud.answerhub.com/questions/177/how-to-see-console-errors-on-a-phone.html)

If the app is not working on my phone, how can I get more info about what is wrong?

---

<div class="post-metadata">

**Author:** ![gareth](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/gareth/32/62_2.png) [@gareth](https://forum.communityhealthtoolkit.org/u/gareth)\
**Post date:** [July 16, 2019, 10:54pm UTC](https://forum.communityhealthtoolkit.org/t/how-can-i-see-console-errors-on-a-phone/85/2 "2019-07-16T22:54:59Z")

</div>

To see the console errors on a phone, follow [these instructions](https://developers.google.com/web/tools/chrome-devtools/debug/remote-debugging/remote-debugging?hl=en), up to selecting your device.

Then select MedicMobile’s WebView in the list (you need to have MedicMobile app open and running in the foreground), by clicking “inspect”!

 ![a](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/1X/673e6a1a44e7a00a8a3184e19758258f992c713a.png)

This opens the DevTools.

Click the “Console” tab in the DevTools. Errors should be there.

![b](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/1X/c7c2add41299c0907890bdf7c562fe59fa1fffb2.png)

---

<div class="post-metadata">

**Author:** ![mrsarm](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/mrsarm/32/556_2.png) [@mrsarm](https://forum.communityhealthtoolkit.org/u/mrsarm)\
**Post date:** [September 28, 2021, 10:03pm UTC](https://forum.communityhealthtoolkit.org/t/how-can-i-see-console-errors-on-a-phone/85/3 "2021-09-28T22:03:31Z")

</div>

A simpler way having Java and the Android SDK installed (Android Studio is not required) is to see the logs from Logcat, the logging system from Android.

Both logs from the Java code of the app and logs from the Javascript code of the Webapp (CHT-Core) are shown.

Connect the phone to the computer where is installed the SDK, and execute within the command line:

```auto
$ adb logcat MedicMobile:V AndroidRuntime:E '*:S'

```

**NOTE** : you have to have configured your phone in debug mode, and have previously linked your phone with your [development environment](https://github.com/medic/cht-android/#development). if you have the source code of the cht-android app, you can just execute instead:

```auto
$ make logs

```

---

<div class="post-metadata">

**Author:** ![jkuester](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/jkuester/32/806_2.png) [@jkuester](https://forum.communityhealthtoolkit.org/u/jkuester)\
**Post date:** [September 29, 2021, 3:59pm UTC](https://forum.communityhealthtoolkit.org/t/how-can-i-see-console-errors-on-a-phone/85/4 "2021-09-29T15:59:42Z")

</div>

> [@mrsarm](#):
>
> ```auto
> $ adb logcat MedicMobile:V AndroidRuntime:E '*:S'
> 
> ```

@mrsarm where should I see the logs after running this? I have run the `unbranded_testXwalkDebug` variant on my device from AndroidStudio and then (with the device still connected) I ran that command and got this output:

```auto
$ adb logcat MedicMobile:V AndroidRuntime:E '*:S'
--------- beginning of crash
--------- beginning of system
--------- beginning of main

```

The process continues running in the terminal, but I do not see any logging there (or any extra looking in the Android Studio `Run` pane).

---

<div class="post-metadata">

**Author:** ![jkuester](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/jkuester/32/806_2.png) [@jkuester](https://forum.communityhealthtoolkit.org/u/jkuester)\
**Post date:** [September 29, 2021, 4:02pm UTC](https://forum.communityhealthtoolkit.org/t/how-can-i-see-console-errors-on-a-phone/85/5 "2021-09-29T16:02:57Z")

</div>

Also, just want to note for the record that the DevTools method that Gareth mentions above does not work if you are trying to use a modern version of Chrome to get the logs for the `Xwalk` variant. However, I was able to successfully use the DevTools from Chromium `75.0.3770.100` to get the logs.

---

<div class="post-metadata">

**Author:** ![mrsarm](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/mrsarm/32/556_2.png) [@mrsarm](https://forum.communityhealthtoolkit.org/u/mrsarm)\
**Post date:** [September 29, 2021, 6:25pm UTC](https://forum.communityhealthtoolkit.org/t/how-can-i-see-console-errors-on-a-phone/85/6 "2021-09-29T18:25:11Z")

</div>

Thanks @jkuester , and I’m posting here other findings that you an me got after talk through other channels.

First, if the logcat command suggested above doesn’t work, might be that the output format is different. So worth to try instead:

```auto
adb logcat MedicMobile:V AndroidRuntime:E chromium:V '*:S'

```

Or a simpler solution could be get all the logs and filter out with `grep`:

```auto
adb logcat | grep MedicMobile

```

If you still don’t see anything, worth to check the phone and `adb` are in sync, so check that your phone is listed when executing `adb devices`. If so, also check that your are able to see all the logs of your phone with `adb logcat`.
