Table of Contents
Hey Guys, It’s me SaadMaqsood 🙋🏻♂️, Termux is a terminal emulator and there are a lot of things we can do on it, but those things are just enclosed in an environment, and you can’t access your phone’s other features and peripheral. To solve this issue, we have Termux:api. This simple 2MB application can expose everything your phone has to offer like camera, microphone, clipboard, battery etc to your termux terminal, and you can use commands to control everything. In simple words, Termux:API is a gateway for you to convert your simple termux into a terminal beast 🔥.
What is Termux-API?
After installing the Termux:api on our phone, we can create so many tools to enhance the experience and unlock all the features of the termux. The use of TermuxAPI are endless and it totally depends upon you how much you can wo with these new commands. I have created a termux-call-looper that will call my friend and cut the call in 3 seconds then call again. Next I am gonna use termux:API to access my phones camera and click pictures every few seconds and use my phone as a spycam (Stay ethical brothers).
To install termux API you have to follow few simple steps make sure to follow them carefully.
Step 1 : Download Updated TermuxAPK
Step 2 : Download termux:API APK
Just copy the entire code directly and paste it inside your termux. it will open the termux-api website for you in chrome. Download the apk file and install it in your phone and then go back to termux. ( Read the instructions on the termux )
echo -e “\e[031m” “HEY, MAKE SURE TO INSTALL THE TERMUX API APP THEN COME BACK AGAIN IN TERMUX” && sleep 2 && xdg-open “https://f-droid.org/repo/com.termux.api_51.apk”&& echo -e ‘\e[032m’ ‘HAVE YOU INSATLLED TERMUX API APK? IF YESS THEN PRESS ENTER, IF NO THEN RE-RUN THE SCRIP AND THIS TIME INSTALL THE APK IN YOU PHONE’ && read r && pkg install “termux-api” && exit
After pressing Enter you will be redirected to your chrome or default browser, Just click on Download anyway button.
Now Open the file and install it, it is termux-api apk file.
After the installation is done, just click on done and go back to termux and press enter and everything will be done in few seconds.
Step 3 : Give permissions to the termux API app
How to Use Termux-API?
So to run and test termux:API you have type any termux API based commands to test if everything is properly working or not just type below command.
After Entering this command you will see some information about your phones battery including how much charging is left in your phone. If you want to learn how to [ Click Images Using Termux Command with the help of termux-api ] then read this post. Also here is the list of termux-api commands that you can use play around more with termux-api. [ Termux-api command ]