[JiaYu S3 Guides, News, & Discussion] aus9:
Credits

-to be expanded with other member input

vampirefo - for help with Linux and adb

Introduction

This is meant to be a step by step instruction for new to Linux users on how to set up adb with a Linux PC and

our Jiayu S3 device. Fastboot will be a separate thread. Windows users may find this thread useful?

http://xdaforums.com/showthread.php?t=2266638

This is not meant to be a tutorial on how to use adb. adb is a powerful tool and so do so at your own risk.

In code boxes, they act the same as Android $ = non-root user # means you are root.

Linux PC preparation.

How to Install adb?

Use your package manager to check for it. I am running XFCE desktop variant of Ubuntu 64 bit

which is called Xubuntu. XFCE has smaller packages than say the KDE variant.

So I will give *buntu style instructions but offer other distro advice.

Open your software manager and search for "android-tools-adb" without the quotes please.

Some distros call it android-tools.

[IMG="software mgr"]http://oi61.tinypic.com/2a8n9j6.jpg[/IMG]

If you have a Debian/*buntu style based distro you can also check if its installed in a terminal like this

$ dpkg -l | grep adb

No response means its not installed.

Most modern distros allow you copy and paste commands from your web browser to a terminal. Some use pull down menus

otherwise highlight the command and in the terminal push down the wheel mouse.

If you have no wheel mouse press down both left and right buttons at the same time.

If its not installed use your manager to install it or use a terminal command to install it such as

$ sudo apt-get update (input your login password)
sudo apt-get install android-tools-adb

2) Are you a member of the adb users group?

Actually I don't care as we will make a udev rule that will give us root powers.

3) Jiayu specific adb usb driver?

Linux does not use such a beast but we still need some way of communicating and we use software called udev.

Udev should be installed for 90% or more of all major Linux distributions (distros) but I know of some exceptions

such as Tinycorelinux and Linuxfromscratch. Not all distros aim to be general purpose so there is no shame if udev is not installed.

If udev is not installed then install it ---easy yes?

We create a file that udev can use called.....with contents as per quote box

/etc/udev/rules.d/55-jiayu.rules

copy and paste contents into a root powered text editor and save the file as ....the file name nominated please.

If you don't know the name of your text editor etc you can try a command

sudo echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", MODE="666", GROUP="plugdev" ' > /etc/udev/rules.d/55-jiayu.rules

But we might as well use a command to add our phone to the ini file a text file in a dot folder under home directory

This does not need a sudo command as we own this file

echo "0x0bb4" > .android/adb_usb.ini

4) Restart udev for Ubuntu style distros with

$ sudo service udev restart

(output is )udev stop/waiting
udev start/running, process 2116t

for some distros,

$ sudo udevadm control --reload-rules

Other phones can share the same Vendor ID. This is because of the contents of files included in the boot image,

called init.usb.rc with contents including this line

You may notice that I have used lowercase 0bb4 in my rules file and it works fine.

Note some distros do not use sudo to gain root power commands. They would instead run a command like this

su - (input root password)
udevadm control --reload-rules

5) Android Preparation

We need a data cable usb.

6) We need to ensure that root has been activated in our device. Check it with

Settings -> Security -> Superuser is on (green slider)

[IMG="superuser"]http://oi58.tinypic.com/9tizv7.jpg[/IMG]

7) We need USB debugging we check it by turning on developer mode by

Settings -> about phone -> Tap build number about 7 times

Go into new menu

Settings -> Developer Options -> Debugging -> USB debugging turn on (green slider)

8) Our phone boot image contains default.prop which contains this line

ro.adb.secure=1

This means Android will require authorization before adb will work on Linux

This same section at (7) has a config for Revoking previous authorizations for USB debugging,

if you have changed computers.

Lets Do It!

9) Connect cable between our phone and PC

10) On phone choose option USB storage.

11) You should now see a popup on your phone seeking authorization to continue.

I prefer you click the box so you don't have to see this popup again and click OK

12) Now back to Linux in the terminal start the adb action with a command as a non-root user

adb devices

You must see this image.

13) If you see below image, I have failed you. Re-check you have completed all steps

post your distro and we shall see if I can help you, or others.

Don't forget to restart udev if you need to change an udev rule and KILL adb with

adb kill-server

before trying again

Reasons may include

a) You have not enabled USB debugging on phone

b) You have not authorized PC

c) Your Linux udev rule contains an error

d) You did not choose USB storage on connection

14) Linux PC and phone usb storage enabled....gives file manager access to sdcard (/storage/sdcard1)

so its not available to adb at the same time,

--we can write files to internal storage.

15) Alternatively, on phone do NOT turn off usb storage but un-mount the storage you see in Linux.

This is a cheap trick I learnt. It is intended only if you need to write files from PC to sdcard,

while adb is running. If you are only pulling files from /system etc then ignore my advice.

########################################

This is not a tutorial on all adb commands.

Run command

adb --help

(to see help in the terminal)

Example of adb

$ adb shell su -c "dd if=/dev/block/platform/mtk-msdc.0/by-name/boot of=/storage/sdcard1/boot.img"
32768+0 records in
32768+0 records out
16777216 bytes transferred in 2.508 secs (6689480 bytes/sec