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

  • Home
  • SEARCH
  • 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 9159635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:32:27+00:00 2026-06-17T13:32:27+00:00

When using uiautomator , takeScreenshot(File storePath) always returns false no matter what parameter I

  • 0

When using uiautomator, takeScreenshot(File storePath) always returns false no matter what parameter I pass in.

I’ve tried to give either new File(dir_name, file_name) or new File(file_name), neither of them works (of course mkdir first if the dir_name doesn’t exist).

Every time it just return false and /data/local/tmp/ on emulator is empty.

BTW, I don’t think it’s a permission problem, since trying the similar dumpWindowHierarchy could generate a dump file there.

Thanks in advance for your help.

  • 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-17T13:32:29+00:00Added an answer on June 17, 2026 at 1:32 pm

    If you are using emulator to run the tests you should turn on “Use Host GPU” in your AVD configuration. After this change it worked for me.

    If you still got a problem you may try screencap. It is command line tool for taking screenshots. It works in both emulator settings. To save screenshot in given path execute:

    Process process = Runtime.getRuntime().exec("screencap <path>");
    process.waitFor();
    

    Use /data/local/tmp to avoid problems with permission. You can use SD Card dir as well. It is asynchronous so wait until process is finished with waitFor(). It will recognize desired output format by extension of provided file.

    Or you can get PNG in InputStream (no need to wait):

    Process process = Runtime.getRuntime().exec("screencap -p");
    InputStream output = new BufferedInputStream(process.getInputStream());
    

    You can omit -p if you wish to get file in JPEG. They JPEG screenshots are bigger, but it takes less time to get them.

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

Sidebar

Related Questions

Using ASIHTTPRequest, I downloaded a zip file containing a folder with several audio files.
I’ve been using the new UI automation tools with Instruments and the iPhone SDK
@using(Html.BeginForm(About, User, FormMethod.Post , new { id=aboutme})) { <fieldset> <ul> <li> <label class=block>About me</label>
I wonder if anyone has tried implementing iOS UIAutomation tests using Typescript. I guess
Using the WPF Grid control is easy when your child elements are always contained
using this code: Java Server side: ... out = new PrintWriter(this.client.getOutputStream(), true); ... public
Using Rails 3, but I guess doesn't matter. I put this in the template
Using C#.NET, i wrote a toolbar which is stored now into toolbar.cs file. I
Using CarrierWave and Amazon S3. CarrierWave config: CarrierWave.configure do |config| config.ensure_multipart_form = false config.permissions
using phpPgAdmin, I've tried to create a table in my database. But am getting

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.