![]() "executablePath": "/Users/florent/Workspace/scripts/mtmr/adb-shake.sh", # => /Users/florent/Workspace/scripts/mtmr/adb-shake.sh Get the absolute path of your script with: Don't forget to give yourself the right to execute the script: Now let's add the script to the custom button. Users/florent/Library/Android/sdk/platform-tools/adb shell input keyevent 82 Then create the script file ( we will name it adb-shake.sh in this example) and finally add the following code inside the file. In your favorite shell, go to the directory where you want to add your Touch Bar scripts. Then we will transform the button into a dynamic one to show it only when a phone is connected to the computer.First, we will export the adb command into a shell script file.You should now have a bar looking like this : So what is the difference between a built-in button and static button? With a static button you can now define the action to execute with a script instead of using a pre-defined action.Īdd the code next to the "exit" button we added earlier and save the file. "inline": "do shell script \"/Users/florent/Library/Android/sdk/platform-tools/adb shell input keyevent 82\"" We will begin with a static button, and improve it later: To check if the installation is correct, please enter the following command in a terminal window: ++pre>++code>brew cask install android-platform-tools You will need to have the Android Debugger Bridge (adb) installed on your computer to be able to create the button. Let's build a button to call this action from your customized touch bar! In the first part of this article, I wrote about the command to mock the shake action for the android debugger:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |