Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8376933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:32:46+00:00 2026-06-09T15:32:46+00:00

I am working on a tool to identify widgets within an android app, and

  • 0

I am working on a tool to identify widgets within an android app, and display their properties when clicked upon. I have created a standalone tool that can successfully do this, but I am having issues in converting the standalone tool into an eclipse plugin, which will be necessary to package into our final product.

The way that the tool operates is that first, a transparent overlay application is run on the emulator. This application gathers the coordinate of a screen press by the user and writes it to the Android log. Then, the application to be tested is started on the emulator.

Adb logcat is piped as standard input into a monkeyrunner script which handles the widget identification. In real time, the monkeyrunner script parses the logcat input for the coordinate press information. The monkeyrunner script uses AndroidViewClient (https://github.com/dtmilano/AndroidViewClient ), a tool which can list all of the View objects on a screen and their properties. Using the coordinate press information, the View from the list of Views which has the correct coordinate properties is singled out, and its properties are printed out.

The issue(s) that I am having stem from attempting to handle the piping of logcat output to the monkeyrunner script within the context of eclipse/java. If I run adb logcat and monkeyrunner in separate, concurrent processes, and transfer logcat’s InputStream to monkeyrunner’s OutputStream, there seems to be some locking issue, as monkeyrunner never receives the coordinate information as input. I tried putting the stream handlers in separate threads as well, but this had no effect.

Since concurrent processes can sometimes be a source of problems, I thought to read from logcat directly within monkeyrunner, thereby only having one main process. Within monkeyrunner, once a connection is established with the emulator, it is possible to open an adb shell on it (https://developer.android.com/tools/help/MonkeyDevice.html#shell). Logcat is a pretty common adb command, but when I run device.shell(“logcat”), it fails with

    [main] [com.android.chimpchat.adb.AdbChimpDevice] Error executing command: logcat

and

    [main] [com.android.chimpchat.adb.AdbChimpDevice]com.android.ddmlib.ShellCommandUnrespo‌​nsiveException – 

Unfortunately, my google skills have not been able to find me a solution to this problem.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T15:32:47+00:00Added an answer on June 9, 2026 at 3:32 pm

    Well, I guess this is what you are looking for:

    #! /usr/bin/env monkeyrunner
    import time
    import subprocess
    
    # Imports the monkeyrunner modules
    from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice, MonkeyImage
    
    # Connects to the current device, returning a MonkeyDevice object
    device = MonkeyRunner.waitForConnection()
    
    p = subprocess.Popen([ "adb", "logcat", "TEST:V", "*:S" ], shell=False,
            stdout=subprocess.PIPE)
    i = 0
    while True:
        device.shell("log -t TEST This is line %d" % i)
        i += 1
        print p.stdout.readline()
        time.sleep(1)
    

    a monkeyrunner script that connects to the device, writes and also reads the logcat.

    BTW, I’m glad to hear you found AndroidViewClient useful.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a working file rename java tool, now I want to add an
I am working on a tool that lists a number of properties of an
I am working on an idea wherein I have to identify lines in a
Am currently working on a tool created by a colleague of mine and would
I am working on tool to optimize linq to sql queries. Basically it intercepts
I working on test tool, reporting for it. SO, there is a test hich
I'm working on a tool that needs to get the current user's wallpaper path.
I am working on a tool that monitors a number of applications and ensures
I am currently working on a tool and writing it in MVC SPA (single
I'm currently working on a tool that has a tabbed section that toggles width

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.