Android Screencasting using shell scripting.

I am Developer, Artist and trying my luck on blogging as well. Well I am Ambitious, Passionate towards Learning, The Night Owl, And I Like challenges...
Search for a command to run...

I am Developer, Artist and trying my luck on blogging as well. Well I am Ambitious, Passionate towards Learning, The Night Owl, And I Like challenges...
No comments yet. Be the first to comment.
Post #2 in the Complete Prompt Engineering Series Welcome back! In What is Prompt Engineering? A Complete Introduction, you learned what prompt engineering is and why it matters. Now we're going deeper: understanding the engine under the hood. You do...

Welcome to the future of human-AI collaboration. If you're reading this in 2024-2025, you're witnessing a fundamental shift in how humans interact with machines—and prompt engineering is your passport to this new world. The Definition: What Exactly I...
In this post, we’ll walk through the anatomy of a great prompt, illustrate every step with vivid examples, and even peek under the hood to see what happens technically when you hit “send.” By the end, you’ll be able to craft prompts that unlock the f...

What is GenAI and Why Does Prompting Matter? If you’ve ever wondered how people interact with AI tools, or why some folks seem to get exactly what they want from tools like ChatGPT while others receive confusing or generic responses, this article is ...

Let’s be honest—being a developer isn’t just about writing code. It’s about solving problems, dealing with burnout, handling meetings, chasing deadlines, and finding time to learn, debug, and ship. But in the middle of this chaos, one simple habit ca...

2 years ago, We all had a craze of opening a youtube channel for streaming mobile games. I remember playing PUBG a lot those days and wanted to stream my gameplay on my channel. The only hurdle I faced was how can I stream it for free with HD graphic. There were a lot of options that I could have been used. I might have used mobile streaming apps, Emulator with OBS studio, etc. But I choose to code. So, I came up with the Idea of Creating a (.bat) file for windows and a (.sh) file for Linux to Screencast my mobile to my laptop/desktop for streaming my gameplay. But As we know Happiness too has an expiry date. On September 2, 2021, PUBG Mobile was banned in India due to data privacy concerns under Section 69A of the Information Technology Act. Well, Every night has a morning. recently news came BATTLEGROUNDS MOBILE INDIA Pre-Registrations to start from 18th May on Google Play Store. I thought if it gets unbanned then a lot of people will again start their streaming. And Among them, many of them will face the same issue that I faced when I have started streaming. So, Let me tell you my secret of screencasting in this article.
We need to install this in our system, Let's check how to install it on all popular OS.
adb devices
adb devices. If everything was successful, you should now see your device’s serial number in the command prompt (or the PowerShell window).Download the Android SDK Platform Tools ZIP file for Linux. if you are using a Linux machine or Download the Android SDK Platform Tools ZIP file for macOS., if you are on Mac.
./adb devices
./adb devices. If everything was successful, you should now see your device’s serial number in the Terminal window output.Please Download or clone the scrcpy from the github and follow the steps: https://github.com/Genymobile/scrcpy For Windows, for simplicity, prebuilt archives with all the dependencies (including adb) are available:
sudo apt install scrcpy
sudo snap install scrcpy
brew install scrcpy
Andmirror. sh.#!/bin/bash
read -p "Connect Over 1.USB OR 2.WIFI (1/2):" type
if [ $type == 1 ]
then
echo Connecting via USB
else
echo Connecting Over Wifi
#!/bin/bash
read -p "Connect Over 1.USB OR 2.WIFI (1/2):" type
if [ $type == 1 ]
then
echo Connecting via USB
adb devices
echo "***********************************"
echo Intializing Scrcpy...
scrcpy -b15M -m2240
else
echo Connecting Over Wifi
in the above script, We Listed the connected devices and Connected using scrcpy with a bit-rate of 15 Mbps and Max-Size 2240px. You can change this parameter according to your requirement. To know more about it check this GenyMobile Scrcpy repo.
Now let's add the script for Connection Over Wifi.
#!/bin/bash
read -p "Connect Over 1.USB OR 2.WIFI (1/2):" type
if [ $type == 1 ]
then
echo Checking Connected Devices
adb devices
echo Intializing Scrcpy...
scrcpy -b15M -m2240
else
echo Make Sure Your device and this system are in the same network.
echo Please plug your USB device and hit Enter
read var1
echo Checking Connected Devices
adb devices
read -p "Enter the Port number:" Port
adb tcpip $Port
echo Restarting TCPIP in Port $Port
echo Please Unplugged your USB device and hit Enter
read var2
read -p "Enter the IP Address:" IP
echo Connecting $IP:$Port
adb connect $IP:$Port
echo Intializing Scrcpy...
scrcpy -b15M -m2240
fi
adb tcpip $Port to activate the following port.adb connect $IP:$Port to connect with the phone.scrcpy -b15M -m2240 to cast the screen.andmirrior.sh file. It will automatically install everything in your system if your system doesn't have those package installed already. if you have already installed ADB and Scrcpy then just follow the instructions in the terminal.andmirror.bat file from the repo.scrcpy just check this link GenyMobile Scrcpy repo.Hi-IN
If you are comfortable with it please watch it, you will get more clarification in the process.