I have written a previous that talks about how to speed up the execution of the same type of field-filling operations using . Despite all its advantages, autofill can be accelerated even more with the help of a lower-level bash language and the use of hotkeys. article kotlin script (kts) Choosing an example We will use the same example as in the . last article You can download the full code here: https://gist.github.com/d8b96ef6d97927e811cfa292071d824a https://gist.github.com/6616b63942b3ec90ccf1fb4ad0329953 https://gist.github.com/2c1a7e43b0b2d38c21af75d139e6ac4d Let me remind you that to switch to , the fields must be filled in, and their values must meet certain requirements: MainActivity email: login@gmail.com phone: +1 650 123 4567 password: 123456 Here is a video of how it looks if the fields are filled in manually: https://youtu.be/oX3NIZMYpyo Also in the last article, we found all the necessary to fill in all the text fields and click on the button. Here is the full list: adb commands adb shell input tap 72 1092 adb shell input text 'login@gmail.com' adb shell input tap 72 1227 adb shell input text '+1 650 123 4567' adb shell input tap 72 1362 adb shell input text 123456 adb shell input tap 72 1497 Configuring External Tools for one command Let's try to fill in one line first. To do this, we will use a bunch of tools . External Tools + Adb + bash Let's launch and tap on the field using the terminal: LoginActivity adb shell input tap 72 1092 Everything should work. Next, we go: . Android Studio > Preferences > Tools > External Tools This is a tool that allows you to run commands and external scripts or programs inside . You can also pass arguments there. Android Studio However, there are a number of limitations compared to the terminal. For example, you cannot pass multiple commands. You can read more . here Let’s get into it. Click on the ) icon. Let’s enter the following values: Add (“+” Name: my_adb Program: /Users/{your name}/Library/Android/sdk/platform-tools/adb (insert the entire line) Arguments: adb shell input tap 72 1092 (usually it is added by itself) Working directory: $ProjectFileDir$ Let’s save: Now go to: Tools > External Tools > my_adb \ If everything is done correctly, the terminal window should start and the command will be executed. It is striking that the was executed much faster than . adb command kotlin script Configuring External Tools for multiple consecutive commands We managed to execute one adb command using External Tools. However, the reality is that more often than not it is necessary to enter several consecutive commands. Let's try to achieve this. Let's go back to the command editing window. You can see that you cannot enter more than one command there: This is also indicated by the of Jet Brains official support But, let me remind you that in order to achieve the result, we need to enter a list of commands: adb shell input tap 72 1092 adb shell input text 'login@gmail.com' adb shell input tap 72 1227 adb shell input text '+1 650 123 4567' adb shell input tap 72 1362 adb shell input text 123456 adb shell input tap 72 1497 To achieve this there is a workaround: create a bash script, and insert into it these commands. And through External Tools to run this script. That's what we'll do: Open the text editor Insert the lines there Save as my_bash.bash Run the command chmod +x /Users/{your name}/Downloads/my_bash.bash Insert the path into the terminal and try to execute through it: If everything is done correctly, the command should be executed, and the fields on the device should be filled in. Next, go to . Android Studio > Preferences > Tools > External Tools Creating new command: Name: my_bash (file path) Program: /Users/{your name}/Downloads/my_bash.bash Save Run . Tools > External Tools > my_bash If everything is done correctly, the command should be executed, and the fields on the device should be filled in. In the video it looks something like this: https://youtube.com/shorts/R484DB_RScc?feature=share It can be seen that the fields are filled in much times faster than with manual input. As in the case of the kotlin script, if you need time from the moment you enter one command to another, you can set the sleep delay (sec). adb shell input tap 72 1092 sleep 1 adb shell input text 'login@gmail.com' There is another optimization that can be done — to set hotkeys for a specific command. To do this, go to . Android Studio > Preferences > Keymap > External Tools > External Tools Next, find the command and set hotkeys, for example, in my case . Control+Option+Command+B Save it. Try to execute this and make sure that everything works. This is the second advantage compared to — you can set hotkeys to execute a command. kotlin script Conclusion Small optimizations of frequently repeated operations in the development process lead to long-term savings in time and resources. In the example discussed in , we saved time by automatically filling in authorization fields using , winning several tens of seconds. In the current example, we saved a few more seconds by using a lower-level language and using hotkeys. In a year, the seconds saved will turn into hours. this article kotlin script