Search code examples
androidandroid-emulatormonkeytalk

Connect from MonkeyTalk to Android HEADLESS emulator


Question

Is there a way how to connect to an Android emulator in headless mode?

Problem

I was able to connect. I received from the MonkeyTalk IDE

Connection type set to: Android Emulator or Tethered Device

Which should be fine according to MT documentation.

The problem is I can't play any commands as the buttons are disabled. Hope, it's possible otherwise there is no use for the Continous Integration.

===EDIT===

Ok, so it seems, and it's written in the MT docs, that the app has to be running already. So, how is it possible to open up my app in the headless mode?


Solution

  • Ok, the solution is here.

    1. Install your APK

    adb.exe install -r ${path2urApk}
    

    The -r flag replaces the old apk.

    2. Run the application

    No matter whether the screen is locked or not this works...

    adb shell am start -n your.pakackge/.somewhere.blah.TheActivity
    

    The correct category and activity can be found using logcat: https://stackoverflow.com/a/9077186/1075289