[UPDATED 6/13 Version 1.3] ADB Root helper for Linux/Mac - Droid Incredible Android Development

UPDATE: If you've used this script to root in the past you should redo it again. A new payload has been released with an updated su binary which allows Superuser.apk to work properly!
I wrote this for someone on IRC...
Figured others may find it useful.
It's a helper script to somewhat automate the root process and guide you through most of the steps.
Requirements:
adb in path (or copy this script to the same location as adb)
To use:
extract
chmod +x adb_recovery_helper.sh
then
sudo ./adb_recovery_helper.sh
If adb is not in your path:
cd to /path/to/androidsdk/tools
export PATH=$PATH:`pwd`
Enjoy!
Updates:
Version 1.3:
- Updated payload
- Added AdBlock hosts file option
- Using local files instead of downloading
- Superuser.apk is no longer optional
- Less commands to run in adb shell due to payload update
Version 1.2:
- Change /system/bin/su perms to 6755
- Added optional Superuser.apk
- Added optional WiFi tether drivers
- Changed wording of instructions a little
Version 1.1:
- Added option for custom recovery install
- Prompts the user to see if the payload worked and allow retry

and how do we use this?????

Nothing happens when I chmod +x it

phoenx06 said:
Nothing happens when I chmod +x it
Click to expand...
Click to collapse
if there's nothing returned then it was probably successful, check the file with ls adb* -las
Thank you very much for this script, NIX!

to use,
extract to ~/androidsdk/tools
chmod +x ~/androidsdk/tools/adb_recovery_helper.sh
then
cd ~/androidsdk/tools/
sudo ./adb_recovery_helper.sh

saxman1212 said:
to use,
extract to ~/androidsdk/tools
chmod +x ~/androidsdk/tools/adb_recovery_helper.sh
then
cd ~/androidsdk/tools/
sudo ./adb_recovery_helper.sh
Click to expand...
Click to collapse
Thanks for the instructions.
sudo should not be required in most cases (definitely not on OSX). On Linux your udev rules may require you to be root.
Also, you do not need to be in the androidsdk/tools folder if adb is in your path.

jrebeiro said:
Thanks for the instructions.
sudo should not be required in most cases (definitely not on OSX). On Linux your udev rules may require you to be root.
Also, you do not need to be in the androidsdk/tools folder if adb is in your path.
Click to expand...
Click to collapse
i was just sort of being as 'verbose' as possible for the 'newbs' you know?

Great job, _n_i_x!
+1

i've used avd manager with platforms virtually but have not been able to set up the instruction file forr usb support. Could someone post the files needs and or a walk through for the inc. usb set up. thank you

How many reboots are you finding it takes as I have done dozens of reboots with no success as of now.

is this working before or after its seen as 2 usb drives

Just a FYI this script can be run in windows also if you install a program called Cygwin which basicly gives you *nix commands for windows. I was able to run the script fine. I couldnt get adb in recovery(never have with windows only mac) but just thought I'd let ya know incase you want to change the title to show you can do it in windows too....
Google cygwin and its the top result. I can't post links yet or I would.
Then in the middle of the page there is a "install or update" link.
Install the program and run it. It will open a cmd but with green text.

Related

Batch install APKs from ADB in Android. EASY!!

I looked around the net for a feasable solution but nobody seemed to give me a practical solution. So I decided to experiment and came up with an unbelivable solution that takes literally 20-30 seconds per app and is FULLY automated.
My problem was as follows. I like to install new ROMs by wiping, flashing and reinstalling my apps. The problem with that is when you have 130 apps and Astro file manager seems to install 3-5 then quits back to the packages screen, it becomes extremely friken agrivating and simply hell-as annoying!
So I needed a way to install all my previously backed up apps (which Astro does a BEAUTIFUL job with) from my SD card to my phone all in one go, without prompts and without any input.
To do this its simple, just write your own batch script and run adb install.
You will need:
1. Android SDK (your version, ie. 2.2, 2.1, 1.6 ect.)
Code:
youtube.com/watch?v=A1SOSXwkc_8
2. USB Cable to PC
3. Enable "USB Debugging" on phone
**Prefer doing a fresh install of latest ROM, no third party apps and dont open Android Market if you have Froyo because it will try and download all your previously downloaded apps again. Cool but not cool here.**
Now, I assume you already have the APK bunch on your SD card, like I had.
I use Astro File Manager to backup all my apks to my /sd/backup/apps (which is automatically set).
Once you have all your APKs in one directory, I suggest putting them on you C:\. For example "c:\apps" for ease of scripting.
Step 1.
Open command prompt (CMD) and change directory to your "c:\apps"
Example:
Code:
cd..
cd..
cd apps
Now you should see your path set as "C:\apps" in CMD.
Step 2.
Create directory print.
In CMD "C:\apps" run:
Code:
dir /s /b > print.txt
This will print all directory files and extensions but nothing else, like size and attributes into your "C:\apps" folder. Now you will see a "print.txt" file in your "c:\apps" folder. If you open it, you will see a list of all your APKs.
Step 3.
Assuming you are using Notepad to view your "print.txt" file, press "CTRL+H". This will open the Find and Replace dialog box.
In Find type
Code:
C:\
In replace type
Code:
adb install -r c:\
Hit enter and it will modify all the APKs with the adb install command. Save and close notepad.
Step 4.
Now you need to rename that .txt extension in your "c:\apps\print.txt" to "print.bat". You need to have extension shown in windows. Google that if you dont know how to do that.
Once saved as a .bat file, simply execute and it will run through the sequence to install all your APK files without any prompts on your phone. Voila, and enjoy.
EXAMPLE:"c:\apps\print.bat"
Code:
adb install -r c:\apps\com.twitter.android-1.apk
adb install -r c:\apps\com.ups.mobile.android-2.apk
adb install -r c:\apps\com.vavni.android.battleship-1.apk
adb install -r c:\apps\com.viclabs.myRemote-2.apk
adb install -r c:\apps\com.waterflea.wifiscan-1.apk
adb install -r c:\apps\com.wyse.pocketcloud-1.apk
adb install -r c:\apps\com.xrath.jmsn-2.apk
adb install -r c:\apps\com.xtralogic.android.rdpclient-1.apk
adb install -r c:\apps\com.xtremelabs.android.speedtest-1.apk
adb install -r c:\apps\com.yahoo.mobile.client.android.im-1.apk
adb install -r c:\apps\com.yahoo.mobile.client.android.mail-2.apk
adb install -r c:\apps\com.yahoo.mobile.client.android.search-1.apk
adb install -r c:\apps\hongbo.bluescreen-1.apk
adb install -r c:\apps\info.marlan.sim-1.apk
adb install -r c:\apps\koushikdutta.telnet-1.apk
adb install -r c:\apps\kr.mobilesoft.yxplayer-2.apk
adb install -r c:\apps\net.mafro.android.wakeonlan-1.apk
adb install -r c:\apps\nl.rogro.GScript-1.apk
adb install -r c:\apps\org.ajeje.fakelocation-1.apk
adb install -r c:\apps\org.ale.abtc-1.apk
adb install -r c:\apps\org.android7.aviplayer-1.apk
adb install -r c:\apps\org.connectbot-1.apk
adb install -r c:\apps\org.gmote.client.android-1.apk
adb install -r c:\apps\org.iii.ro.meridian-1.apk
adb install -r c:\apps\org.kman.WifiManager-1.apk
adb install -r c:\apps\org.openobjectives.serverassistant-1.apk
adb install -r c:\apps\org.prowl.networkmapper-1.apk
adb install -r c:\apps\org.transdroid-1.apk
This will go in sequence and show "success" when finished installing. It will then run the next command in sequence until its done.
** I tried to write this thread as a help to those trying to do the same thing I was trying to do. This is in no way meant to validate anything and is meant merely as a resource to anybody. If your going to be an ass, shove it, if you like it, im happy I could help.**
Wow, that certainly is an interesting solution. Personally I just push everything to data/app when in recovery, wipe dalvik-cache, then reboot, always works fine.
An even easier solution:
http://forum.xda-developers.com/showthread.php?t=716806
Thanks man! this helpes me out with multiple installs on the SDK's VM.
hello,
i know i am off topic but i dont find only this thread with the app i am searching.
i search for the "ups mobile" app and the market on my desire (froyo 2.2) found this app not. (Sorry for my english) The app is free, no warez!
Can anyone send my the app or an link with the app ?
many thanks and sorry for off topic.
peter
Check this out...
http://forum.xda-developers.com/showthread.php?t=740545
All the work are already done :0)
Thanks for the advice. However, I have about 50 apks to backup and Astro is unable to backup like 15 of them. IE Crystallight Defense. It just says it's unable to do it and I don't know why. Thanks for any help.
awesome, simple yet effective ... just restored 103 apps
thanks
this is simplest method yet...
copy .apk to any folder in sdcard, mine "marketapp"
then type these following commands below:
=====================================
adb shell
su
cd /sdcard/marketapp
for app in *.apk; do pm install -r $app; done
=====================================
regards,
d4rkcell
Install apk
Hello Fellow Androids!
If this is off topic, please accept my apologies. I am searching through all of XDA for a simple solution to adding apk. Now before you start bashing, please keep in mind that I am well aware of the "search" options + google + XDA etc.
Long story short, I have:
1) Rooted
2) Fashed many Roms (currently on Stock 2.1)
3) Lag Fixxed (see signature)
4) Removed Bloatware
5) I am familiar with ABD and commands
Problem:
All I'm trying to do is install certain "apk"s using ADB. I am well aware of the Program that installs/ pushes apps automatically that are found in G1 + Vibrant + HTC + Droid Forums without having to do any typin......BUT.....I would like to know my way around ABD <----Main reason why i dont want the easy way out.
I have been here:
http://forum.xda-developers.com/showthread.php?t=716806
as well as here:
http://forum.xda-developers.com/showthread.php?t=743457
even been here:
http://forum.xda-developers.com/showthread.php?t=740545
I know what you are thinking, why not use them? As i said before, i would like to be efficient with ADB. So...
I have tried methods found here:
http://forum.xda-developers.com/showthread.php?t=517874
As well as:
http://forum.xda-developers.com/showthread.php?t=532719
The problem I am having is:
Whether i navigate to my folder (desktop with all my apps) and use either
"adb push app /system/sd/app
adb push app-private /system/sd/app-private"
or simply
"adb install <path to file> - Example: adb install c:/apps/apps2sd.apk"
I always get the error: "cant find <whatever apk> to install"
No matter which directory i have it, i get that message.
Note:
1) I have debugging on
2) I mounted sd <----also tried Without mounting
3) I have used the same command when I removed bloatware but i understand Adding apks are slightly different.
4) I have all the drivers installed + Microsoft's .net framework + etc
What am i doing wrong?
All Critics, input, education bashing (just not hating) lol are welcome. Thanks!
dannycurtean said:
**Prefer doing a fresh install of latest ROM, no third party apps and dont open Android Market if you have Froyo because it will try and download all your previously downloaded apps again. Cool but not cool here.**
Click to expand...
Click to collapse
Very nice, thanks.
Is there any way to make installed APKs being seen by Market ?
I mean, is it possible to relink all the batch-installed .apk files as they were installed from Android market ?
If not, this method is fine at first but becomes painful with all the lost market updates
Thanks a lot
darkcell said:
this is simplest method yet...
copy .apk to any folder in sdcard, mine "marketapp"
then type these following commands below:
=====================================
adb shell
su
cd /sdcard/marketapp
for app in *.apk; do pm install -r $app; done
=====================================
regards,
d4rkcell
Click to expand...
Click to collapse
Thanks a lott for this !!!!
having about 260 apps installed it saves me several hours to reinstall after updating to froyo !!
k.mooijman said:
Thanks a lott for this !!!!
having about 260 apps installed it saves me several hours to reinstall after updating to froyo !!
Click to expand...
Click to collapse
Would be them updated from market, afterwards ?
I fear they'll loose the market link, by installing them from local apk files...
Even easier.
Thanks for the great information. I realize you can save yourself a few steps after gathering all the apk's in one location by using this command line (XP or higher):
Step 2. In the Android SDK folder containing adb, type:
Code:
for %f in (c:\apps\*.apk) do @(echo adb install -r %f)
dannycurtean said:
I looked around the net for a feasable solution but nobody seemed to give me a practical solution. So I decided to experiment and came up with an unbelivable solution that takes literally 20-30 seconds per app and is FULLY automated.
My problem was as follows. I like to install new ROMs by wiping, flashing and reinstalling my apps. The problem with that is when you have 130 apps and Astro file manager seems to install 3-5 then quits back to the packages screen, it becomes extremely friken agrivating and simply hell-as annoying!
So I needed a way to install all my previously backed up apps (which Astro does a BEAUTIFUL job with) from my SD card to my phone all in one go, without prompts and without any input.
To do this its simple, just write your own batch script and run adb install.
You will need:
1. Android SDK (your version, ie. 2.2, 2.1, 1.6 ect.)
Code:
youtube.com/watch?v=A1SOSXwkc_8
2. USB Cable to PC
3. Enable "USB Debugging" on phone
**Prefer doing a fresh install of latest ROM, no third party apps and dont open Android Market if you have Froyo because it will try and download all your previously downloaded apps again. Cool but not cool here.**
Now, I assume you already have the APK bunch on your SD card, like I had.
I use Astro File Manager to backup all my apks to my /sd/backup/apps (which is automatically set).
Once you have all your APKs in one directory, I suggest putting them on you C:\. For example "c:\apps" for ease of scripting.
Step 1.
Open command prompt (CMD) and change directory to your "c:\apps"
Click to expand...
Click to collapse
darkcell said:
this is simplest method yet...
copy .apk to any folder in sdcard, mine "marketapp"
then type these following commands below:
=====================================
adb shell
su
cd /sdcard/marketapp
for app in *.apk; do pm install -r $app; done
=====================================
regards,
d4rkcell
Click to expand...
Click to collapse
This looks like a great solution. Is there some way to run this from the phone itself? When I tried using Terminal Emulator in ICS, I get a Segmentation Fault error.
Found this in Google results, was extremely useful for restoring all my Xoom apps from my pre-root times
Hi to spartan062984
Couple of suggestions which I found to work.
Copy adb.exe to \windows\system32.--- this will give you a global adb which works from any directory.
Make a folder 'APK' ( or what you wish ) and put your apk's into it.
In DOS cd to APK and then run your install e.g. adb install xyz.apk \app
Hope it works for you
Keith
dannycurtean said:
I looked around the net for a feasable solution but nobody seemed to give me a practical solution. So I decided to experiment and came up with an unbelivable solution that takes literally 20-30 seconds per app and is FULLY automated.
My problem was as follows. I like to install new ROMs by wiping, flashing and reinstalling my apps. The problem with that is when you have 130 apps and Astro file manager seems to install 3-5 then quits back to the packages screen, it becomes extremely friken agrivating and simply hell-as annoying!
So I needed a way to install all my previously backed up apps (which Astro does a BEAUTIFUL job with) from my SD card to my phone all in one go, without prompts and without any input.
To do this its simple, just write your own batch script and run adb install.
You will need:
1. Android SDK (your version, ie. 2.2, 2.1, 1.6 ect.)
Code:
youtube.com/watch?v=A1SOSXwkc_8
2. USB Cable to PC
3. Enable "USB Debugging" on phone
**Prefer doing a fresh install of latest ROM, no third party apps and dont open Android Market if you have Froyo because it will try and download all your previously downloaded apps again. Cool but not cool here.**
Now, I assume you already have the APK bunch on your SD card, like I had.
I use Astro File Manager to backup all my apks to my /sd/backup/apps (which is automatically set).
Once you have all your APKs in one directory, I suggest putting them on you C:\. For example "c:\apps" for ease of scripting.
Step 1.
Open command prompt (CMD) and change directory to your "c:\apps"
Example:
Code:
cd..
cd..
cd apps
Now you should see your path set as "C:\apps" in CMD.
Step 2.
Create directory print.
In CMD "C:\apps" run:
Code:
dir /s /b > print.txt
This will print all directory files and extensions but nothing else, like size and attributes into your "C:\apps" folder. Now you will see a "print.txt" file in your "c:\apps" folder. If you open it, you will see a list of all your APKs.
Step 3.
Assuming you are using Notepad to view your "print.txt" file, press "CTRL+H". This will open the Find and Replace dialog box.
In Find type
Code:
C:\
In replace type
Code:
adb install -r c:\
Hit enter and it will modify all the APKs with the adb install command. Save and close notepad.
Step 4.
Now you need to rename that .txt extension in your "c:\apps\print.txt" to "print.bat". You need to have extension shown in windows. Google that if you dont know how to do that.
Once saved as a .bat file, simply execute and it will run through the sequence to install all your APK files without any prompts on your phone. Voila, and enjoy.
EXAMPLE:"c:\apps\print.bat"
Code:
adb install -r c:\apps\com.twitter.android-1.apk
adb install -r c:\apps\com.ups.mobile.android-2.apk
adb install -r c:\apps\com.vavni.android.battleship-1.apk
adb install -r c:\apps\com.viclabs.myRemote-2.apk
adb install -r c:\apps\com.waterflea.wifiscan-1.apk
adb install -r c:\apps\com.wyse.pocketcloud-1.apk
adb install -r c:\apps\com.xrath.jmsn-2.apk
adb install -r c:\apps\com.xtralogic.android.rdpclient-1.apk
adb install -r c:\apps\com.xtremelabs.android.speedtest-1.apk
adb install -r c:\apps\com.yahoo.mobile.client.android.im-1.apk
adb install -r c:\apps\com.yahoo.mobile.client.android.mail-2.apk
adb install -r c:\apps\com.yahoo.mobile.client.android.search-1.apk
adb install -r c:\apps\hongbo.bluescreen-1.apk
adb install -r c:\apps\info.marlan.sim-1.apk
adb install -r c:\apps\koushikdutta.telnet-1.apk
adb install -r c:\apps\kr.mobilesoft.yxplayer-2.apk
adb install -r c:\apps\net.mafro.android.wakeonlan-1.apk
adb install -r c:\apps\nl.rogro.GScript-1.apk
adb install -r c:\apps\org.ajeje.fakelocation-1.apk
adb install -r c:\apps\org.ale.abtc-1.apk
adb install -r c:\apps\org.android7.aviplayer-1.apk
adb install -r c:\apps\org.connectbot-1.apk
adb install -r c:\apps\org.gmote.client.android-1.apk
adb install -r c:\apps\org.iii.ro.meridian-1.apk
adb install -r c:\apps\org.kman.WifiManager-1.apk
adb install -r c:\apps\org.openobjectives.serverassistant-1.apk
adb install -r c:\apps\org.prowl.networkmapper-1.apk
adb install -r c:\apps\org.transdroid-1.apk
This will go in sequence and show "success" when finished installing. It will then run the next command in sequence until its done.
** I tried to write this thread as a help to those trying to do the same thing I was trying to do. This is in no way meant to validate anything and is meant merely as a resource to anybody. If your going to be an ass, shove it, if you like it, im happy I could help.**
Click to expand...
Click to collapse
This works good so far.. lets hope that system process likes it.
trying now.
darkcell said:
this is simplest method yet...
copy .apk to any folder in sdcard, mine "marketapp"
then type these following commands below:
=====================================
adb shell
su
cd /sdcard/marketapp
for app in *.apk; do pm install -r $app; done
=====================================
regards,
d4rkcell
Click to expand...
Click to collapse
I love simple solutions in linux
You have killed all 100km long tutorials and apps
Very Good, Thanx
i'm testing
very good method..
good lock..

[GUIDE][ADB]Easiest How to use adb, logcat, etc for noobs and newbies

ADB:-
Android Debug Bridge
Very useful program made itself by Google for Programmers and developers. Its based on command line and basically communicates with your Android to respond to certain commands. There is vast amount of knowledge about adb but its most useful commands limit to getting:-
Logcat:-
A real time log of what is happening in background of our devices. It is really useful for developers to see which component has malfunctioned and helps to narrow down their search for what failed and what needs to be fixed. Several times users are asked to give logcats of their devices which are giving errors. We will go in detail that how to get logcats in every and easiest way possible.
App Installation and Management:-
adb proves really handy if you want to install apks directly from your PC or want to batch install or delete them.
Shell Execution:-
You must have heard of Terminal Emulator. It is an app for android to execute shell commands(linux commands) which are basically present as applets in /system/bin, /system/sbin or /system/xbin(in our case) folders. A very imporant applet called busybox is installed there mainly used for execution of basic commands during root browsing or ROM installation. Many times updater script of ROMs use busybox commands to install it. Well, these commands can be initiated from your device too but they can be initiated from adb also making it easy for programmers.
Pushing and Pulling:-
Most used commands of adb. adb makes it a piece of cake for new device developers to get an ideo of structure and basic knowledge of devices by pulling command. We can pull out i.e copy any files or folders from our devices to our PC, even the root directories without rooting the devices. It help rooters and ROM chefs of new devices to get an idea and implement their mods on them. Pushing is also very useful command. It copies your files and folders from PC to your device. Very useful in pushing some /system apps and other things
Remounting and setting permissions
Basic commands:-
Of-course basic commands such as rebooting and rebooting in recovery mode and download mode are supported.
Others:-
There are several other features of adb such as fastboot, aapt, etc
Setting up ADB
Pre Requirements:-
PC(This is a windows guide, if asked I will add linux and mac guide later)
Java Runtime environment or Java Developing kit
Your Device Drivers
An Android Device
USB Debugging MUST be turned ON in the device for ADB to see it & Developer options is hidden in Android 4.2 and
above, Hitting Build number 10 times in
About Phone/Tablet reveals the menu (Thanks lilHermit for reminding me to add it)
Assuming you all these ready and working properly, we continue
If you are having trouble completing Pre-Requisites, there are several guides featuring them too
Start
1. First Download Android SDK. Roughly about 70 MB
2. There may be any compressed zip file or exe file
If zip file, then extract it to C:\android-sdk
If exe file then double click on it and install it in C:\ Drive(or any other drive you want)
3. Now to get adb and other tools, you need to download 'Platform Tools'
To download them, go to the android-sdk folder and double click on SDK Manager
It will ask you which package to download? However, it is your choice which package to Download, but here, we will only talk about platform
Tools. So, simply tick on Platform Tools and click on install. Once you have done it. Go to the platform-tools folder in the directory where you installed android-sdk. You will find several files there like adb, fastboot, aapt, etc
4. Now, you can backup the whole folder of android-sdk to any external storage that will make you not download package
again if you want to. You can have it placed in any computer and run it as it does not require registry to work
5. Now, you are just one step away from using adb. Next step is SKIPPING SETTING ENVIRONMENT VARIABLE (If you however want to set environment variables. Click on Show Content)
We can easily append the sdk platform-tools and tools folder to your systems environmental path variable directly from command line(cmd) by simply issuing one command and performing a system reboot:
Code:
[COLOR=Black]SETX PATH "%PATH%;[/COLOR][COLOR=Indigo]SDK_Install_Path[/COLOR][COLOR=Black]\platform-tools;[/COLOR][COLOR=Indigo]SDK_Install_Path[/COLOR][COLOR=Black]\android-sdk-windows\tools" -m[/COLOR]
Just replace the "SDK_Install_Path" in the above with the proper path of your SDK installation. Example: C:\android-sdk-windows
(Thanks to WugFresh for telling me :victory
Many guides on internet say that it is to be done for making it easy for users and if you have some basic knowledge of Command Prompt,
you will know that to execute any application with command prompt, you first need to change the directory to the one where application is
placed. And to skip changing the directories every time you open CMD, you need to put that application is environment variable. However, we will not do so.
6. Type cmd in the search bar. Copy cmd.exe from there. Go to the directory where you have installed android-sdk. Go to platform-tools folder. Paste cmd there, right click on it and in the settings, select Run as Administrator.
7. You are done. Now what to do in it?
ADB Commands
Type adb in command prompt. And several commands will show up on your screen. It is very difficult to analyse these all commands, so we will only talk about most used and important commands
Connect your device via USB cable
And open the CMD in platform-tools folder(Make a shortcut of it on desktop). And type the suitable commands
Code:
adb devices
Will show the list of devices attached to the PC andtheir serial numbers. If this shows up correctly on your PC, then it means that everything is fine for continuing.
Logcat
Code:
adb logcat
It will display the real time log of your device
Best time to do it is when your device boots up
Now, many users ask me how to copy the logcat and upload it from CMD
There are several methods:-
1. Right click on the Title Bar of Command Prompt. Hover the cursor over edit and select mark. Select all the things you want to copy and then click enter. All the things will be copied to clipboard.
2. This is the correct way of getting logcat saved.
Code:
adb logcat > logcat.txt
This command will create a logcat.txt document in platform-tools folder with the complete logcat of the device. Ofcourse you can type any name instead of logcat.txt
3. I prefer taking logcat this way as it neatly compiles logs of different time
Code:
adb logcat -v long > logcat.txt
This is a very nice way to get logcat.
Installing Apps
Code:
adb install %PATH OF APK%
This will install an app on your Android
For example, if my app AreeB.apk is in G:\ drive (G:\AreeB.apk)
Then I will type
Code:
adb install G:\AreeB.apk
Be sure your apk is not in a folder that has space in its name, else the command will break at space bar.
For eg:-
G:\Program Files\AreeB.apk
Note:
If you have spaces in path of apk, you can execute the command without breakage if you include the path inside quotes. (Thanks to etcman)
Eg:-
Code:
adb install "G:\Program Files\AreeB.apk"
Mounting
However, I never found any problem in tweaking with system files with adb, but some users said that they couldn't do it, so the problem was that their system partition was mounted as Read Only(R/O)
So, it is necessary now to tell how to mount system partition as Read Write(R/W)
Code:
adb remount
It is easiest way to do so, if it does not work then
There is another method that we will discuss in ADB Shell commands section
Pushing and Pulling
For pushing,
Type
Code:
adb push %PATH TO BE PUSHED% %PATH WHERE TO BE PUSHED%
Suppose I have an app named SystemUI.apk(PATH = G:\SystemUI.apk) which I want to push in /system/app/ on my android(or in other words, install an app as a system app). Then I would type
Code:
adb push G:\SystemUI.apk /system/app/
More examples
G:\Dance.txt file to be pushed in Dance folder in sdcard
Code:
adb push G:\Dance.txt /sdcard/Dance/
OR
Code:
adb push G:\Dance.txt /mnt/sdcard/Dance/
G:\Movies folder to be transferred in SDCARD in Videos Folder
Code:
adb push G:\Movies /sdcard/Videos/
G:\system\framework\framework-res.apk to be pushed in /system/framework/
Code:
adb push G:\system\framework\framework-res.apk /system/framework/
For pulling,
push command replaces with pull and paths are swapped​
Code:
adb pull %PATH TO BE PULLED FROM% %PATH TO PLACE PULLED FILE%
Example,
All system apps are to be pulled to G:\ROM\system\app
Code:
adb pull /system/app G:\ROM\system\app\
build.prop to be extracted to desktop
Code:
adb pull /system/build.prop C:\Users\Areeb\Desktop\
However, if a folder is in platform-tools folder, you don't need to type full path
Suppose if I type
Code:
adb pull /system/ system
Then a folder named system will be created inside platform-tools with all the files in system in it
If a file is in platform-tools folder, then also no need to type full path
For example,
There is an app name DeskClock.apk in this folder then, to push it to /system/app, type
Code:
adb push DeskClock.apk /system/app/
ADB Shell Commands
This mode of adb allows you to execute linux shell commands from your PC
These commands can aldo be executed through the mobile using Terminal Emulator
To initiate shell mode
Type
Code:
adb shell
You will get an prompt like this
sh-3.2#
Now you are in shell mode
adb commands won't work here and a new set of commands will work here. But we will only go in a little detail here.
Assuming you are in adb shell mode, I will only type commands that will work on shell. Note:- These commands won't work if you type them alone on cmd. But, these command will directly work on your mobile's Terminal Emulator
As these commands can also work on mobile, I am going to tell you a way of taking logcat on mobile
Type
Code:
logcat
You will see log of your device
To save this
Type
Code:
logcat > /sdcard/log.txt
A file named log.txt will be generated in sdcard
Uninstalling Applications
Code:
cd /data/app
This will change the directory to /data/app
Code:
ls
This will show the list of files in there
Suppose, there is an app named com.opera.browser (Opera Mobile) you want to uninstall it
Type
Code:
rm -r com.opera.browser
This will uninstall the app
Mounting Command:-
Code:
mount -o rw,remount /dev/block/mtdblock3 /system
Miscellanous commands:-
su: Initiates root request
du: Shows file foldrs and size
date: Shows todays date
ls: Shows list of directory
cd: Changes working directory
rm: Removes the file
logcat: Displays logcat
mount: Mounts the partition
busybox: Busybox Applets
Credits
Google: For Android and several searchings
Samsung: For Galaxy Ace s5830I
paxChristos for amazing logcat guide
Broadcom: For their Open Sourceness
XDA Forums : For the precious knowledge
Reserved
Reserved Once More
Last One
Reserve the guide
install full rom
how to install a full rom from adb?
Pretty sure it's impossible. Sorry.
Sent from my E15i using XDA Premium App
Perfect Guide to use ADB Commands..
It is very clear and perfect guide to use ADB commands.. I tested this all and works fine..
You can use apks to do logcats from the phone too, I use catlog.
About Broadcom being open sourced made me laugh hahaha.
open source broadcomm, i see what you did there .
Updated OP
Hey, I have downloaded adb a week ago. I did everything like your tutorial and more but adb doesn't see my device. I already have USB Debugging on and have the USB Drivers, but it doesn't work. This is what I get (Screenshot)
Android-fany said:
Hey, I have downloaded adb a week ago. I did everything like your tutorial and more but adb doesn't see my device. I already have USB Debugging on and have the USB Drivers, but it doesn't work. This is what I get (Screenshot)
Click to expand...
Click to collapse
Probably because of bad drivers
Can you use any other software with your mob
Because when I had this problem, reinstalling drivers fixed it.
iamareebjamal said:
Probably because of bad drivers
Can you use any other software with your mob
Because when I had this problem, reinstalling drivers fixed it.
Click to expand...
Click to collapse
I already reinstalled it like 5 times. Still doesn't work.
Android-fany said:
I already reinstalled it like 5 times. Still doesn't work.
Click to expand...
Click to collapse
Which Windows?
Which ROM?
iamareebjamal said:
Which Windows?
Which ROM?
Click to expand...
Click to collapse
Windows Vista
Stock Rom + Interactive Kernel (If the kernel is important too)
Android-fany said:
Windows Vista
Stock Rom + Interactive Kernel (If the kernel is important too)
Click to expand...
Click to collapse
Ah Vista
That old Nemesis
Frankly telling you bro, Vista sucks big time
I unistalled it as soon as I found out that Android kitchen won't work on it
Sorry bro
I don't know much about Vista
Install 7 or 8
AW: [GUIDE][ADB]Easiest How to use adb, logcat, etc for noobs and newbies
iamareebjamal said:
Ah Vista
That old Nemesis
Frankly telling you bro, Vista sucks big time
I unistalled it as soon as I found out that Android kitchen won't work on it
Sorry bro
I don't know much about Vista
Install 7 or 8
Click to expand...
Click to collapse
I can't install Windows 7/8 because it is not my computer.
But Android Kitchen and the other tools works. Just not adb.
Tapatalked by s5830i
Android-fany said:
I can't install Windows 7/8 because it is not my computer.
But Android Kitchen and the other tools works. Just not adb.
Tapatalked by s5830i
Click to expand...
Click to collapse
Very strange
Download My Phone Explorer and check if its working!!
Its just 2mb-6mb

[HOWTO] adb / sideloading / superuser access

Hey everyone! I put together some information on how to do a few things on your new Ouya! This info is by no means my own original contributions, but rather just a compilation of several different sources that I discovered through my quest to explore my Ouya. All credit goes to the original authors/brave experimenters.
SDK SETUP:
1. Install the Android SDK
2. Open SDK Manager and install the following packages:
- Tools: Including both Android SDK and Android SDK
- Android 4.1 (API 16): SDK Platform
- Android 4.0 (API 14): SDK Platform
- Extras: Android Support Library, Google USB Driver
3. Navigate to /android-sdk/extras/google/usb_driver
4. Open android_winusb.inf in an editor (I use Notepad++)
5. Add the following lines beneath [Google.NTx86]:
Code:
;OUYA Console
%SingleAdbInterface% = USB_Install, USB\VID_2836&PID_0010
%CompositeAdbInterface% = USB_Install, USB\VID_2836&PID_0010&MI_01
6. Connect your Ouya via micro USB to your computer and turn it on (it needs to be on for adb to work)
7. Open a command window in /android-sdk/platform-tools and run the following commands:
Code:
adb kill-server
echo 0x2836 >> "%USERPROFILE%\.android\adb_usb.ini"
adb start-server
adb devices
8. After 'adb devices' you should see a number, which signifies your connected console
9. You are now ready to use adb to sideload apps
=============================================================================================================
SIDELOADING APPS:
1. Place the desired .apk file to be installed within /android-sdk/platform-tools
2. Connect the Ouya and open a command window in /android-sdk/platform-tools and run the following command:
Code:
adb install [name.of.apk.file.here]
3. Wait for it to complete the installation
4. On the Ouya, navigate to 'Make' and 'Builds' and your app will be there
=============================================================================================================
ADDITIONAL STUFF BELOW
=============================================================================================================
HOW TO SET UP WIRELESS ADB (will allow you to wireless use adb command, without connecting directly to your computer)
1. Connect OUYA console via mini-usb (or using wireless adb) and run the following commands:
Code:
adb shell
su
mount -o rw,remount -t ext4 /dev/block/platform/sdhci-tegra.3/by-name/APP
chmod 666 /system/build.prop
2. Open another terminal (so we can do things locally) and run the following command:
Code:
adb pull /system/build.prop
3. Open build.prop in a text editor, add this line:
Code:
service.adb.tcp.port=5555
4. Return to the second command window and run the following command:
Code:
adb push build.prop /system
5. Now go back to your shell for the OUYA and run the following commands:
Code:
chmod 644 /system/build.prop
(seriously! the console won't boot if you forget this)
Code:
mount -o ro,remount -t ext4 /dev/block/platform/sdhci-tegra.3/by-name/APP
6. Disconnect your OUYA, put it where you want it, reboot it.
7. To wirelessly connect to your OUYA, use the following command:
Code:
adb connect 192.168.xxx.xxx
(your OUYA's ip address)
=============================================================================================================
HOW TO INSTALL BUSYBOX, SUPERUSER, AND SU BINARIES
1. Make sure you have ADB set up and working (wired or wireless).
2. Download and unzip the needed files here.
3. Place unzipped files in /android-sdk/platform-tools
4. Run the following commands to put su in the proper place:
Code:
adb shell
su
mount -o rw,remount -t ext4 /dev/block/platform/sdhci-tegra.3/by-name/APP
exit
exit
adb push su /sdcard/su
adb shell
su
cat /sdcard/su > /system/xbin/su
ln -s /system/xbin/su /system/bin/su
chmod 6755 /system/xbin/su
exit
exit
5. Install SuperUser and BusyBox:
Code:
adb install com.koushikdutta.superuser.apk
adb install stericson.busybox.apk
6. Run SuperUser on the Ouya (from Make > Software) and confirm the update (not in recovery).
=============================================================================================================
Again, this isn't my original content, only slightly edited (since I am OCD about writing).
My only intention is to share this knowledge with other users like me, who don't know much about this sort of thing (yet).
If i stepped on any toes, or did something wrong, I apologize. Let me know if you have any questions or concerns.
Thank you to the following people for their work in contributing to this guide:
WinDroidGuy
elmerohueso
The driver section doesn't seem to work on Windows 8 Pro 64-bit. I don't think the Google driver has been updated for Win8 yet.
You're probably right. I'm on Windows 7. I'll see if I can jump on a buddy's computer to play around with it.
Upon a quick Google search, I found this: http://forum.xda-developers.com/showthread.php?t=1161769
Perhaps give this a try? Please let me know how it goes.
I also tried Koush/ClockwordMod's universal ADB driver (adding in the Ouya section to 32/64) but same results about a bad hash in the driver file.
Well it was worth a try. I'll keep my ears open for a Windows 8 solution.
Did you try setting up adb over wireless by any chance? I don't know much about this stuff, but perhaps that's worth a try as well?
cosine83 said:
The driver section doesn't seem to work on Windows 8 Pro 64-bit. I don't think the Google driver has been updated for Win8 yet.
Click to expand...
Click to collapse
My Ouya was listed twice in Device manager and one of them was a driver problem. I manually selected my Samsung adb drivers from the list and it works fine. the easiest way yo get those is to install KIES. This was with 64 bit Windows 7.
TIP: The micro usb port is extra deep and my samsung cables don't work, fortunately I have a Kodak one that does.
It motivated to set up wireless adb.
Not getting very far, first I downloaded the SDK, which will not run on my system, might be the AV/FW or something else, but it attempts to find java (which is in the path), and then it does nothing. So I try to go the ClockWorkMod way using the Universal driver (as I saw that should work), that is better as I at least have drivers and it finds my device, but it also will not install throwing a message: "hash for the file is not present in the specified catalog. The file is likely the corrupt or the victim of tampering." Well duh, I modified the inf to get it to find the hardware for the OYUA. I'd just use Google's if I could get a copy without installing the SDK since that is obviously not going to working on this system. Any suggestions, so far while adb works fine with the G3 on this system it appears impossible to setup for the OUYA.
Please note: in C:\Java\jdk1.7u21 is the JDK in c:\java\jre is the JRE. So they are both present and up to date. If I open a command prompt and type java -version it is located and works fine, so no understanding of what "SDK Manager.exe" is doing.
Also, yes I followed the thread as best I could, first copying java into c:\android makes no sense, but I tried it (did nothing), second the adb driver does not require any extraction, where is the usb driver, it must be in a zip somewhere in the SDK for it to be installable, so can I just manually extract it?
Thanks,
ERIC
egandt said:
Not getting very far, first I downloaded the SDK, which will not run on my system, might be the AV/FW or something else, but it attempts to find java (which is in the path), and then it does nothing. So I try to go the ClockWorkMod way using the Universal driver (as I saw that should work), that is better as I at least have drivers and it finds my device, but it also will not install throwing a message: "hash for the file is not present in the specified catalog. The file is likely the corrupt or the victim of tampering." Well duh, I modified the inf to get it to find the hardware for the OYUA. I'd just use Google's if I could get a copy without installing the SDK since that is obviously not going to working on this system. Any suggestions, so far while adb works fine with the G3 on this system it appears impossible to setup for the OUYA.
Please note: in C:\Java\jdk1.7u21 is the JDK in c:\java\jre is the JRE. So they are both present and up to date. If I open a command prompt and type java -version it is located and works fine, so no understanding of what "SDK Manager.exe" is doing.
Also, yes I followed the thread as best I could, first copying java into c:\android makes no sense, but I tried it (did nothing), second the adb driver does not require any extraction, where is the usb driver, it must be in a zip somewhere in the SDK for it to be installable, so can I just manually extract it?
Thanks,
ERIC
Click to expand...
Click to collapse
By G3 do you mean Galaxy S3? If so then hopefully you already have Kies installed. When I connected my OUYA and started all of this, it did not install properly. It showed up twice in device manager, it was installed as a portable device, but was also listed as "other device" and not installed. After a lot of searching,I saw that people had been able to get out working by manually selecting the Samsung adb drivers that are included with Kies. It worked for me. You need to manually select the drivers (have disk) and install OUYA as a MTP device.
Regarding the SDK I know nothing. It installed just fine on Windows 7 for me.
Good luck
Sent from my SCH-I535 using Tapatalk 2
I was able to get ADB to work on Windows 7 64bit and Windows 8 64 bit by installing Samsung KIES and forcing it to use that driver.
eatmybiglazer said:
I was able to get ADB to work on Windows 7 64bit and Windows 8 64 bit by installing Samsung KIES and forcing it to use that driver.
Click to expand...
Click to collapse
Try this driver, got it to work, by selecting i from the list and forcing it
ERIC
Sideloading it relatively trivial for this. It is on by default (and can be toggled the usual way, you can access setting at manage->system->advanced-> security).
I used Real APK Leecher to snag ES File Explorer's APK, threw it on a web server, then downloaded it using OUYA's browser (make->software->browser). Installed it from settings (manage->system->advanced->storage->downloads)
The app then shows up under make->software
I have not tried a pen drive yet, but you could probably throw apks on a drive and use the USB port and install in a similar fashion.
I'm trying to do step 7. I input C:\Android\sdk\platform-tools into comand promt but get not regognizable message. What am I doing wrong?
You need to open the command prompt from wherever within platform-tools, or navigate to that folder from your command prompt. You can't run the adb command (which is located in platform-tools) unless your in that directory.
thanks. hopefully i'll get my OUYA soon. only 1 state away.
I dont get a number after adb devices. I editited the google usb file. Im using the 64 version of android sdk is that ok?
@tcollum: Perhaps you should add this to the OP, I tested and it worked. You can add that ;Ouya to the amd64 section of the USB driver, too
FrostyWolf said:
Sideloading it relatively trivial for this. It is on by default (and can be toggled the usual way, you can access setting at manage->system->advanced-> security).
I used Real APK Leecher to snag ES File Explorer's APK, threw it on a web server, then downloaded it using OUYA's browser (make->software->browser). Installed it from settings (manage->system->advanced->storage->downloads)
The app then shows up under make->software
I have not tried a pen drive yet, but you could probably throw apks on a drive and use the USB port and install in a similar fashion.
Click to expand...
Click to collapse
I just find it easier to ADB over Network and install from my laptop.
Sent from my Nexus 10 using XDA Premium HD app
TadeoNYC said:
My Ouya was listed twice in Device manager and one of them was a driver problem. I manually selected my Samsung adb drivers from the list and it works fine. the easiest way yo get those is to install KIES. This was with 64 bit Windows 7.
TIP: The micro usb port is extra deep and my samsung cables don't work, fortunately I have a Kodak one that does.
It motivated to set up wireless adb.
Click to expand...
Click to collapse
This was a great post...I did what you suggested and selected the latest Samsung ADB Interface driver in the windows list (think it was 23/1//2013) and voila. Thanks!
uncynd said:
This was a great post...I did what you suggested and selected the latest Samsung ADB Interface driver in the windows list (think it was 23/1//2013) and voila. Thanks!
Click to expand...
Click to collapse
You can also do the original USB driver edit in the OP and add it under the amd64 section in the inf file. Its how I did it.
dibblebill said:
You can also do the original USB driver edit in the OP and add it under the amd64 section in the inf file. Its how I did it.
Click to expand...
Click to collapse
Ahh, did not see your post that would have been a lot faster, good advice and maybe should be added to OP?

Issues With Installing Busybox

I've tried using the app from the android store, I even was able to install it through that by mounting /xbin using root explorer and then installing it. The problem with that is when I reboot my phone busybox is no longer installed. So I figure I can install it manually using the adb tools but therein lies the problem. I cannot execute the busybox binary from the data folder. These are my steps to trying:
Code:
adb shell
su
cd /data/local
mkdir busybox
exit
adb push busybox /data/local/busybox
adb shell
su
cd /data/local
chmod 755 busybox
cd /data/local/busybox
./busybox
sh: ./busybox: can't execute: Permission denied
And here I am stuck... btw the binary I downloaded was here: busybox dot net/downloads/binaries/latest/ (under 10 posts cant post links for some reason...) And I downloaded the armv71, which I'm assuming is the right architecture for the moto x. Maybe it's wrong but since the moto x uses a custom architecture, I have no idea what binary to use. Anyways any suggestions would be appreciated.
Well, you're trying to cd to the file rather than the directory containing the file. Not sure if that's the issue or not, but it surely isn't helping.
You have not turned write protect off. Run motowpnomo
Sent from my XT1060 using Tapatalk
Problem was that I was chmodding the directory instead of the binary also I was missing arguments and the directory of installation. (had to mount system as root as well).
Well I was able to get it to install but the problem is the write protection, when I reboot my phone all the files that were in the /system/xbin directory were gone. Unfortunately that program no longer exists, all links point to a "Page Not Found" page. I would rather not download it from an unofficial source so I'm sol unless I can install it through recovery but I have no idea how to go about doing that and I don't see any instructions.
Thanks for the help guys.
Well, I think this is new: just downloaded Stericson's BusyBox Pro installer (as usual) to my Moto X Play on 6.0 Marshmallow and it is asking for the unusual default installation path of "/su/bin". As you know, " system/xbin" or "system/sbin" are usually the preferred installation paths for BusyBox, so this change simply got me stuck in the process thinking where to install BusyBox. My first thought is BusyBox auto-choose where to be installed according to system characteristics and I should go on and just install where it is asking me to, but... I don't know. Does somebody have a similar experience?

How To Guide complete systemwide RW Access in a few simple Steps-Howto

Hello,
I have been bothered for some time that you don't have full RW access on a global level in the system, edit programs or cannot really edit the default. prop or build. prop or the fingerprints. Sure Magisk Module works somehow ... Only this gives you a real RW option and you are a real admin of your own phone.
So here are the instructions
Requirements:
1: Install TWRP, please take the decrypted version Mi11Ultra(Pro)-twrp3.5.1-recovery-21.5.9-decrypted.img
2: Root via Magisk (in my case Canary binary installed via TWRP
3: Download and install Minimal ADB and Fastboot
4: Download Superrepack-arm_64_pie and unzip it into the Minimal ADB and Fastboot folder
5: Start the file MAF32 executable from the Minimal ADB and Fastboot folder. Now enter what comes next in the input window:
adb
push superrepack.arm64_pie/data/local/tmp
adb shell
see below
cd/data/local/tmp
mv superrepack.arm64_pie superrepack
chmod 755 superrepack
stop
./superrepack/dev/block/bootdevice/by-name/super
sync
reboot
You have to repeat this process at least 5 times, and the system is already completely RW in the Root Explorer ect. Just klick on enter again 5 times....
Now you will be able to edit global and systemwide , you can switch RW on RootExplorer on. Edit on the fly is possible again.
There is also another possibility in which the system has to be flashed again manually via Fastboot. If necessary, I would be happy to provide instructions.
greetings
This Tool needs to be downloaded
https://forum.xda-developers.com/attachments/super_image_tools_v15-zip.5303007/
Credits:
@munjeni
[TOOL][WIN,LIN,AND,DARW] Super image tools | extract or make partitions RW in super partition
Disclaimer: Super image tools was made for testing and educational purposes, ME is not responsible for what you do on/with your device using our tools, you must agree that you using our tools on your own risk, I am not responsible for anything...
forum.xda-developers.com
Command doesn't work!
dxy180 said:
Command doesn't work!
Click to expand...
Click to collapse
adb
push superrepack.arm64_pie /data/local/tmp
adb shell
see below
cd /data/local/tmp
mv superrepack.arm64_pie superrepack
chmod 755 superrepack
stop
./superrepack/dev/block/bootdevice/by-name/super
sync
reboot
try now
What would you need this for?
xNAPx said:
What would you need this for?
Click to expand...
Click to collapse
for FULL Systemwide R+W Access .

Categories

Resources