How to root Android device using ADB

How to do things, solutions, recipes, tutorials
Message
Author
User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

How to root Android device using ADB

#1 Post by don570 »

How to root Android device using ADB

adb must be installed. Put in an executable path...

https://docs.google.com/file/d/0B-PSbqQ ... xLU2M/edit

[EDIT] Apparently Java doesn't have to be installed
in your Puppy computer.... but here it is -->
The easy way is with a SFS file.
jdk-1.6u34-i586.sfs (93.73 MB)
I got mine from THIS SITE

but shinobar has a version available as well
http://www.murga-linux.com/puppy/viewtopic.php?t=61287

______________________________________________
ADB: ADB stands for Android Debug Bridge,
and it's a command line tool for your computer that
can communicate with an Android device you've connected
to it. It's part of the Android Software Developers Kit (SDK).
Cheap Chinese-made android devices are being sold in
North America 'rootless' i.e. the user is limited
in seeing and manipulating files. The user must be a superuser
to do advanced file manipulation.
Wikipedia wrote:Rooting is a process allowing users of smartphones,
tablets, and other devices running the Android operating system to attain
privileged control (known as "root access") within Android's subsystem.
Puppy Linux is a good choice to make the Android device 'rooted'

I'll explain how I did it and some other tips I've learned recently.

The latest 'adb' application is available here. Make sure that
it is executable and placed in an executable path such as /usr/bin/

https://docs.google.com/file/d/0B-PSbqQ ... xLU2M/edit

An explanation of 'adb' is here for reference
http://developer.android.com/tools/help/adb.html

Assume that Puppy computer is running and that user
will type commands into a terminal running in Puppy linux
i.e. Puppy is the 'host'

Image

Synchronize your Puppy computer and Android device using
a special USB cable, (an ordinary cable doesn't work apparently).

Here's how to make your own sync cable

Just plug it in. Very simple :lol:


I click on bottom right of Android screen and a popup window
says that debugging is 'connected'. This means that sync cable is recognized and working!! (see picture below)
I am using Android 4.0.4 by the way.

Image


___________________________________________________________


adb allows some simple commands to be executed at the terminal.

adb runs a shell that is similar to bash ---->
With adb installed, launch your terminal and type

Code: Select all

adb shell ls /system/bin
This lists the applications that your android device has installed
inside of it. These are available to you now. Some of
these apps such as rmdir rm touch ls mkdir
should be familiar to you.


Here's how to find what is mounted to your Android device.

Code: Select all

adb shell ls /mnt
Notice that 'sdcard' is mounted. This is where you put ordinary
data normally.

As practice lesson try creating an ordinary file in your Android device

Puppy Linux is acting as 'Host'

Code: Select all

adb shell touch /mnt/sdcard/temp_destroy1
Do a check in your device and you will see that a file has been created!!
and you did it from Puppy!!

'push' and 'pull' of a file is possible. It's equivalent to copying a file.
Here's how....Using Rox filer create a file named temp_destroy2 in /root
Now copy it with the command...

Code: Select all

adb push /root/temp_destroy2 /mnt/sdcard/temp_destroy3
This command copies a file in /root of my puppy computer
to the sdcard of my Android device

Again check to see if the copy has occurred.

______________________________________________


Now you will root your Android device , assuming that
it's not currently.

The software is available HERE

Instructions:

1) open the downloaded archive and place 3 files
Superuser.apk , busybox and su in /root

2) launch terminal

3) type in terminal the following lines....

Code: Select all

adb push Superuser.apk /system/app
adb push busybox /system/xbin
adb push su /system/xbin
adb shell chmod 664 /system/app/Superuser.apk
adb shell chmod 664 /system/xbin/busybox
adb shell chmod 664 /system/xbin/su
adb shell reboot
The final line will reboot your android device only(about 20 seconds)
Your Puppy computer doesn't reboot.

Your Android device will now have an application icon to launch in
superuser mode. This is called 'Rooting the Android device'

____________________________________________________


Here's another tip:

Getting the evb.bin file ..... Got this from Barry Kauler Blog
http://bkhome.org/blog/?viewDetailed=02823

You can extract your device's script.bin while Android is running like this:

Code: Select all

adb shell mkdir /mnt/nanda

adb shell mount -t vfat /dev/block/nanda /mnt/nanda

adb pull /mnt/nanda/script.bin evb.bin
A file called evb.bin will now be seen in /root
script.bin is sort of a hardware config file for Allwinner A10 devices, it sets
things like default output device, screen size, memory info, etc.

_____________________________________________
Last edited by don570 on Tue 27 Nov 2012, 22:24, edited 11 times in total.

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#2 Post by don570 »

Warning !! Changing the name or deleting of files in your
Android device could turn it into a 'Brick'

That could be one of the reasons why the Chinese manufacturers are
selling the devices 'rootless'

_______________________________________________

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#3 Post by don570 »

Forgot to mention that Java must be
installed in puppy operating system.

Best way is to load a SFS file

jdk-1.6u34-i586.sfs (93.73 MB)

http://www.murga-linux.com/puppy/viewtopic.php?t=62939

________________________________________

User avatar
Jejy69
Posts: 710
Joined: Thu 20 Jan 2011, 18:10
Location: Perpignan

#4 Post by Jejy69 »

Already rooted, HTC Wildfire S with CM9 rom. :P

Nice tuto :D

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#5 Post by don570 »

Turorial: Take screenshot of Android device screen

http://murga-linux.com/puppy/viewtopic. ... 077#652077

_______________________________________

User avatar
michaellowe
Posts: 66
Joined: Sat 17 Dec 2011, 08:33
Location: The Garden

adb error: device not found

#6 Post by michaellowe »

HI there I am extremely interested in this topic but I am having problems.
I have tried adb with both jdk7 and jre1.6u35 loaded as sfs separately in Puppy 5.2.5 but to no avail. I am convinced it's not my computer or Puppy that is the problem but rather my cheap chinese android tablet.
Tried typing adb shell ls /system/bin and
adb ls /mnt/sdb(can't remember if this second command is right, but when i typed it I did it right as I was following this tut)
I keep getting error: device not found

I have usb debugging selected in my settings on android device and
I can even mount these 2 directories which Pmount seems to name them as: Linux File-CD Gadget - SDC vfat 1.8G and Linux File-CD Gadget SDD vfat 2.3G I know they are on my android device as I recognised the folders once I mounted these 2 above, however still cant get into the devices system via adb? You mentioned something in your tutorial about the cable? I didn't quite get what you meant:

Synchronize your Puppy computer and Android device using
a special USB cable, (an ordinary cable doesn't work apparently).

Here's how to make your own sync cable:
http://tech2.in.com/how-to/accessories/ ... one/319982


I visited the above link and it just shows you how to make an OTG?
how will an OTG(which I already have) help me connect my tablet to my desktop? I have never come across a Usb to Usb cable which is the only cable that would work with an OTG. If you have please direct me to the nearest outlet? The only thing I have ever used the OTG for is to use external keyboards and mouse etc. with tablet. I would really like to be able to get this working as android operating system on the tablet is usless due to very small amount of both system mem and RAM so I want to root it so I can replace the OS with puppy or saluki or whatever linux OS is suitable for this tablet:
It's called the Superpocket i7 and its model number is P752SD running Android 2.3.3
Baseband version: unknown
Kernel version: 2.6.35.7-infotm
Build number:
m799erb-eng v2.8 eng.infotm.20120410

Any ideas?? help :([/url]

PS. I just connect tablet using a regular mini usb to usb cable like you would with an android phone, my android phone in particular has a micro usb but you know what I mean.
Attachments
adb error device not found.jpg
screenshot of adb shell in terminal
(173.95 KiB) Downloaded 1628 times

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#7 Post by don570 »

There is two ways to synchronize

1) a special micro USB cable ( which is how I did it with included cable)
2) WIFI (explained HERE)


I was fortunate to have the included cable . If a store sells the cable
it will label it a 'sync cable'

Once you have the cable or WIFI connection working correctly
the process is automatic and very simple as I mentioned in
my first post.

Shinobar has a small clock program to check
if JAVA is installed correctly
http://www.murga-linux.com/puppy/viewtopic.php?t=61190


The android operating system shows a message if the
operating system is in the debugging mode.

Image

____________________________________________________

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#8 Post by don570 »

Connecting using wifi is apparently difficult unless your
device is rooted first


Once you have successfully rooted your android device , there is an
app that quickly allows connection using wifi using
a GUI.... called 'adbWireless'

http://www.androidcentral.com/android-q ... b-wireless

________________________________________________

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#9 Post by don570 »

To check if java is working --->

Download shinobar's clock3.tar.gz and decompress
and make the jar application executable
http://www.murga-linux.com/puppy/viewto ... h&id=33755

Type in terminal

Code: Select all

java -jar  /path/to/clock3.jar

______________

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#10 Post by don570 »

I was testing my wireless when I must have damaged some
system file.

When I booted up the tablet I got screen that SDcard wasn't
accessible.

I was able to avoid having to reset the tablet by going through
the instructions on this page to root the device.

To my amazement All my data was still there on the SDcard.
I just had to re-install a few favorite apps like Layer paint
Color Notes and Adobe Reader.

I also discovered a way to backup the data on your sdcard --->

Make a folder to store your backup in a partition that has the free space.
I named it 'Backup_Android'

Code: Select all


mkdir -p /mnt/sdb4/Backup_Android
adb pull /mnt/sdcard/  /mnt/sdb4/Backup_Android

Warning! This is slow because the SD card is slow memory.
Be patient.

__________________________________________

Plume
Posts: 34
Joined: Mon 12 May 2008, 19:05

#11 Post by Plume »

I've got the same "error: device not found" message as michaellowe.
I'm using a standard USB cable but with it, adb succeed to find my device when I'm running Windows XP. So maybe it's not a hardware problem.
Anyway, adb fails to root my phone because it complaints that the filesystem is mounted read-only.
Any idea about this?

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#12 Post by don570 »

Plume wrote:I've got the same "error: device not found" message as michaellowe.
This is a common error. I got it too the first time I attempted to root.
The solution is to get the application 'ADB' to be running.
Because 'ADB' is an application it must be placed in an executable
path which is why I suggest dragging it into /usr/bin/

Java or the Java Development Kit (JDK) must be installed and running
as well.

_________________________________________

Plume
Posts: 34
Joined: Mon 12 May 2008, 19:05

#13 Post by Plume »

Thank's don570 for your answer.

I've done:

Code: Select all

chmod +x adb
and I launch it by:

Code: Select all

./abd
.

I've downloaded clock3 and

Code: Select all

java -jar clock3.jar
give a colorfull clock so Java is installed. But I don't know what you mean by Java must be running.

If I type:

Code: Select all

./adb devices
I get

Code: Select all

* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached 

with an empty device list.

If I type:

Code: Select all

./adb shell
I get

Code: Select all

error: device not found

gcmartin

Android Apps-tools for LAN use with Puppy PC Utility

#14 Post by gcmartin »

Hi @Don570.

This is a tremendous thread as so many of us will be using Android by 2013. And, to be able to put our PUPs to assist us in corralling the sheep is one major step for us in Puppyland.

This may help. I recently found an Android App called FOXFI. It is the easiest to turn an Android into a WiFi Internet router for other PCs that are in its area.

Secondly, I seem to remember an App that allows an Android to be a "file-folder server" (same as Windows/Macs PCs or Linux distros with SAMBA). With a file-folder app that integrates with the LAN devices, it makes it easy to move information around.

If either of these two tools make life any easier in all of the things you're trying to address here, run with it to get us where we need to be.

Again, this is a tremendous step for all of us in Puppyland. Thanks
Here to help

gcmartin

#15 Post by gcmartin »

Hi @Plume
Plume wrote: ... I've downloaded clock3 and

Code: Select all

java -jar clock3.jar
give a colorfull clock so Java is installed. But I don't know what you mean by Java must be running. ...
JAVA is a Linux subsystem. It doesn't do anything, per se. Thus, it is there so that any application that needs it has it "at its fingertips", so to speak.

The "Clock" test you ran ask your LInux to run a "jar" program for you. It did and produced the results you saw on your screen. If JAVA was not present, the result you saw would not have appear and you would have gotten errors to that terminal command.

JAVA is a great ingrediant because it allows an application developed for one platform to run on other platforms. For example an app for Windows will run on Macs which include JAVA OOTB. And, for most/many top 10 Linux, JAVA is an included subsystem.

here to help

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#16 Post by don570 »

Nexus 7 tablet calls it's sync cable an OTG cable

http://www.amazon.com/s/ref=nb_sb_noss? ... =OTG+cable

I wonder if there is any real differences between the cables??

The website I refered to above said that most tablets now
use an OTG cable and here's how it's made ---> Grounding of two terminals

Image

________________________________________

Plume
Posts: 34
Joined: Mon 12 May 2008, 19:05

#17 Post by Plume »

I said previously that adb failed to detect my android device. This was from Puppy 5.2.5 (Lucid Puppy).
From Puppy 5.4.1, adb succeeds to detect my phone. This is obtained with a standard USB cable and with a pristine Puppy, so without java I guess. Fine!

However, /system is always mounted read-only.

Code: Select all

./adb shell /data/local/tmp/busybox mount -o remount,rw /system
says I can't do this because I'm not root (I'm root on Puppy but not on the phone).

Does somebody know how to deal with this on android 2.3.6? I suppose the problem is related to the android version rather than the hardware by itself.

Thank's

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#18 Post by don570 »

Does somebody know how to deal with this on android 2.3.6?
Yes the Android version is important!!

I checked if Java or the Jave development kit (JDK) is needed.

It looks like they aren't needed. Just installing adb application
was good enough.

By the way you should put adb in an executable path so you can
use just 'adb' in the terminal rather than './adb'

Here is the output of my terminal program

Code: Select all

# adb shell ls /mnt
asec
extsd
obb
sdcard
secure
usbhost1



# adb shell ls /
acct
cache
config
d
data
default.prop
dev
etc
init
init.goldfish.rc
init.rc
init.sun5i.rc
init.sun5i.usb.rc
initlogo.rle
mnt
oem
proc
root
sbin
sdcard
sys
system
ueventd.goldfish.rc
ueventd.rc
ueventd.sun5i.rc
vendor


 # adb shell ls /etc/
3g_dongle.cfg
NOTICE.html.gz
apns-conf.xml
audio_effects.conf
bluetooth
camera.cfg
camera_back.cfg
camera_dou.cfg
dbus.conf
dhcpcd
event-log-tags
fallback_fonts.xml
gps
gps.conf
hosts
init.goldfish.sh
media_profiles.xml
mkshrc
permissions
ppp
security
system_fonts.xml
usb_modeswitch.d
usb_modeswitch.sh
vold.fstab
wifi
 



User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#19 Post by 01micko »

Hi don570

A little OT (I did mangae to root my 'droid though :wink: )

There is a really cool app for accessing droids through any capable web browser. airdroid. Just requires your droid is on the same LAN. It works great in Puppy. Just be aware though that it is still in beta, some features hang, requiring a logout, login. Not a big deal.

Cheers
Puppy Linux Blog - contact me for access

nooby
Posts: 10369
Joined: Sun 29 Jun 2008, 19:05
Location: SwedenEurope

#20 Post by nooby »

Would this also work on a SonyEricson smartphone?
I don't have tablet only Smartphone and
what about a Huawei smartphone?

Could my android be too old though? I have not tested
B/C I am too afraid to brick them :)
I use Google Search on Puppy Forum
not an ideal solution though

Post Reply