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 514049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:29:04+00:00 2026-05-13T07:29:04+00:00

I am working on a remote automated test framework for Android based on JUnit

  • 0

I am working on a remote automated test framework for Android based on JUnit (tests run outside android, interacting with code inside it). It’s all working fairly well, but one issue I have is that when I automatically start a fresh emulator, the screen starts out locked. This appears to affect my tests being able to run, plus, I want to watch the tests run (buttons clicked, text typed, etc.). If I manually start an emulator and unlock its screen, all works well.

Is there a way to programmatically unlock the screen in Android? A Java API, a command line or shell command, etc. would all be fine. Barring that, perhaps there is a way to start an emulator unlocked?

  • 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-05-13T07:29:04+00:00Added an answer on May 13, 2026 at 7:29 am

    You can interact with the emulator via its console interface.

    If you ever wondered why your emulator started with a number like 5554 – that’s because that’s the port the emulator listening on.

    You can find the port for running emulators with the adb devices command. It will have output like this:

    C:\>adb devices
    List of devices attached
    emulator-5554   device
    

    So you can connect to the emulator using a command like:

    telnet localhost 5554
    

    If you connect successfully you’ll get an OK prompt and you can start entering commands.

    There are various commands but the one we are interested in is event to simulate hardware events. We can unlock the screen by pressing Menu which we emulate with the following command:

    event send EV_KEY:KEY_MENU:1 EV_KEY:KEY_MENU:0
    

    The EV_KEY:KEY_MENU:1 is key-down event and the EV_KEY:KEY_MENU:0 is the corresponding key-up event. Make sure you do both or the Menu key will be stuck down.

    I realise scripting this will be far from easy, but it’s all I can think of to solve your problem.

    Edit: I don’t think event send EV_KEY:KEY_MENU:1 EV_KEY:KEY_MENU:0 is emulating Menu but if I run the command just after I’ve started the emulator it does unlock it. Not sure why but I guess this is a start.

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

Sidebar

Ask A Question

Stats

  • Questions 498k
  • Answers 498k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Use the JSONObject // Get some JSON from wherever String… May 16, 2026 at 12:23 pm
  • Editorial Team
    Editorial Team added an answer Let's call the radius in x, y, and z rx,… May 16, 2026 at 12:23 pm
  • Editorial Team
    Editorial Team added an answer You're in luck. The functionality you described is baked into… May 16, 2026 at 12:23 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I am working on some code that previously was using a cfquery, and is
I'm looking into extending some code that handles automatic opening and reading of Excel
I was working with a friend on a project, and he edited a bunch
One of my friend is working on issue related to updating expired digital certificates.
I wrote an automated donations system for someone, so that people who play on
I'm currently working with on a fat client application using a self written RMI
I have 2 databases, one on local server and one on a remote server.
I need to make a graphic interface in Lazarus from which I run miscelaneous
I'm working on a script that will submit form files (images) through a temporary
I'm working on a routine to strip block or line comments from some C#

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.