Tuesday, 2 December 2014

ADB Android Debug Bridge Commands

Android Debug Bridge version 1.0.31

 -d                            - directs command to the only connected USB device
                                 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 running.
 -s          - directs command to the device or emulator with the given
                                 serial number or qualifier. Overrides ANDROID_SERIAL
                                 environment variable.
 -p     - 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 [-l]                  - list all connected devices
                                 ('-l' will also list device qualifiers)
 connect [:]       - connect to a device via TCP/IP
                                 Port 5555 is used by default if no port number is specified.
 disconnect [[:]]  - disconnect from a TCP/IP device.
                                 Port 5555 is used by default if no port number is specified.
                                 Using this command with no additional arguments
                                 will disconnect from all connected TCP/IP devices.

device commands:
  adb push    - copy file/dir to device
  adb pull []  - copy file/dir from device
  adb sync [ ]     - copy host->device only if changed
                                 (-l means list but don't copy)
                                 (see 'adb help all')
  adb shell                    - run remote shell interactively
  adb shell          - run remote shell command
  adb emu            - run emulator console command
  adb logcat [ ] - View device log
  adb forward - forward socket connections
                                 forward specs are one of:
                                   jdwp: (remote only)
  adb jdwp                     - list PIDs of processes hosting a JDWP transport
  adb install [-l] [-r] [-s] [--algo --key --iv ]
                               - push this package file to the device and install it
                                 ('-l' means forward-lock the app)
                                 ('-r' means reinstall the app, keeping its data)
                                 ('-s' means install on SD card instead of internal storage)
                                 ('--algo', '--key', and '--iv' mean the file is encrypted already)
  adb uninstall [-k] - 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 backup [-f ] [-apk|-noapk] [-shared|-noshared] [-all] [-system|-nosystem] []
                               - write an archive of the device's data to .
                                 If no -f option is supplied then the data is written
                                 to "backup.ab" in the current directory.
                                 (-apk|-noapk enable/disable backup of the .apks themselves
                                    in the archive; the default is noapk.)
                                 (-shared|-noshared enable/disable backup of the device's
                                    shared storage / SD card contents; the default is noshared.)
                                 (-all means to back up all installed applications)
                                 (-system|-nosystem toggles whether -all automatically includes
                                    system applications; the default is to include system apps)
                                 ( is the list of applications to be backed up.  If
                                    the -all or -shared flags are passed, then the package
                                    list is optional.  Applications explicitly given on the
                                    command line will be included even if -nosystem would
                                    ordinarily cause them to be omitted.)

  adb restore           - restore device contents from the backup archive

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

  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:
  adb get-devpath              - prints:
  adb status-window            - continuously print device status for a specified device
  adb remount                  - remounts the /system partition on the device read-write
  adb reboot [bootloader|recovery] - reboots the device, optionally into the bootloader 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             - restarts the adbd daemon listening on TCP on the specified port

  adb ppp [parameters]   - Run PPP over USB.
 Note: you should not automatically start a PPP connection.
  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 [ ]
  can be interpreted in several ways:

  - If is not specified, both /system and /data partitions will be updated.

  - If it is "system" or "data", only the corresponding partition
    is updated.

environmental variables:
  ADB_TRACE                    - Print debug information. A comma separated list of the following values
                                 1 or all, adb, sockets, packets, rwx, usb, sync, sysdeps, transport, jdwp
  ANDROID_SERIAL               - The serial number to connect to. -s takes priority over this if given.
  ANDROID_LOG_TAGS             - When used with the logcat option, only these debug tags are printed.

Wednesday, 26 November 2014

How to Unlock / Flash a HTC DESIRE S with a new ANDROID KITKAT ROM

Firstly, enable USB debugging, and to install from UNKNOWN sources

Next, install the HTC SYNC app on a pc

This will install the HTC SYNC app, and also the HTC USB drivers that are needed.
Now uninstall the HTC SYNC app, but leave the HTC drivers installed.

Next, connect the phone via USB to the pc to check to see if the PC can connect to the phone, and see it as a USB drive.

Now time to download various additional files for UNLOCK, RECOVERY, and OS INSTALL

Open the following page for reference, and continue reading below.

1) grab the ADB / fastboot files

2) grab a copy of the RECOVERY app
Download link at the bottom of the page is :

3) grab a copy of the KITKAT rom for HTC Desire S (HTC DS) "XperiaKatsaga.zip"

Replace this:META-INF.zip
meta-inf link : http://forum.xda-developers.com/attachment.php?attachmentid=2794366&d=1402586347

3.1)Open the ROM zip file and replace the meta-inf folder with the attachment above.
3.2)Step 1 will give you lot of goodies and no need to flash Gapps,If you dont want goodies
3.3)step b.1 & b.2 are not compulsory but beneficial
"GOODIE STEPS" not tested with BR2 but should work

4) grab a copy of GOOGLE APS install zip "gapps-kk-20140105-signed.zip"

5) grab a copy of the superuser app from the xda thread

6)unlock with htcdev (http://www.htcdev.com/bootloader)
In the dropdown list select ''All other supported models'' and follow the instructions.
which will take you to "http://www.htcdev.com/bootloader/unlock-instructions"

Click through to page 2 (aka Proceed to Step 5)
- don't bother with downloading the fastboot binary
- you have already downloaded it via step (1) above.

7) unzip (1) somewhere, and open CMD as administrator at the unzipped folder location.

8) Type "fastboot oem get_identifier_token"
8.1) to check you have connection to the phone type (via cmd)
"adb devices"
or "fastboot devices"

9) you should now be at Step 6 on the "http://www.htcdev.com/bootloader/unlock-instructions/page-2" page.
Follow it's instructions.
Submit your device identifier token, and HTCDEV will email the unlock binary.

10) Once you've submitted the token, you'll be sent an email with your unlock key as a file attachment.
Follow the further instructions and a link to complete the Bootloader process that's in the email.

You'll be directed to flash the unlock token with a command similar to:
fastboot flash unlocktoken Unlock_code.bin

This will result in an unlocked phone.
Now, you are ready to have a RECOVERY app installed, and then the new OS, and Google Apps, and the SU app.

11) Flash a recovery
Grab "recovery.img" is inside the RECOVERY zip file that was downloaded in (2), and move it to the ADB folder, then issue the command:
via cmd>fastboot flash RECOVERY recovery.img

11.1) In HBOOT (HTC Bios) select "RECOVERY"
This will boot up the RECOVERY app that was just flashed.
11.2) Within RECOVERY
-make a backup of your stock,unrooted rom. completely optional,but a very good idea,IMO.
-wipe cache
-wipe dalvik cache
-install zip from sd card
Install the ROM (3)
Install the Google App store (4)
Install the SU app (5)

12) flash root files
12.1) Within the KITKAT ROM zip file, there's a "boot.img" file
We need to flash this to the phone similar to how the RECOVERY image was flashed.
via cmd>fastboot flash BOOT boot.img

Now reboot, and give the phone 10 minutes to boot up.
The screen will appear black, but give it 10 minutes - leave the phone alone.

Monday, 17 November 2014

T-SQL Logical Query Processing Phases

This section is lifted/quoting "Inside Microsoft SQL SERVER 2005: T-SQL Querying"

Logical Query Processing Phases
This section introduces the phases involved in the logical processing of a query.
I will first briefly describe each step.
Then, in the following sections, I’ll describe the steps in much more detail and apply them to a sample query.
You can use this section as a quick reference whenever you need to recall the order and general meaning of the different phases.
Listing 1-1 contains a general form of a query, along with step numbers assigned according to the order in which the different clauses are logically processed.

Listing 1-1 Logical query processing step numbers
(8) SELECT (9) DISTINCT (11)
(1) FROM
(3) JOIN
(2) ON

The first noticeable aspect of SQL that is different than other programming languages is the order in which the code is processed.
In most programming languages, the code is processed in the order in which it is written.
In SQL, the first clause that is processed is the FROM clause, while the SELECT clause, which appears first, is processed almost last.

Each step generates a virtual table that is used as the input to the following step.
These virtual tables are not available to the caller (client application or outer query).
Only the table generated by the final step is returned to the caller.
If a certain clause is not specified in a query, the corresponding step is simply skipped.

Following is a brief description of the different logical steps applied in both SQL Server 2000 and SQL Server 2005.

Brief Description of Logical Query Processing Phases
Don’t worry too much if the description of the steps doesn’t seem to make much sense for now.
These are provided as a reference.

Sections that come after the scenario example will cover the steps in much more detail.

  1. FROM: A Cartesian product (cross join) is performed between the first two tables in the FROM clause, and as a result, virtual table VT1 is generated.
  2. ON: The ON filter is applied to VT1. Only rows for which the is TRUE are inserted to VT2.
  3. OUTER (join): If an OUTER JOIN is specified (as opposed to a CROSS JOIN or an INNER JOIN), rows from the preserved table or tables for which a match was not found are added to the rows from VT2 as outer rows, generating VT3. If more than two tables appear in the FROM clause, steps 1 through 3 are applied repeatedly between the result of the last join and the next table in the FROM clause until all tables are processed.
  4. WHERE: The WHERE filter is applied to VT3. Only rows for which the is TRUE are inserted to VT4.
  5. GROUP BY: The rows from VT4 are arranged in groups based on the column list specified in the GROUP BY clause. VT5 is generated.
  6. CUBE | ROLLUP: Supergroups (groups of groups) are added to the rows from VT5, generating VT6.
  7. HAVING: The HAVING filter is applied to VT6. Only groups for which the is TRUE are inserted to VT7.
  8. SELECT: The SELECT list is processed, generating VT8.
  9. DISTINCT: Duplicate rows are removed from VT8. VT9 is generated.
  10. ORDER BY: The rows from VT9 are sorted according to the column list specified in the ORDER BY clause. A cursor is generated (VC10).
  11. TOP: The specified number or percentage of rows is selected from the beginning of
    VC10. Table VT11 is generated and returned to the caller.

Monday, 15 September 2014

20140915 Phone4U into Administration - Store Closure Notice

The "Store Closure Notice" on a Phones4U store in Northwich today.

"Following the unexpected decision of EE and Vodafone to withdraw supply from Phones4U, we regret that this store is currently closed."

Sunday, 4 May 2014

How to VCD Vagcom Prime / Purge your Fuel System / Fuel Filter (2009+ models)

Open up VCDS and follow these instructions:
  1. [Select]
  2. [01 - Engine]
  3. [Basic Settings - 04]
  4. Set Group to “035″ (Fuel Supply Pump Activation)
  5. [Go!]
  6. [ON/OFF/Next]
This activates the fuel pump in the fuel tank, and the fuel pump (engine auxiliary) next to the engine.

The electric fuel pumps should run for 30 seconds

Purge 3 times (or more) if injectors have been replaced, or fuel system was flushed.

Alternatively, to cycle only the pump in the fuel tank:
  1. [Select]
  2. [01 - Engine]
  3. [Output Tests]
  4. [Fuel Pump Relay Control Circuit] from dropdown
  5. [Start]