Android shell script tutorial using only android

android shell script kickwe

Android shell script

is our today’s topic and Like always we wont need anything except a rooted android device and a terminal emulator.

There is link of a preferred terminal emulator above. Please download termux first to go ahead.

Lets move into the tutorial:

Open termux and press OK at the welcome screen. In the terminal write:

su

to check if our device is properly rooted and permission is granted. Allow the permission.

android shell grant supersu in termux

android grant supersu in termux

If you are still experiencing root access issue then check this topic :
how to fix termux root access issue

Now write in terminal :

exit

to come back as normal user from super user.

Write :

dir

and press enter to see where you are working and what other files are already there .

Then write:

touch kickwe.sh

this will create an empty file . if you want to recheck your can type “dir” to see what’s new there.

And then write :

nano kickwe.sh

(if it says nano not found , then dont forget to install nano first. You should write : apt install nano)

Now this will appear a blank screen which is actually nano text editor.

android shell script terminal nano

android shell terminal nano

lets make a basic shell script now . As an example of

android shell script

let’s see find out is our current ip address. To perform that , write our shell script :

#!/bin/bash
ifconfig | awk ‘/inet addr/{print substr($2,6)}’

android shell script get ip address

android shell script get ip address

now press CTRL+x (use kick keyboard to have the ctrl key)
then type “y” and press enter.

This will make your returned at the first emulator screen where you were first !

Now finally let’s run our shell script. To execute the shell script in android, type:

sh ./kickwe.sh

here first “.” indicates the current path . and at the current path we already made kickwe.sh

Bingo!

android shell script

android shell script

At our next tutorial we will make a

standalone android shell script with explanation!

Post A Reply

Get KickWe Tutorial on Google PlayX