Technology Forum Has Moved!

The FIRST Tech Challenge Technology forum has moved to a new location! Please take a look at our forum blog for links and instructions on how to access the new forum.

The official blog of the FIRST Tech Challenge - a STEM robotics programs for students grades 7-12.

Note that volunteers (except for FTA/WTA/CSA will still access their role specific forum through this site. The blog also outlines how to access the volunteer forums.
See more
See less

adb debugging

  • Filter
  • Time
  • Show
Clear All
new posts

  • adb debugging

    I am new to Android debugging. Does anybody know if System.out.print will output to logcat? If so, is there a way to redirect the logcat stream to my own console terminal program? I read a little about logcat and it seems the phone side (Robot Controller) has open two TCP ports: 5555 being the adb port and 5554 being the "console port". What is this console port? Is this a serial terminal stream? If so, can a network terminal tool open this console port and receive the logcat stream? Logcat stream is quite noisy, I would like to filter out stuff and only see the debug output I put out. I have a network terminal tool that supports ANSI escape sequence (i.e. it supports color font). So if my debug output prefixed with these ANSI escape sequences, my output will be a different color which makes it easier to spot. I also notice the logcat stream from within Android studio will sometimes change color. Does it mean I can achieve the same thing without my special network terminal tool? If so, how?

  • #2
    Logcat natively supports filtering, checkout its developer docs.


    • #3
      System.out.print does not print to Logcat. You have to use the Android logging API, here are some instructions.


      • #4
        as it happens, for another project, I was just trying System.out.print on an Android device and it did show up in the Android Studio console among logcat messages...
        I have yet to confirm this on a Speed phone.
        That said, I agree that the Android logging API is anyway a better bet.
        Martin Haeberli
        Mentor, Team 7593 TigerBots


        • #5
          You can try Android's Log API. You can use Log.i(String TAG, String message);
          Vinay Jagan,
          Techie Titans FTC Team #9901


          • #6
            I tried this on the ZTE Speed -
            System.out.println("Hello BlinkOp");
            resulted in
            10-22 17:09:06.201 12032-13285/com.qualcomm.ftcrobotcontroller I/System.out: Hello BlinkOp