3

I have been using ADB to simulate touch commmands in my application, the plan is to develop a sort of keymapper application that simulates touches in external applications(I don't feel comfortable sharing the app idea in public, despite there already being some similar applications on the play store).

Essentially I use am using adb to input tap commands from my C# code like so:

Runtime r = Runtime.GetRuntime();
Java.Lang.Process p = null;

    try
    {
        p = r.Exec("input tap 900 1900");
    }
    catch (System.Exception e)
    {
        Console.WriteLine(e.Message);
    }

However, it only seems to work in my application (eg: views in my application or the screen area of my app). It does not work on other apps or even on the three buttons on the bottom bar. If I use the terminal provided by visual studio (Open Android Adb Command Prompt), then I am to fire tap commands (adb shell input tap x y) and they work everywhere, including on other apps.

However from my application's code when I fire these tap commands, they do not work.

Could you guys tell me of a way to do this?

P.S. I am using a xamarin.android foreground service to execute these taps on external apps.

0xB01b
  • 318
  • 1
  • 10

0 Answers0