Get detailed information about the type of RAM on your PC

wmic MEMORYCHIP get >data.txt
start data.txt

You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.

Cleaning a virus that makes the whole removable disk read-only.

Once before, I’ve encountered a virus that transfers the entire contents of the usb removable disk to a folder with a blank filename, and then creates a self-running link in the root directory that copies the virus to the hard disk, so that it propogates itself to any new removable disk that is connected. But this was a new breed that made the removable usb drive read-only, so much so that most except the most hard core linux utilities would fail to fix it. A friend had handed the disk over to me, requesting me to see if my “linux PC can fix it”.

The command which fixed the write protect status was:

sudo blockdev --setrw /dev/sdc1

This allowed me to remount it as read-write:

sudo mount -o rw,remount /dev/sdc1 /home/joel/usb

so that I could finally run clamscan and fix it:

clamscan --remove /home/joel/usb

To rename the folder with a blank space as name, I simply used:

mv '/home/joel/usb/ ' /home/joel/usb/ab

You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.

Install and use tightvnc viewer on Ubuntu

We’ll assume that you have a server running tightvnc server. If you dont, search this site for tutorials on the same.

Now, on the client PC, install xtightvncviewer to connect to the server:

sudo apt-get install xtightvncviewer

Connect with:

xtightvncviewer 3.45.212.2::5901

here, 3.45.212.2 is the ip of the server, and 5901 is the port (default tightvnc server port).


You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.

Remove duplicate files from Google Drive

Early on while trying to sync Google Drive to my PC, it got filled with multiple duplicate files. Recently I created a method to remove these duplicates.

First, we’ll install a program called grive to sync Google Drive to a server:

apt-get install git cmake libgcrypt11-dev libjson0-dev libcurl4-openssl-dev libexpat1-dev libboost-filesystem-dev libboost-program-options-dev libboost-all-dev build-essential automake autoconf libtool pkg-config libcurl4-openssl-dev intltool libxml2-dev libgtk2.0-dev libnotify-dev libglib2.0-dev libevent-dev checkinstall 

Install qt4 (Required for cmake for Boost):

libqt4-core libqt4-dev libqt4-gui qt4-dev-tools

Clone the script:

git clone git://github.com/lloyd/yajl yajl
cd yajl
./configure && cmake . && make && checkinstall
cd ..
git clone git://github.com/Grive/grive.git
cd ./grive
./configure && cmake . && make
cp grive/grive /usr/bin/
mkdir ~/Gdrive
cd ~/Gdrive/
grive -a

At this point, follow instructions by copying the generated link and authenticating with Google.
Now Google Drive will sync for the first time

We will now install a program called fdupes which can detect duplicate files recursively and remove them easily.

apt-get install fdupes
cd ~/Gdrive
fdupes -rdN /root/Gdrive

Now sync the changes from local directory to remote by running grive:

grive

You may wish to do a dry run without the dN options to check that it deletes the correct files.


You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.

Running graphical programs on a remote server

This tutorial walks through setting up a remote VNC session to control the desktop of your VPS. Using it, you can control programs like Firefox, Google Chrome. My favourite use is running Firefox to download a huge file remotely from a file sharing site like Hotfile. Downloading it normally on my home PC takes ages, during which Hotfile usually disconnects me.

Steps:

Install an OS on your VPS.

Update and upgrade your packages:

# apt-get update
# apt-get upgrade

Installing for Gnome:

apt-get install ubuntu-desktop
apt-get install gdm
service gdm start
apt-get install tightvncserver
vncserver :1 -geometry 1366x768
vncserver -kill :1
vi  ~/.vnc/xstartup

Add the following to the bottom of that file:

gnome-session &

Now start the server:

vncserver :1 -geometry 1024x768

Install TightVNC Windows client on your PC.

Run TightVNC Viewer, and add the following details, click Connect:

  • IP Address: [your server’s main IP]
  • Port: 5901 (or 5901, 5902 for desktop :2, etc)
  • Password: [password you set earlier]

Instructions for KDE:

apt-get install kubuntu-desktop
apt-get install kdm
service kdm start
apt-get install tightvncserver
vncserver :1 -geometry 1366x768
vncserver -kill :1
vi  ~/.vnc/xstartup

Add the following to the bottom of that file:

startkde &

Now start the server:

vncserver :1 -geometry 1024x768

Install TightVNC Windows client on your PC.

Run TightVNC Viewer, and add the following details, click Connect:

  • IP Address: [your server’s main IP]
  • Port: 5901 (or 5901, 5902 for desktop :2, etc)
  • Password: [password you set earlier]

 


You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.
Using USB Mass storage mode on Galaxy Note 2

Using USB Mass storage mode on Galaxy Note 2

Update: This is the easiest way to enable Mass storage mode on the Note 2. You don’t need to install any third party apps. It also works on Jellybean 4.1.2 and later, as this re-enables the officially withdrawn USB Storage mode support by reversing the process by which Google had disabled it.

So, maybe you’ve noticed that your sweet beast of a phone no longer supports USB Mass storage mode (you know how you used to be able to access the whole sdcard on your PC while your phone was connected via cable). It’s a change that Google has mandated for newer Android versions. On Windows, you now have the MTP mode where you get partial access to both internal and external sd cards, however it’s a far limited option than Mass storage mode. On Linux, the situation is awful. You dont have access to anything.

Fret not! It’s easy to switch back to USB Mass storage mode. It’s as easy as tapping on a widget on your home screen. You just need to prepare your phone first.

You need to be rooted. You can either run the script as a widget shortcut, or can run the script by typing its name in a Terminal emulator on the phone.

Create the following script on your PC and name it mtpstorage:

#!/system/bin/bash
echo "" > /sys/devices/platform/s3c-usbgadget/gadget/lun0/file
vold
setprop persist.sys.usb.config mtp,adb

Create another file and name it usbstorage:

#!/system/bin/bash
setprop persist.sys.usb.config mass_storage,adb
echo /dev/block/vold/179:17 > /sys/devices/platform/s3c-usbgadget/gadget/lun0/file

When the second script  (usbstorage) runs, it allows mounting your sdcard on your PC as a mass storage device. The first script reverses the change, and makes MTP mode active again.

Download the scripts:

Download “usbstorage” usbstorage – Downloaded 319 times – 150 B


Download “mtpstorage” mtpstorage – Downloaded 195 times – 126 B

And run:

adb push usbstorage /sdcard/
adb push mtpstorage /sdcard/
su
mount -o rw,remount /system
cp /sdcard/usbstorage /system/xbin/
cp /sdcard/mtpstorage /system/xbin/
chmod 755 /system/xbin/usbstorage /system/xbin/mtpstorage

To get the ease of using a widget, install SManager from the Market.

Now, transfer the two scripts to a location on your phone. I used /system/scripts.

Now in SManager, choose the two files, one at a time. Click on the Skull and Bones icon to select Root mode (su mode). Now, choose to “Save”.

Screenshot_2013-02-17-21-23-56

Once done, you can now view the two scripts under the Menu>Scripts window.

Screenshot_2013-02-17-21-24-06

You’re all set. You can now drop widgets onto the Home screen to do this easily. For this, just long press your Homescreen, Swipe to select widgets and Choose SM Widget:

1Screenshot_2013-02-17-21-37-38

 

Drag to your homescreen.
1Screenshot_2013-02-17-21-29-25

Now, when you need USB Storage mode, simply tap on the “USB Storage” icon, and your sdcard will immediately show up in Windows Explorer or the Linux device notifier. When you’re done, tap the “MTP mode” shortcut.

 

Credits for technique:

d4fseeker‘s post on XDA

 


You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.

Transfer, export and import Putty sessions

Just execute the following as a batch file.

Puttyexporter.cmd

regedit /e %homepath%\Desktop\puttyexport.reg HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions

This creates a .reg file on your desktop. Import it into the target PC to transfer settings.

If you need to sync with Dropbox:

regedit /e %homepath%\Dropbox\Putty\puttyexport.reg HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions

 


You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.
Using Keepass with Chrome and Firefox

Using Keepass with Chrome and Firefox

Keepass, an open source software, is arguably one of the best password management tools available. My personal favorite is Lastpass for the sheer number of available features, and because of close integration with Chrome. Keepass however seems to have a few issues with Chrome, though Firefox integration with the Keefox extension is perfect.

Edit:
Newer steps for installation of chromipass on Linux Mint 18.1 Serena (updated April 2017):
1. Install Chromipass for Chrome.
2. Visit keepassxc-debian github page and get the latest .deb packages.

https://github.com/magkopian/keepassxc-debian/releases/download/2.1.4-1/keepassxc_2.1.4-1_amd64_stable.deb

3. Install the deb:

sudo dpkg -i keepassxc_2.1.4-1_amd64_stable.deb

4. Open keepassxc, open your database and enter password or choose key file.
5. Install mono-complete
apt-get install mono-complete
6. Download keepass http:

wget https://raw.github.com/pfn/keepasshttp/master/KeePassHttp.plgx
sudo cp KeePassHttp.plgx /usr/lib/keepass2/
sudo chmod 644 /usr/lib/keepass2/KeePassHttp.plgx

Older article:
This article explains how to install Keepass on Windows and Linux, and has been tested to work with Keepass 2.22, and Windows 8 64 bit, Ubuntu 12.10 and Debian Squeeze.

To use Keypass with your browsers:

How to install and use Keepass on Windows 7 and 8

The following article applies to Windows 7/8. For Linux info, skip to the end.

How to install and use Keepass on Windows 7 and 8 on Firefox:

Install the latest Keepass installer

Install Keefox extension

Run Keepass, create a database, and add either a Master password or Master Password+Composite key (This is a composite key. Both Key and password will be required), or just a Key.

Import your prior passwords (If using Lastpass, export from Lastpass to a .csv file, and then import the .csv file into Keepass, using the  Keepass menu>Import>Generic csv importer.

Save the key database (Only on saving does your master password and key file get updated into the database).

Now, on running Firefox, Keepass and Keefox will connect.

How to install and use Keepass on Windows 7 and 8 on Chrome/Chromium:

Install the latest Keepass installer

Install Chromipass extension from the Chrome web store.

Download KeePassHttp.plgx from the Github repo here. (If you omit this step, you will get a “KeePassHttp: Error: NETWORK_ERR: XMLHttpRequest Exception 101” error.

Copy the downloaded file to C:\Program Files (x86)\KeePass Password Safe 2\plugins (for 64 bit Win7/8). You can use the environment variable:

%PROGRAMFILES(X86)%\KeePass Password Safe 2
MWSnap004 2013-04-14, 10_19_41

The easiest way to get the correct location is probably to choose Keefox options from Firefox, and look at the Keepass Tab.

Now visit any site with a username/password field, Click on the small Chromipass icon and follow the prompts to Connect Chromipass and Keypass.

Run Keepass, create a database, and add either a Master password or Master Password+Composite key (This is a composite key. Both Key and password will be required), or just a Key.

Import your prior passwords (If using Lastpass, export from Lastpass to a .csv file, and then import the .csv file into Keepass, using the  Keepass menu>Import>Generic csv importer.

Save the key database (Only on saving does your master password and key file get updated into the database).

Common errors and their solutions:

Error #1: Unable to start HttpListener: System.Net.HttpListenerException (0x80004005): Failed to listen on Prefix ‘http://localhost:19455/’ because it conflicts with an existing registation on the machine.

The error is due to two copies of the file KeePassHttp.plgx. In my case, I had one at C:\Program Files (x86)\KeePass Password Safe 2\plugins, and another one at C:\Program Files (x86)\KeePass Password Safe 2. I deleted the latter, and the error disappeared.

Installing Keepass in Ubuntu 12.10:

Firefox

Install Keepass from the Ubuntu repo. Install latest Firefox from Mozilla. Now download and install the Keefox plugin for Firefox. Manually copy the .pglx file from the Firefox profile folder to /usr/lib/keepass2 (as suggested by the extension). Open up Keepass2 and then Firefox. Opening the database links them up.

sudo add-apt-repository ppa:jtaylor/keepass
sudo apt-get install mono-complete
sudo apt-get install keepass2
sudo cp [email protected]/deps/KeePassRPC.plgx /usr/lib/keepass2/

Note: You need to use the correct path as applicable to your PC.

Chrome

Association of Chrome with Chromipass and Keepass2 is buggy. It works on some sites but not on others. The author himself states that he was unable to associate these properly with the .pglx extension. The steps are the same. Get the specific files from Github, copy them to /usr/lib, install Keepass2 from the repo, and Chromipass from Chrome web store.

Note that the folder /usr/lib should contain the following files:

$l /usr/lib/keepass2/
total 2.4M
-rw-r--r-- 1 root root  252 Sep 28  2007 KeePass.config.xml
-rwxr-xr-x 1 root root 1.8M Sep 23 05:43 KeePass.exe
-rw-r--r-- 1 root root  535 May  1  2012 KeePass.exe.config
-rw-r--r-- 1 root root 180K Jan  7 09:53 KeePassHttp.plgx
-rw-r--r-- 1 root root 370K Jan  7 09:59 KeePassRPC.plgx

 

Once you’ve done this, reloading the browser asks for association.

Note that autofilling does not usually work in Chrome on Linux with Keepass2 and Chromipass. You can check if right clicking works.

Selection_001


You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.

Everything about ADB – Android Debug Bridge for Beginners

 

TUTORIAL – EVERYTHING ABOUT ADB – Fully Illustrated



1. WHAT IS ADB?

ADB or Android Debug Bridge is a command line program which is used to communicate with your Android phone (or an emulator used by programmers). The use of Adb for Android phone users ranges from using it as a tool to get the logcat- A realtime log of the Android system, which allows one to know the cause of any errors. It is very helpful to app hackers to know exctly what block of code does what, and to modify apps accordingly

2. HOW TO USE ADB – Running adb.exe

adb.exe is part of a package of tools called Android SDK or Software Development Kit. For users, the main applications useful for them are adb.exe, fastboot.exe and aapt.exe.

2.1 Installing adb.exe (Windows)

  1. First, download the Android SDK package(exe file) from here The installer will prompt you to download and install the JDK (Java Development Kit) if you dont have it already installed
  • Next install the exe file and note the location where you install it to.
  • After install is over, use Windows explorer and navigate to the folder where you installed the SDK.
  • Double-click the SDK Manager.exe/SDK Setup.exe file at the root of the Android SDK directory.
  • This will open up the SDK Installation window, where you can choose from a list of packages to install
  • If you want to use only adb.exe and fastboot.exe, choose to install only the “Android SDK Tools” from the list (See fig 1 below)
  • That’s it, adb.exe is now installed

 

Fig1:

Take a note of where you install it. It usually installs to a folder named Android-sdk-windows. Once you have it installed, you can copy the entire folder on a portable usb key/CD and use it on any other PC without a need to install it. I recommend that you make it a part of your Android CD (with rooting tools, unrooting tools, gold card etc).

2.2 Using adb.exe-Preparing your PC for running adb.exe quickly

Adding Adb to your Windows Path
Once installed, you should add the location of adb.exe to the* Windows Environment Path variable. To do that, go the subfolder of Android-sdk-windows where adb.exe can be found. Click on the Windows Explorer path displayed on Top, and copy the path to the Clipboard

Go to Start Menu, and Right click Computer, Choose Properties

Choose Advanced System Settings and then Environment variables

Now, add the Location you copied to the Clipboard earlier, to the end of the current path, after adding a “;”(without the quotes) to the end of the current path.

So, in my case, the current path shows:
c:droidzonewindows; c:droidzoneblahblah

It now becomes:
c:droidzonewindows; c:droidzoneblahblah;C:SoftwarePhoneandroid-sdk-windowstools

Hit Enter to everything.

From now, whenever you open a Command prompt in Windows, you will be able to execute Adb and Fastboot from there without needing to navigate to the folder where they are installed.

Default Elementary Adb commands

Ok, now that you’ve got adb all setup and prepared your computer to use it, you’re ready to learn some basic adb commands. I’ll be teaching some of them in this section.


Understanding how adb and the shell works

Let’s first check if adb is working by asking it to communicate with our phone. Connect the phone with a usb cable to the PC. Note that you should have installed the HTC drivers already (They come with HTC Sync). Another important point to note is that you should have enabled USB Debugging on your phone (Menu>Settings>Applications>Development>USB Debugging)

From your Windows Start Menu, Click on Run, then type the following and press enter. That should open a command shell:

 

Code:
cmd[/code]

Once there, type out the following:

 

Code:
adb devices[/code]

This will display a list showing the connected phones with their serial numbers (and emulators-But let us not worry about what these are, right now)

Great, now we have confirmation that adb is working! We're now ready to issue our basic commands.

First thing to note is the basic command to enter the Android custom linux shell. Like Windows has cmd.exe to enter the dos shell, the graphical eyecandy with Sense overlay that you see on your device has a custom linux kernel running, so basically the language of its shell is the Linux shell language.

Accessing the Linux terminal (adb shell) is what we do to issue commands. To enter the shell of our device, the basic command is:

 

Code:
adb shell[/code]

Immediately, you will get a prompt like this:

Code:
sh-3.2#[/code]

Now we can type out any (most) linux commands and these will be executed in our device.

The file system on Android is laid out over MTD partitions in your device's NAND (Internal memory), and the SD card. The Nand is strictly organized in a Linux system with Linux file permissions and ownership rights (Just know that these exist, for now)

So, right now, you will be dropped in the "root" of the filesystem, from where you can navigate to other places.

 

Note! An important difference between Linux and Windows is that while Windows uses the Backslash (), Linux/Android uses the forward slash (/) to depict directory hierarchies. Another one you shouldnt forget is that in Linux/Android, a file named boot.img is different from Boot.img, BOOT.IMG and BoOt.img, while on Windows, they are all the same.

 

My tutorial is about adb commands, and not linux, so I'll give only a short summary of elementary linux commands below. I will expand the list and explanation for this at a later date if you require it:

pwd-Shows the current working directory
cp-copy a file
mv-move a file (copy a file and then delete the original file)
chmod-set file permissions
chown-set file ownerships
rm-delete a file
cd-change directory
rmdir-delete a directory


Elementary Adb commands

Installing applications with adb
You can install any apk from your PC to the phone very easily. Open a cmd shell, and then type in:

Code:
adb install[/code]

followed by a space. Now drag an apk file in Windows explorer to the shell we have opened. Immediately, the path of the file becomes inserted in our prompt that it becomes:

 

Code:
adb install C:DesktopTitaniumBackup.apk[/code]

assuming that the file TitaniumBackup.apk was present in the location C:Desktop. Hit enter and you will notice that it gets installed.

Transferring files to the sdcard without connecting the device as Disk drive:

 

Code:
adb push C:DesktopTitaniumBackup.apk /sdcard/[/code]

will trasfer the file C:DesktopTitaniumBackup.apk to the root (main) directory of your sdcard. Likewise, you can transfer any file from the PC to any location on your device.

Eg: I want to transfer a file called wallpaper.zip to a location /data/local. The command would be:

 

Code:
adb push C:Desktopwallpaper.zip /data/local/[/code]
More elementary adb commands:

Getting a file from your phone to your PC:

To get a file /system/etc/init.d/01data to your PC, you would type out the following:

 

Code:
adb pull /system/etc/init.d/01data[/code]

which will transfer the spcified file to the location on your pc where you have opened the cmd.exe shell.

Mounting the system partition as Read Write to transfer files to your /system partition:

Method 1:

 

Code:
adb remount[/code]

Method 2:
This can also be accomplished with the more advanced mount command in the adb shell. First we need to know the mount point of the partitions.

Type:

Code:
adb shell
mount[/code]

For me, it displays:

Code:
rootfs / rootfs rw,relatime 0 0
tmpfs /dev tmpfs rw,relatime,mode=755 0 0
devpts /dev/pts devpts rw,relatime,mode=600 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,relatime 0 0
/sys/kernel/debug /sys/kernel/debug debugfs rw,relatime 0 0
none /acct cgroup rw,relatime,cpuacct 0 0
tmpfs /mnt/asec tmpfs rw,relatime,mode=755,gid=1000 0 0
tmpfs /mnt/obb tmpfs rw,relatime,mode=755,gid=1000 0 0
tmpfs /app-cache tmpfs rw,relatime,size=8192k,mode=755,gid=1000 0 0
none /dev/cpuctl cgroup rw,relatime,cpu 0 0
/dev/block/mtdblock3 /system yaffs2 ro,relatime 0 0
/dev/block/mtdblock4 /cache yaffs2 rw,nosuid,nodev,relatime 0 0
/dev/block/mtdblock5 /system/data yaffs2 rw,nosuid,nodev,noatime,nodiratime 0 0
/dev/block/mmcblk0p2 /data ext4 rw,nosuid,nodev,noatime,nodiratime,commit=50,bar
rier=0,stripe=64,data=ordered,noauto_da_alloc 0 0
/dev/block/vold/179:1 /mnt/sdcard vfat rw,dirsync,nosuid,nodev,noexec,relatime,u
id=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset
=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/block/vold/179:1 /mnt/secure/asec vfat rw,dirsync,nosuid,nodev,noexec,relat
ime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,ioch
arset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
tmpfs /mnt/sdcard/.android_secure tmpfs ro,relatime,size=0k,mode=000 0 0
sh-3.2#[/code]

Note that the entry for system partition shows:
/dev/block/mtdblock3 /system yaffs2 ro,relatime 0 0

The ro means that /system is mounted as RO-i.e Read Only. The whole line means that the Nand MTD block device on /dev/block/mtdblock3 is mounted on the mount point /system, to use technical jargon.

We need to mount it as RW (Read Write)
The command is:

Code:
mount -o rw,remount /dev/block/mtdblock3 /system[/code]
This essentially mounts the /system as Read Write so that you can write to it (Normally you cant write to the /system partition), which is what "adb remount " also does. However the commands above can be executed from a Terminal Emulator application too. Next: Getting an Adb logcat [/code]
Getting an adb logcat

Many a time, you might have heard people telling you to get a logcat to report your error with a Rom installation.

What is a logcat?

A logcat is a report from the Android logging system, which takes place in the background the whole time your phone is on. It starts the moment you switch on the phone, and continues till you shut it down completely. This log is extremely useful for finding out what went wrong with your system. It is useful to find out why your phone is having bootloops or force closes. It is infact useful for all errors!

How to get the logcat?
Basically, you can view the logcat log with the following command:

[/code]

Code:

 

adb logcat[/code]
[/code]
But that means getting overwhelmed by an endless haze of output flowing at a rate that you cant read and will overwhelm your command shell's capacity very soon. So the system we normally use is to output the log to a file from which we can read later. This is done by the following command:

[/code]

Code:
adb logcat > log.txt[/code]
[/code]
My Technique As a Rom developer and apk patcher, I have to constantly check for errors in my system. So I've devised an ingenous method to easily log logcat, and view them readily. I use a combo of commands executed in succession:

[/code]

Code:
adb kill-server
echo "" > log.txt
start log.txt
adb logcat > log.txt[/code]

These commands essentially create a blank file named log.txt in the same path as the command shell you've opened. Then, it opens the file log.txt (which is blank at this point of time. Then it logs logcat output to that file. Once you refresh the opened file, it will show the output of logcat to this point of time. Refresh it once again, and it updates once more. You should install Notepad++ and associate .txt files with it, to get best results. Instead of executing these four commands, you can download the batch file getlog.cmd and extract it from the zip file to the folder containing adb.exe. Once you type in the following command (from anywhere in Windows), you will achieve the same result as typing the four commands as above! Ingenious, eh?

Default Summary of other adb commands
[/code]
 


 

[/code]

The following is the exhaustive list of commands supported by adb. You can obtain this list by the following command:

Code:
adb /?[/code]
Code:
C:Users>adb /?
Android Debug Bridge version 1.0.26

-d - directs command to the only connected USB devic
e
returns an error if more than one USB device is
present.
-e - directs command to the only running emulator.
returns an error if more than one emulator is r
unning.
-s <serial number> - directs command to the USB device or emulator w
ith
the given serial number. Overrides ANDROID_SERI
AL
environment variable.
-p <product name or path> - simple product name like 'sooner', or
a relative/absolute path to a product
out directory like 'out/target/product/sooner'.

If -p is not specified, the ANDROID_PRODUCT_OUT

environment variable is used, which must
be an absolute path.
devices - list all connected devices
connect <host>:<port> - connect to a device via TCP/IP
disconnect <host>:<port> - disconnect from a TCP/IP device

device commands:
adb push <local> <remote> - copy file/dir to device
adb pull <remote> [<local>] - copy file/dir from device
adb sync [ <directory> ] - copy host->device only if changed
(see 'adb help all')
adb shell - run remote shell interactively
adb shell <command> - run remote shell command
adb emu <command> - run emulator console command
adb logcat [ <filter-spec> ] - View device log
adb forward <local> <remote> - forward socket connections
forward specs are one of:
tcp:<port>
localabstract:<unix domain socket name>
localreserved:<unix domain socket name>
localfilesystem:<unix domain socket name>
dev:<character device name>
jdwp:<process pid> (remote only)
adb jdwp - list PIDs of processes hosting a JDWP transport

adb install [-l] [-r] [-s] <file> - push this package file to the device and i
nstall it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data
)
('-s' means install on SD card instead of inter
nal storage)
adb uninstall [-k] <package> - remove this app package from the device
('-k' means keep the data and cache directories
)
adb bugreport - return all information from the device
that should be included in a bug report.

adb help - show this help message
adb version - show version num

DATAOPTS:
(no option) - don't touch the data partition
-w - wipe the data partition
-d - flash the data partition

scripting:
adb wait-for-device - block until device is online
adb start-server - ensure that there is a server running
adb kill-server - kill the server if it is running
adb get-state - prints: offline | bootloader | device
adb get-serialno - prints: <serial-number>
adb status-window - continuously print device status for a specifie
d device
adb remount - remounts the /system partition on the device re
ad-write
adb reboot [bootloader|recovery] - reboots the device, optionally into the boo
tloader or recovery program
adb reboot-bootloader - reboots the device into the bootloader
adb root - restarts the adbd daemon with root permissions
adb usb - restarts the adbd daemon listening on USB
adb tcpip <port> - restarts the adbd daemon listening on TCP on th
e specified port
networking:
adb ppp <tty> [parameters] - Run PPP over USB.
Note: you should not automatically start a PPP connection.
<tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
[parameters] - Eg. defaultroute debug dump local notty usepeerdns

adb sync notes: adb sync [ <directory> ]
<localdir> can be interpreted in several ways:

- If <directory> is not specified, both /system and /data partitions will be u
pdated.

- If it is "system" or "data", only the corresponding partition
is updated.[/code]

I will add notes for these if you require them.

 


You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.