-1

I want to make an application that automatically clicks the id of a button on another application using flutter.id. I use uiautomatorviewer to get it. But the documentation on how to code automatically click is too little, I can't do it. There are many people. Please help me with your experience

Sample code about autoclick with flutter and uiautomatorviewer

1

1 Answer 1

0

Automating clicks on another application using Flutter directly is not possible due to Flutter's sandboxed environment and the restrictions on interacting with other apps for security reasons. However, you can achieve this using platform-specific automation tools or libraries like uiautomator in Android.

Here’s a general approach to achieve this:

Identify the button ID: Use uiautomatorviewer or similar tools to find the ID or other identifying attributes of the button you want to click in the target application.

Android Integration: Since uiautomator is specific to Android, you'll need to create a platform channel in Flutter to communicate with native Android code.

Implement Native Code: Write a method in Android (using Java/Kotlin) that uses uiautomator to perform the click action on the identified button.

Flutter-to-Native Communication: Set up method channels in Flutter to call the native method that performs the click action.

1
  • can you give me example code .thanks!
    – MINH-HAI
    Commented Jun 26 at 8:37

Not the answer you're looking for? Browse other questions tagged or ask your own question.