[APP][2.2+] Remote ADB Shell - Android Apps and Games

Overview
Remote ADB Shell is a simple terminal app that allows you to connect to the ADB shell service of another Android device over the network. This works in the exact same way that the "adb shell" command works on a computer. Because this app uses a native implementation of the ADB protocol in Java, it does not require root on either device or any 3rd party apps on the target device. The devices simply speak the same protocol to each other that they would to a computer running the ADB client from the Android SDK.
Features
Command history (accessible by long pressing the command box)
Send Ctrl+C (accessible by long pressing the terminal view)
Auto-scroll (with toggle accessible by long pressing the terminal view)
Screenshots
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Instructions
IMPORTANT: Android 4.2.2+ devices use RSA keys to authenticate the ADB connection. These devices will need to be plugged in to a computer the first time you connect to them (from each device with this app installed). This allows them to display the public key acceptance dialog, which you must accept (and check "Always allow from this computer").
To configure a stock un-rooted target, plug the target device into a computer and run "adb tcpip 5555". This will start ADB listening on port 5555 on the target device. The device can then be unplugged and will remain configured properly until reboot.
For devices that are rooted (although it's not required), you can install one of the several "ADB WiFi" apps to enable the ADB server to listen over the network. Devices with a custom ROM may have an option to enable ADB over the network in the Developer Options pane of Settings. Using either of these methods will properly configure ADB for network access with this app. The extra step for 4.2.2+ is still required for the initial connection.
To connect to your remote Android device, type in the IP address of the device and the port number (5555 from the example above) in Remote ADB Shell. Tap Connect and it will attempt to connect to the device and start up the terminal.
Notes
This app is unique because it runs a custom ADB implementation that I wrote from scratch in Java. I plan to open-source my ADB implementation on GitHub or Google Code once I give it a bit of cleanup and documentation. Using this custom ADB implementation means that I don't require an ADB binary or root on the device running the app. Because it speaks standard ADB, it doesn't require anything special on the target either.
Please post feature requests or suggestions here and I'll do my best to work on them.
Download
The app is available on Google Play for free. https://play.google.com/store/apps/details?id=com.cgutman.androidremotedebugger

Hi, cgutman - I actually have a feature request.
But first, let me say thank you for providing this featureset in an app I already have gotten a fair amount of use out of it.
Backstory:
I use adb shell commands to automate repetitive processes on a Fire TV (Android Settop Box, connected to a TV, runs apps), like launching certain apps, performing certain actions - and so on.
I actually have about 20 actions across multiple Applescript apps on the Mac that allow me to remote controll apps like Spotify or Pandora - and your app allows me to do that from an Android device (smartphone) as well.
That said - I run into two major speedbumps.
Without a "Bookmarks" feature (store a certain shell script, give it a name, be able to edit it, execute it on click), so far I can only effectively cycle through two scripts (using the "recent history" feature in your app) - and I'd like to be able to use 20+ scripts eventually. A bookmark list (sorted by name) would be great for my purpose.
Second - to really be able to speed up the use of those items a launcher shortcut feature would be great. It could look up and reference the bookmark entries from the suggestion above - or let you set an IP and enter a command in the shortcut dialogue (Terminal Emulator does it that way). Maybe even with an auto exit option (although "&& exit" works just as well right now (*yay*) - but people would have to know to use it). Also it should allow you to name the shortcut, before creating it.
The reason why this would be great is to reduce steps. Right now I have to open the app, connect to the remote Android device, longpress on the command line entry field, select a history item, press enter - press OK once the app has finished the script, then exit the app.
It would be great to be able to automate all of this down to one launcher shortcut click.
To give you an Idea - what I am using the app for currently - here is one of the scripts I wrote today:
Code:
monkey -p com.netease.cloudmusic 1 && sleep 5 && input tap 960 978 && sleep 0.8 && input keyevent 19 && input keyevent 19 && input keyevent 19 && sleep 0.3 && input keyevent 20 && input keyevent 20 && input keyevent 20 && sleep 0.3 && input tap 50 960 && sleep 0.8 && exit
This opens the netease app and starts the "daily recommended" playlist.
Code:
input tap 60 100 && sleep 0.8 && input tap 60 100 && sleep 0.8 && input tap 60 100 && sleep 0.8 && input tap 1444 1030 && sleep 0.8 && exit
This exits the app cleanly - and so on...
Again - I've set up dozens of scripts like that on my Mac to be able to navigate Pandora, and spotify - to pull files, make screenshots, and so on and so forth. If you could implement said features (again - Terminal Emulator has them.. ) - your app would allow me to realize the same functionality on my smartphone.
Thank you for reading through my posting and contemplating the idea -
so long
h.
edit: Also thank you for already exiting the session cleanly (adb disconnect) once you type in exit. The Fire TV only allows one adb session at a time, so this is great.

Found a way to make the app a little more usable "as is" for my purposes in the meantime. Part of my problem was, that the shell scripts turned out quite complex - so I couldnt run several of them - because they weren't instantly recognizable on the run history level.
The temporary workaround for me was to move the commands as shell scripts to a folder (I named "shell") in /system on the target device and make them executable. That way the history in Remote ADB Shell stays cleaner and is better parseable by humans.
This is what it looks like now:
http://i.imgur.com/AuGFZ0a.png

Just right. Thank you.

Love this app! However I would like to ask if it were possible to send adb commands from outside the app using apps like Tasker. This could already simply be done by sending your app and intent with the ip, port and command.

I just created a Tasker Plugin myself using the AdbLib library! Have a look if you like https://play.google.com/store/apps/details?id=com.ADBPlugin

Trying to connect to my phone but I am not getting device authorization messages.

Great application, thank you.
My task:
- - the device has no Root
- in the directory / tmp there is a binary file su and SuperSU.apк for this device
- How to launch an "adb root shell tcpip:5555" using your application on the this device?
may be:?
1) adb tcpip:5555
2) adb root
3) adb tcpip:5555
4) adb remount
5) "adb shell"
6) or without "adb shell" -> adb pull ... adb pushh... adb reboot...
This is possible?
Or is this impossible in principle?

I'm having trouble installing apk's with this. The normal command that I use on Windows doesn't seem to work...
Could it be having trouble finding the file on my phone while trying to send it to my fire stick?

Kranium31 said:
I'm having trouble installing apk's with this. The normal command that I use on Windows doesn't seem to work...
Could it be having trouble finding the file on my phone while trying to send it to my fire stick?
Click to expand...
Click to collapse
You can't, it's just "adb shell" commands (where you leave out the adb shell part), not "adb install" for instance.
---------- Post added at 12:23 AM ---------- Previous post was at 12:20 AM ----------
AS2107 said:
Great application, thank you.
My task:
- - the device has no Root
- in the directory / tmp there is a binary file su and SuperSU.apк for this device
- How to launch an "adb root shell tcpip:5555" using your application on the this device?
may be:?
1) adb tcpip:5555
2) adb root
3) adb tcpip:5555
4) adb remount
5) "adb shell"
6) or without "adb shell" -> adb pull ... adb pushh... adb reboot...
This is possible?
Or is this impossible in principle?
Click to expand...
Click to collapse
The app only connects via "adb shell", so only those commands are possible, so no "adb install", "adb tcpip" or whatever. It's like typing "adb shell" on a PC and then you're able to give direct commands to the phone like moving a file with "mv /sdcard/Download/file /sdcard"

Hello I am having an issue
I want to use the adb on my own device (meaning only one device is being used)
I am able to connect the adb shell but whenever I try to type the following command it gives the error adb not found
adb shell sh /sdcard/.chaozhuo.gameassistan2/inject.sh
If anyone knows what the issue is Plz help
Thanks in advance

I just bought a 2019 Nvidia Pro. I installed your Wolf Launch and was attempting to install a widget. A prompt appears and states my device doesn't support a widget and have to run an ADB shell. Troypoint has an app for a remote adb shell as so do others, but I cannot find one for a nvidia.
In the widget binding failure the code it is telling me to type is, appwidget grantbind --package com.wolf.firelauncher --user 0
I was all set to do this but the firelauncher gave me pause. The device I am attempting this on isa 2019 Nvidia Pro v.9.0.1 + hotfix 1
need confirmation this is the correct code for my device.
Thanks,

Related

Super User - Cracked Screen

Hi, I have a BIG Optimus 2X, but i got a crack on the screen from left to right in the middle of the screen and i can only use the top half of the screen. I have managed to use nvflash to remove my custom rom and install the original rom.
As i am waiting my company to give me the instructions to get the phone repaired, I began to wonder if there is a way to use the phone without using the touch-screen.
Surfing the web i found Droid VNC Server and i managed to install it and to START it via ADB
the command to start it via ADB is the following one:
# am start -a android.intent.action.MAIN -n org.onaips.vnc/org.onaips.vnc.Mai
nActivity
well now i have it on the screen of my phone, and i am able to select start, becouse it is just up the crack, but Superuser acces is asked, and i am unable to accept and grant SU acess.
So my question is:
Is there a way to give SU permissions to vnc server via ADB? or is there a table or a file in where su has granted and denied software ?
Thanks in advance.
A possible way to launch vnc server :
(tested on a broken screen nexus S)
(droid VNC server must be installed (can be done via play store))
(I haven't any su issues with this method)
1: set execution right (this has to be to done only once) :
Code:
adb.exe shell chmod 766 /data/data/org.onaips.vnc/files/androidvncserver
2: manualy launch the executable :
Code:
adb.exe shell /data/data/org.onaips.vnc/files/androidvncserver
3: from an other window set port forwarding :
Code:
adb.exe forward tcp:5901 tcp:5901
4: from PC launch your favorite vnc viewer

[GUIDE]All About ANDROID SDK/AVD {Install/AVDs/Root/ADB}

ALL ABOUT ANDROID SOFTWARE DEVELOPMENT KIT\ANDROID VIRTUAL DEVICE(SDK\AVD)​
What we are going to learn?
What is Android SDK?
Installing SDK
Creating and Managing AVDs
Configuring ADB on your Computer
Root your Android Emulator
Thats It!
Part 1 - What is Android SDK?
​
Android Software Development Kit (abbreviation Android SDK) is an application which allows users to run and manage Virtual Android Emulator.
The Android Software Development Kit (SDK) includes a comprehensive set of development tools. These include a debugger, libraries, a handset emulator based on QEMU, documentation, sample code, and tutorials. Currently supported development platforms include computers running Linux (any modern desktop Linux distribution), Mac OS X 10.5.8 or later, Windows XP or later. The officially supported integrated development environment (IDE) is Eclipse using the Android Development Tools (ADT) Plugin, though IntelliJ IDEA IDE (all editions) fully supports Android development out of the box, and NetBeans IDE also supports Android development via a plugin. Additionally, developers may use any text editor to edit Java and XML files, then use command line tools (Java Development Kit and Apache Ant are required) to create, build and debug Android applications as well as control attached Android devices (e.g., triggering a reboot, installing software package(s) remotely).
Enhancements to Android's SDK go hand in hand with the overall Android platform development. The SDK also supports older versions of the Android platform in case developers wish to target their applications at older devices. Development tools are downloadable components, so after one has downloaded the latest version and platform, older platforms and tools can also be downloaded for compatibility testing.
Android applications are packaged in .apk format and stored under /data/app folder on the Android OS (the folder is accessible only to the root user for security reasons). APK package contains .dex files (compiled byte code files called Dalvik executables), resource files, etc.
Source :- Wikipedia
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Click to expand...
Click to collapse
Part 2 - Installing SDK and AVD Manager​
Make sure you have JAVA Installed.....otherwise NOTHING will work...
WINDOWS
1. Download the SDK setup from here > http://developer.android.com/sdk/index.html
2. Install the SDK and choose a short directory to install (C:\....).
3. After you have installed your SDK, Open It and Check Mark the following package :- Tools
4. Wait for it to Download...It will take some time...Be patient...
Click to expand...
Click to collapse
MAC
Go here to get a guide on HOW TO INSTALL SDK ON MAC
Click to expand...
Click to collapse
Here is a video Guide too
Click to expand...
Click to collapse
LINUX
Go here to get a guide on HOW TO INSTALL SDK ON LINUX
Click to expand...
Click to collapse
Part 3 - Creating and Managing AVDs​
1. Go to your android-sdk directory and start/run "SDK Manager.exe"
2. Select the platform that you want to download.
3. Click on "Install X Packages" where "X" is the no. of packages you have selected to download.
4. After downloading has finished which will take around 30 minutes on a descent speed internet select "Tools" from the Main Menu bar
at the top of the window and select Manage AVDs..........
5. A New window will open which is the AVD MANAGER.
6. In the Android Virtual Devices tab SELECT "New" to create a new AVD.
7. Enter the following things:
AVD NAME: Type the desired name that you want for your AVD
Device: Select the AVD resolution as per the device options
Target: Select the Android version you downloaded
CPU/ABI: Select Intel Atom (x86) for 32-bit and ARM (armeabi-v7) for 64-bit.
Keyboard: Check this box if you want to use your keyboard in the AVD
Skin: Check this box if you want to get the hardware buttons
Front Camera: Use this option if you have a webcam and want to use it in the AVD
Back Camera: Use this option if you have a webcam and want to use it in the AVD
Memory Options
RAM: Set this to 768 (maximum for Windows user) or 1024 (maximum for Ubuntu users
VM Heap: Set this to 100
Internel Storage: Set this to 4 and Select "GiB" from this drop down list from side by.
SD Card: Select "Size" and Enter 4 and Select "GiB" from this drop down list from side by.
Emulation Options
Snapshot: Just check mark this option. (Not really neccessary)
Use Host GPU: Check mark this option if you want to use the computers graphics.
*****NOTE: REMEMBER THESE TWO OPTIONS ("SNAPSHOT" and "USE HOST GPU") CANNOT BE USED SIMULTANEOUSLY. IT WILL GIVE YOU AN ERROR.*****
7. Now click OK and wait for few seconds. It will come up with a dialog box which will show you the details of the AVD you created and a message that your AVD has been created.
8. Running the AVD
Highlight the AVD you have created and click "Start..." on the left of the window.
and ENJOYYYY......
Click to expand...
Click to collapse
Part 4 - Configuring ADB on your Computer​
Configuring ADB (Android Debug Bridge) on your Windows allows you to run adb from anywhere. Hence you always do not have to "cd" to the android-sdk directory.
1. Right click on "My Computer" and select "Properties".
2. Go to "Advanced system settings" and open "Environment Variables".
3. Now under System Variables, click "New"
and enter the following details:-
Variable name: Type in ADB.....
Variable Value: Type here the path of your ADB preceeded by a ";" (SEMI-COLON)
FOR EG: If the path to your ADB is (by default) "C:\Program Files\Android\android-sdk\platform-tools\adb.exe"
THEN YOUR variable path would be :" ;C:\Program Files\Android\android-sdk\platform-tools\adb.exe "
AND CLICK "OK".....
4. After having done with this Search for "Path" in System Variables.
5. Double click on it to edit "Variable Value" and add these lines at the end of it:-
;<PATH_TO_YOUR_ADB> where "<PATH_TO_YOUR_ADB>" is the directory where your ADB is located.
6. Save all these changes by clicking "OK".... and you are done .........
NOW YOU CAN TYPE "adb" ANYWHERE IN CMD AND IT WILL RECOGNIZE IT AS A PROGRAM....
Click to expand...
Click to collapse
Part 5 - Root Your Android Emulator​
Want to get more fun on your Android Emulator.....
GET IT ROOTED....
NOTE: YOU MUST HAVE ADB CONFIGURED....... I HAVE TESTED THIS ROOTING METHOD ON API LEVEL 16 ( JELLY BEAN 4.1.2) AND IT WORKS ABSOLUTELY FINE NOT SURE ABOUT OTHERS.....
1. Download the ROOT package from here.
2. Extract the package to somewhere like desktop.
3. Browse to your android-sdk/tools directory and Hold Shift and then right click to get an Advanced Menu. Click on "Open Command Window Here" and type the following command:-
Code:
emulator -avd <YOUR_AVD_NAME> -partition-size 512
NOTE:- DO NOT CLOSE THE COMMAND PROMPT WINDOW OTHERWISE THE EMULATOR WILL CLOSE
4. Now go to Desktop and again hold Shift and right click and Select "Open Command Window Here" and type the following commands one by one:-
Code:
adb connect 127.0.0.1:5554
adb root
adb remount
adb push Superuser.apk /system/app/
adb push su /system/bin/su
adb push su /system/sbin/su
adb push su /system/xbin/su
adb shell chmod 6755 /system/bin/su
adb shell chmod 6755 /system/sbin/su
adb shell chmod 6755 /system/xbin/su
adb kill-server
adb start-server
YOHO............... We are now rooted haha
Click to expand...
Click to collapse
Want to know anything more....Just post it here.....and I'll help you back.... ​
Have I missed something....Please remind me....
Hi
Thanks for this, exactly what i was looking for.
But I find that after I have expanded the /system partition when i restart the AVD it starts with a 211M sized partition. unless i start it from the command line.
Is there any way to change the ini file or the avd manager to start it with 512M /system ?
Also the SU didn't work, I had to grab one of my working phone.. (there was a hex error code)
/system/bin/sh: /system/xbin/su: not executable: magic 7F45
actually spoke way to early no I find the /system partition doesn't save a cross reboots
last edit.
found http://www.ehalm.at/avd-4.3-gapps.php?l=en
has a pre built 4.3 system img with all the goodies installed
Hello and thanks for your OP.
Do you have the binaries for Intel? Intel emulators being way faster, I'd rather root an intel AVD than use ARM.
Also, is there a way to make SU survive reboots? It's very annoying to have to repeat those steps each time.
error: device not found
Thanks for this guide. Had me thinking of how to connect a AVD to adb since there is no USB to physically plug in.
I did try the loopback address, with the right port, but that is as far as I have got:
Code:
[email protected]:~/Build/android-sdk-linux/tools$ sudo adb connect 127.0.0.1:5554
[sudo] password for joel:
connected to 127.0.0.1:5554
[email protected]:~/Build/android-sdk-linux/tools$ sudo adb root
error: device not found
[email protected]:~/Build/android-sdk-linux/tools$ sudo adb devices
List of devices attached
[email protected]:~/Build/android-sdk-linux/tools$
Is there anything I am doing wrong? I know your guide (mostly) is for windows, but it would seem strange for me to emulate Android in an emulated Windows environment (running Debian GNU/Linux v7).
UPDATE: Figured it out, once I used the ./adb command in platform-tools.

[WIP][GUIDE] Adb beginner to Pro[In-Depth]

A thanks here would be highly appreciated :good::good::good:
Any developing you take with Android you need ADB its the acronym fo Android Debugging Bridge
Today I am going to show you how to use Adb , how to build it , how to play with its source
Beginner ​Lets introduce to you adb
Think adb as your messenger ,
You type a message / command
Then that message is taken by adb and delivered to the phone
the phone client would execute or perform any necessary tasks
Installing Adb
HOW TO INSTALL ADB [Linux]
On Ubunutu
Code:
sudo apt-get install android-tools-adb android-tools-fastboot
{I Need more distro's command if you know please contact me}
HOW TO INSTALL ADB ON WINDOWS
http://forum.xda-developers.com/showthread.php?p=48915118
Lets Now play with basic adb commands
================================================================================================
adb devices : This allows you to confirm that your pc and device are communicating
syntax
Code:
adb devices
adb pull : This allows you to pull specific files from the device
syntax
Code:
adb pull /sdcard/you_know_what.jpg
adb push : This allows you to send specific files to the device
syntax
Code:
adb push file.txt /sdcard/0/
================================================================================================
adb reboot : You can guess the command's function by looking at it and you were probably right it just "reboot" your phone
syntax
Code:
adb reboot
adb reboot-bootloader : This is same as its parent (adb reboot) but instead of rebooting to Android OS it boots to the bootloader
adb reboot-recovery : This is same as its parent (adb reboot) but instead of rebooting to Android OS it boots to the recovery
================================================================================================
adb shell : This executes a command on the device
Info : You can just pass a single command to the device to execute or you can also open an interactive shell
syntax ( single command ) :
Code:
adb shell [I]command[/I]
synatx ( interactive shell ) :
Code:
adb shell [ENTER]
command"s"
adb sideload : ADB sideload is a different ADB mode that you can use to push and install a zip using one command from your computer
Info : This was introduced in Jelly Bean Aosp
syntax :
Code:
adb sideload /sdcard/0/rom.zip
================================================================================================
adb install : This allows you to install any apps on the device using adb
syntax :
Code:
adb install TheApp.apk
info : running adb install with -r flag makes it install the app on the sdcard of the device (if the rom supports it)
adb uninstall : This allows you to uninstall an app on the device
syntax :
Code:
adb uninstall com.company.appname
info : using -k option uninstalls the application while retaining the data/cache.
At the moment, there is no way to remove the remaining data.
You will have to reinstall the application with the same signature, and fully uninstall it.
adb logcat : This allows you to access the logs / events of the system/apps
syntax :
Code:
adb logcat
{I would do a more in-depth synopsis of these command in my next post}
================================================================================================
Great post! This will be an excellent tool for anyone wanting to learn adb.
================================================================================================
After you have played with adb now lets gets the level
Amateur​Now after playing with commands your curiosity has risen and you want to know How does adb work ?
let me break the confusion
Adb has 3 major components
Adb client
adb server
adb daemon (adbd)
Lets see what each of them does
================================================================================================
adb server : You can consider this as a daemon running on the PC . It manages the communication between the adb client and adbd daemon. Its purpose if to sense the USB ports to know when devices are attached/removed, as well as when emulator instances start/stop.It thus maintains a list of "connected devices" and assigns a 'state' to each one of them: OFFLINE, BOOTLOADER, RECOVERY or ONLINE
================================================================================================
adb client: This is the clients that communicates with the server to give commands. It first tries to locate the ADB server on the host machine, and will start one automatically if none is found.
================================================================================================
Info: At this moment a single 'adb' binary is used for both the server and client
================================================================================================
adbd : The daemon runs on the device side and listens for for the commands on the usb or tcp. The adb server tries to communicate with the adbd daemon, if the connection is made then it labels the device as online else if , the connection to the device is made but the server cant communicate with the adbd then the device is labelled as offline.
In Android adbd is started when the data partition is mounted it is started by init.usb.{ro.hardware}.rc you can mod it to run earlier on your rom builds
================================================================================================
================================================================================================
Now lets move on to the next level
PROFESSIONAL​Before Moving in here please see familiarize your self with Android Building
After you have followed the guide , Now lets start building the adb
Prepare the environment
Code:
source ./build/envsetup.sh
lunch lineage_devicecodename-eng
mka adb fastboot
Now you can check $OUT directory for the executable
Code:
which adb
which fastboot
================================================================================================
Lets first see how the communication between the client and the adb server works
The adb server listens on tcp::localhost:5037
A diagram representing the structure
A Graphic by forum.xda-developers.com wiki
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
so the client connects to tcp:localhost:5037 and sends a request in the following way
A 4-byte hexadecimal string giving the length of the command
And then followed by the command itself
so a million dollar question how does the adb server responds to the client ?
Server would respond in 2 ways :
For success, the 4-byte "OKAY" string
For failure, the 4-byte "FAIL" string, followed by a 4-byte hex length, followed by a string giving the reason for failure.
Note : In a special case of adb's version the a 4-byte hex string corresponding to the server's internal version number would be returned
Note : For different commands the behavior is different so I would make a separate post About it
================================================================================================
Now for building the adb as you have already see you use mka adb fastboot
The main thing over here is Android.mk of the adb and the folder structure
Lets start by counting the number of modules built by the Android.mk
LOCAL_MODULE := libadbd
LOCAL_MODULE := libadb
LOCAL_MODULE := adbd_test
LOCAL_MODULE := libdiagnose_usb
LOCAL_MODULE := adb_test
LOCAL_MODULE := adb
LOCAL_MODULE := adbd
So these were the 7 module built by it
================================================================================================
Now I would leave you on your own to figure the source code ( i made it quite easy , didnt i ? )
I would continue writing in my next post how do the commands execution work
So this was the end of the professional I hope you learnt something If you need more stuff here please contact me
[WIP][If anyone can do the diagrams it would be a huge help i would give you the whole credit for images]

Making a simple ADB shell script.

So i am trying to make a simple shell script which will execute multiple ADB commands, here's what i have come up with.
#bin/sh
echo -------------------------------
echo Removing lockscreen ads...
echo -------------------------------
adb shell pm disable-user --user 0 com.amazon.kindle.kso
when i try to do, bash file.sh it just says bash is a unknown command, so what am i doing wrong?
ADB is a commandline tool to be run either on Windows OS, preferredly wrapped into a Windows CMD script, or in Android OS, preferredly wrapped into an Android shell script.
If you intend to run ADB commands in Android's terminal then a shell script would look like this
Code:
#!sbin/sh
ADB=/usr/bin/adb
"$ADB" shell "<COMMAND-HERE>"
jwoegerbauer said:
ADB is a commandline tool to be run either on Windows OS, preferredly wrapped into a Windows CMD script, or in Android OS, preferredly wrapped into an Android shell script.
If you intend to run ADB commands in Android's terminal then a shell script would look like this
Code:
#!sbin/sh
ADB=/usr/bin/adb
"$ADB" shell "<COMMAND-HERE>"
Click to expand...
Click to collapse
Okay, thank you. will try that right away
i could also use this in a windows batch file?(sorry bit of a noob about this )
ComputerTech312 said:
i could also use this in a windows batch file?(sorry bit of a noob about this )
Click to expand...
Click to collapse
If you'ld carefully read posts then you'll notice this question already get answered.
jwoegerbauer said:
If you'ld carefully read posts then you'll notice this question already get answered.
Click to expand...
Click to collapse
Apologies, i misread your post
What would the changes be to your code if it's a Windows CMD script? would changes to the path be required and such?
It really depends on what you're trying to do.
I wrote the following as a simple .bat file and ran it from my platform-tools directory on my Windows laptop:
@Echo Off
echo Checking for Devices.
adb devices
echo Is device present?
echo (Press Enter if yes, Ctrl+C or close Script if not)
pause
echo Rebooting to recovery.
adb reboot recovery
echo Waiting 30 seconds for reboot.
timeout /t 30
echo Checking for Devices.
adb devices
echo Is device present?
echo (Press Enter if yes, Ctrl+C or close Script if not)
pause
echo Decrypting Data in TWRP.
adb shell twrp decrypt ******
pause
Click to expand...
Click to collapse
And it does the following:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
ComputerTech312 said:
What would the changes be to your code if it's a Windows CMD script? would changes to the path be required and such?
Click to expand...
Click to collapse
An Android shell script and a Windows bash script ( including a Powerpoint script ) are in all aspects different with regards to coding, this because Android shell scripts are coded using Linux synthax.
BTW:
To not have to dance on 2 weddings I create my scripts mainly as pure Android shell scripts, which I copy from PC to Android device, and then start executing it from PC by means of ADB using a Windows bash script.
Example Windows bash script:
Code:
@echo off
adb devices
adb push <ANDROID-SCRIPT-PATH-ON-PC-HERE> /tmp
adb shell "chmod 0755 /tmp/<ANDROID-SCRIPT-NAME-HERE>"
adb shell "cd /tmp; $(<ANDROID-SCRIPT-NAME-HERE>);"
adb shell "rm -f /tmp/<ANDROID-SCRIPT-NAME-HERE>"
Deleted member 1890170 said:
An Android shell script and a Windows bash script ( including a Powerpoint script ) are in all aspects different with regards to coding, this because Android shell scripts are coded using Linux synthax.
BTW:
To not have to dance on 2 weddings I create my scripts mainly as pure Android shell scripts, which I copy from PC to Android device, and then start executing it from PC by means of ADB using a Windows bash script.
Example Windows bash script:
Code:
@echo off
adb devices
adb push <ANDROID-SCRIPT-PATH-ON-PC-HERE> /tmp
adb shell "chmod 0755 /tmp/<ANDROID-SCRIPT-NAME-HERE>"
adb shell "cd /tmp; $(<ANDROID-SCRIPT-NAME-HERE>);"
adb shell "rm -f /tmp/<ANDROID-SCRIPT-NAME-HERE>"
Click to expand...
Click to collapse
I am doing similar adb commands but from a bash script on a PC connected only via wifi to android box.
FYI, unlike a phone these Android 11 devices are not recognized by Windows11 when connected via a USB cable.
Commands I issue are things like
$ADB_CMD shell pm uninstall org.courville.nova
Before I can use these varous ADB commands I have to
(1) manually add the box to my wifi (via a mini-keyboard attached to android box)
(2) figure out which IP it was assigned by my router
(3) update my script with the correct IP to it can issue all the $ADB_CMD = eg. "../ADB -s 192.168.123:5555"
(4) run the script
I would like to skip steps 1..3, so the idea of running a similar script on the android box is very attractive.
(1) prepare a usb thumbdrive with a script, aps, ... and plug it into the android device
(2) use the filemanager on the device to execute the script
(3) done (ie. never have to connect to wifi).
What do you suggest doing?
I assumed by the nature of it's name "bridge" that ADB is meant to be run over a connection?
Ideally I would like to install nothing on the android device but I would not mind if a script installed some apk from the thumbdrive and then de-installed it.
The device is rooted.
Can you actually get some shell prompt on Android? or does it require an app to be installed.
I saw references to /usr/bin/sh I have no idea how to start one
Thank you for helping out.
Short answer: use
SH Script Runner for Android - APK Download
Download SH Script Runner apk 1.10 for Android. Bash script runner and shell command executor with superuser functionality.
apkpure.com
app to run scripts on Android device without the need of ADB
.
xXx yYy said:
.
xXx yYy said:
Short answer: use
SH Script Runner for Android - APK Download
Download SH Script Runner apk 1.10 for Android. Bash script runner and shell command executor with superuser functionality.
apkpure.com
app to run scripts on Android device without the need of ADB
Click to expand...
Click to collapse
Click to expand...
Click to collapse
So I downloaded SH Script Runner_v1.10_apkpure.com.apk onto a thumbdrive
I insert it into the android device I have to install it manually?
can you provide a sample script.sh that would run the equivalent of I can take it from there
$ADB_CMD shell pm uninstall org.courville.nova
...
I went ahead and installed the SH Script Runner it looks like it's designed to create/manage several scripts. I am not sure I understand yet it's flow.
When accessing the upper-right menu ... "open local script" It does not appear to let me browse other than internal /sdcard IOW, it does not seem to list my connected thumbdrive like this simple FileManager or X-plore would.
Once I understand the syntax of this script.sh I will convert my current make.sh and take it over the android device.
I do all my script editing on a PC with VScode editor.
Thank you for your guidance.
SH Script Runner is both a script editor and script executor, means write your code into this editor and run the script.
Example:
Code:
pm uninstall org.courville.nova

[TOOL][GUIDE] BareNox - Modded Nox Android Emulator

Hello Friends~!
Today I bring to you the Latest version of Nox, made portable, with a Cleaner Script to remove all the junk on your Main Machine as well as for Clones
DOWNLOAD BARENOX:
BareNox.zip (200M)
If you would rather build your own, I will now provide a written guide for how BareNox was built.
"BareNox" went through a lot of testing and a script was made to automate much of what is written below
Spoiler: WRITTEN GUIDE
Made using the latest version of Nox, which can be downloaded off the right side of this page:
System Requirements of Nox App Player – NoxPlayer
Open Nox's Multi Drive Manager and select "Add Emulator" and "Android 9" or whatever you prefer
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
When it is done building the machine you need to click on settings and enable root.
Spoiler: HOW TO CLEAN THE PREINSTALLED MACHINE WITH AN APP (NOT RECOMMENDED)
This method is advised against, due to the amount of time it takes to physically remove each directory within the gui, when we could remove all of these directories with a simple script. The knowledge will still be provided to show what the adb method is doing for us.
Open Nox and install a launcher app like nova, and a root explorer by selecting the apk button on the right side panel.
Spoiler: PIC
If you need the apps:
Nova
nova.apk
drive.google.com
Root Explorer
RootExplorer.apk
drive.google.com
Now open Nox's settings by clicking on the gear icon at the top right.
We need to go into General, and then put a check on root.
Spoiler: PIC
Next click on the Gaming tab and enable high fps and rendering cache. This is to allow you to be able to play higher end mobile games
Spoiler: PIC
Save settings and restart the machine
Select Nova as the Launcher app always
Spoiler: PIC
Open root explorer. Grant Superuser access forever
Delete all the items highlighted in the pictures below and close the machine.
Spoiler: PIC
Spoiler: HOW TO CLEAN THE PREINSTALLED MACHINE WITH ADB (RECOMMENDED)
This comment explains it
Spoiler: HOW TO USE THE SCRIPT AND NOVA ON ANY VERSION OF NOX
Make a new machine and enable root in settings
Make a text file and call it run.bat
Paste in this code.
Code:
adb root
adb shell rm -r /system/app/AmazeFileManager
adb shell rm -r /system/app/AppStore
adb shell rm -r /system/app/BuiltInPrintService
adb shell rm -r /system/app/CarrierDefaultApp
adb shell rm -r /system/app/CompanionDeviceManager
adb shell rm -r /system/app/CtsShimPrebuilt
adb shell rm -r /system/app/EasterEgg
adb shell rm -r /system/app/Facebook
adb shell rm -r /system/app/Helper
adb shell rm -r /system/app/LiveWallpapersPicker
adb shell rm -r /system/app/PrintRecommendationService
adb shell rm -r /system/app/PrintSpooler
adb shell rm -r /system/app/Traceur
adb shell rm -r /system/app/WallpaperBackup
adb shell rm -r /system/app/newAppNameEn
adb install nova.apk
adb reboot
Paste run.bat into the bin folder of Nox
Paste nova.apk (10M) into the bin folder of Nox
Now Run run.bat
Spoiler: VERIFIED WORKING GAMES
If there is a game you want me to test, leave a comment below.
Spoiler: BEAT PARTY
at the end of the video
Spoiler: DIABLO IMMORTAL
at the end of the video. guide is outdated
Spoiler: EPISODE STORY APP
Spoiler: MKX ONLINE
There's more that can be finessed here, have fun!
VT-Error fix
For rooted WSA (Android 12 or 13) see this guide
How To Build and Root Your Desired Flavor of WSA and install the Playstore Using LSPosed & Magisk. Plus a Premade
Hello Friends, Today I wanted to write a guide about how to use the LSPosed Github Repo on a linux machine to build your desired flavor of WSA with GAPPS and Root. If you do not already have a Linux machine or WSL, I have a fully built and...
forum.xda-developers.com
Works pretty well for me, except for trying open the multiple instances. I've wiped things clean a couple times and even tried on my other pc. Luckily the app I was trying to install had an x86 version so it'll do for now. I'll have to look into it when I have a bit more time.
Thanks for the post!
Twistt said:
Works pretty well for me, except for trying open the multiple instances. I've wiped things clean a couple times and even tried on my other pc. Luckily the app I was trying to install had an x86 version so it'll do for now. I'll have to look into it when I have a bit more time.
Thanks for the post!
Click to expand...
Click to collapse
Thank you for testing it!
Note that this issue has now been corrected
-
--
--
NotNox has had a Proper Update and is now at V2 "BareNox"
Includes the cleaning script commented on earlier.
Spoiler: HOW TO USE BARENOX
UPDATED 08/04/2022
BareNox.zip
drive.google.com
(196.2 MB ZIPPED)
Open BareNox and then bin, run MultiplayerManager.exe and add new emulator of choice
The first time you make a machine, nox will have to dl the "base" of the android version you selected from nox's servers. You only have to do this the first time you try to create an android 9 or 7 machine. You will then be able to create clones quickly as the BareNox folder will now contain the base disk and data folder.
Make sure to click on the gear icon and enable Root in system settings before running the machine
Run the remove.bat script when this lady appears on your new machine (this is when you have full read write access)
This will go through and remove the crap apps and install nova launcher for us
Spoiler: HOW TO CLEAN THE PREINSTALLED MACHINE (OR CLONES) WITH ADB
Spoiler: WRITTEN GUIDE
Go into the Binary folder of Nox or Not Nox and add a new text file called remove, paste NOVA.APK into this folder as well
Paste the contents of the script into the remove file
change the file extension from txt to .bat by renaming the file
add a new emulator and wait for it to make it to this screen, you need to hit Login later in order to get full Root, otherwise our batch will fail.
Run the remove.bat file after hitting Login Later and waiting for the garena lady to appear
this is what will be shown as the batch runs, don't do anything the machine will reset itself
select nova always and you're all set!
Spoiler: THE SCRIPT AND NOVA DL LINK
Spoiler: FILE EXPLORER OPTIONS PREREQ
View attachment 5669749
You need to have hide extensions for known file types unchecked, in order to be able to change a file from text to batch
nova.apk
drive.google.com
adb shell rm -r /system/app/AmazeFileManager
adb shell rm -r /system/app/AppStore
adb shell rm -r /system/app/BuiltInPrintService
adb shell rm -r /system/app/CarrierDefaultApp
adb shell rm -r /system/app/CompanionDeviceManager
adb shell rm -r /system/app/CtsShimPrebuilt
adb shell rm -r /system/app/EasterEgg
adb shell rm -r /system/app/Facebook
adb shell rm -r /system/app/Helper
adb shell rm -r /system/app/LiveWallpapersPicker
adb shell rm -r /system/app/PrintRecommendationService
adb shell rm -r /system/app/PrintSpooler
adb shell rm -r /system/app/Traceur
adb shell rm -r /system/app/WallpaperBackup
adb shell rm -r /system/app/newAppNameEn
adb install nova.apk
adb reboot
Spoiler: HOW THE NOX ADB SCRIPT WAS MADE
Hello Friends! I have created a guide on how to make your own Script to clean up your Nox machines (pre-installed and clones)~! Please note there is much much more that you can do here, this is just to teach you the basics to help you come up with interesting ideas!!
This video is Nerd Knowledge, and unneeded for folks that just want to quickly clean up their clones. Check out the next comment for the quick cleaning method
"BareNox" has this batch file pre-installed for your convenience
jenneh said:
NotNox has had a Proper Update and is now at V2 "BareNox"
BareNox.zip
drive.google.com
100 mb zipped!
Includes the cleaning script commented on earlier. Watch the video to see how to use it.
Note that:
THIS IS NOT A PREINSTALLED MACHINE, like "NotNox".
You will have to use multiplayermanager and add a new emulator with your choice of android version.
The first time you make a machine, nox will have to dl the "base" of the android version you selected from nox's servers. You only have to do this the first time you try to create an android 9 or 7 machine. You will then be able to create clones quickly as the BareNox folder will now contain the base disk and data folder.
Run the remove.bat script when this lady appears on your new machine (this is when you have full read write access)
This will go through and remove the crap apps and install nova launcher for us
View attachment 5669963
Click to expand...
Click to collapse
i got this error
HoangNK said:
i got this error
Click to expand...
Click to collapse
edit I am working on a fix
This issue has now been fixed
@HoangNK I apologize, I didn't mean to dismiss your VT error, I sincerely thought it was due to that mode not being enabled on the user end.
I now realize, after reinstalling windows on my laptop which has vt enabled, that I did indeed create this error. I didn't realize it at the time due to sharding, as I had nox installed in the main directory as well as the portable, so I didn't notice the problem.
I have rebuilt and verified BareNox, here's the new dl link:
BareNox.zip
drive.google.com
(196.2 mb ZIPPED)
For anyone Still experiencing the "VT Error" check your Windows Features settings. I unintentionally caused this error to myself while playing with WSL. Open up windows Features and uncheck these options, then reset
Spoiler: show
Something to consider about Emulators, they can be used to program virtual machines that have windows preinstalled faster usually than on your android device. Then you could pull your machine from the emulator and port over to any android device. I'm working on a detailed guide but it will take some time as I work to make the virtual machine's parameters more feasable for work use, i.e. a 10gb max hdd is not gonna suffice~!
To Do List: get win 10 working
Proof of Windows 7 Working in Nox:
How To Guide:
How To Install Windows Or Linux ISOs on your Android Devices - Windows 10 Nox Lab + Working Arm Distros for your phone using Termux
Update: A new thread is created to house "premade" linux distros. The first premade environment is an Ubuntu distro, installed using proot-distro in termux, Takes only a few minutes to restore the backup, else instructions are provided to build...
forum.xda-developers.com
A note to anyone checking this out from this date forward, Nox has had an update since I wrote the script. So when barenox downloads the android image from nox's server, they are different than before. Meaning that Even though one selects ROOT on startup, the ADB will not recognize the READ WRITE status thus rendering the .REMOVE.bat script useless for the time being. The adb root command does not help, I didn't bother to su into the shell bc the time factor, I could just delete in root explorer
A TLDR use the manual removal method with root explorer and manually install nova as the original thread shows how to do if you want to remove the crapware.
I'm not going to update the script, instead I am going to stop being lazy and just make my own emulators in android studio and share some builds in another thread. I'll leave a comment below whenever that happens.
Listen Linda.
I found an Amazing OS that I am trying to work out a few kinks for. It runs in vmware, has root, can play the games, has a traditional desktop feel, can run multiple apps in separate windows.
It's called prime os! I am not a creator. Just a testing a producto~!
I will make a new thread with prebuilt images of this and like 5 other prebuilt android x86_64/ chrome os forked os's that I played with this week. Putting out the word about prime in case anyone has any ideas how to get openvmtools or vmware tools to work on here. I am trying to build a stack in termux to accomplish this myself, key word trying. Maybe someone knows how.
other os's tested and built -- may add more if I find them
google chrome os - cloudready version
bliss os
android x86_64 9.0
flint os
fyde os
Spoiler: notes
as an Edit ---I am well aware that the tools are not "officially supported" so lets make them work anyway ok
This is 12 years old but still relevant
'As an update, I was able to locate the vmware tools iso for pre glibc linux distros (like our android vms) It comes with vmware workstation 17
had to pkg install tsu then run this command and am a step closer
I went through and pointed the script to the requested binary's location /system/bin/more and the others all for the most part in bin with depmod being in xbin. the program seemed to have an error at the end. going to take all the requested binaries out from system now and add them to the vmtools folder
using root explorer can copy the binaries from bin into the vmtools folder
So here's my notes on getting vmware tools to work in the android emulator.
In vmware tools on your windows pc there are isos that contain the tools.
Inside the iso is a file like this. extract it and extract the file it makes
So here is what I did, You can see the tools have an etc folder and a bin folder. and in pictures in the notes comment above, we know that the tools need certain binaries to run, or access to.
It is not just enough to point the tools to the /system/bin/binaryname because the stock binaries aren't executable.
So I obtained all the binaries the code calls for and put them into the bin folder of the tools.
I also built the missing directories such as /var/log
i changed the name of install-vmwaretools.pl to run.pl and added mkdir codes for the needed folders
Now running perl run.pl gives this interesting error
Anyone have any ideas?
It also really Did create that many folders, haha
hey there.. is there still possible to use your script to use older version of noxplayer and make that work? i get it that no more noxplayer updates will be compatible. but, that is just perfect for me.
i used noxplayer every day since 2016 and run 12 instances. it was and still is Ver. 3.8.3.1
but google as of last month has now removed games that is no longer supported by the google play.. so no more game updates for me. so i have no other choice to upgrade too.. i had off course followed guides and hacked it.. so no adds what so ever.. so hoping that you can still your very useful software to get rid of ads and malwares that they usually bring to free version.
thank you
@noxlar2 anything is possible, however i would need a copy of the version you want to fix to be able to advise better. as far as the current version i will for sure look at fixing the script for it tomorrow. kinda got super carried away on other projects and should take the time
@jenneh
wow.. fast reply back. well, just buildt me a new pc.. so, it will be with a fresh win11 and fresh noxplayer.. so i have no idea what version i must choose.. i will have my old pc system untouched in case of fall back on nox.p.. reason i always used the version i did was because of superior stability vs recent (back then + few years forwards)
also i did test latest free version on my minipc.. and it worked great as well. but, i have not done extensive testing so i don't know.
@noxlar2 Hey Congratulations on your new PC! That's always an amazing feeling. Thank you for clarifying which version. I was able to successfully get the script working again on the Latest nox and Lol it was silly, all the script needed was "adb root" added to the top.
i had to do the VT-Error fix bc of playing with WSA
got the original barenox updated -- link in the op and HERE Just remember to select root in settings before running the machine or the script wont work

Categories

Resources