Tag Archives: CyanogenMod

Debugging IO on Android

Android is Linux based, so there are some interesting way to monitor and debug IO activity especially on storage.

The one I found more useful is this:

  1. enable dumping of IO info
    echo 1 > /proc/sys/vm/block_dump
  2. observe kernel log
    cat /proc/kmsg
  3. make your analysis
  4. disable dumping of IO info
    echo 0 > /proc/sys/vm/block_dump

The output you will get is similar to this:
<7>[71477.927886] kswapd0(24): WRITE block 21240712 on mmcblk0p12 (8 sectors)
<7>[71477.928436] kswapd0(24): WRITE block 21410792 on mmcblk0p12 (8 sectors)
<7>[71477.928710] kswapd0(24): WRITE block 21240704 on mmcblk0p12 (8 sectors)
<7>[71477.929016] kswapd0(24): WRITE block 21240656 on mmcblk0p12 (8 sectors)
<7>[71477.929443] kswapd0(24): WRITE block 25427968 on mmcblk0p12 (8 sectors)
<7>[71477.929687] kswapd0(24): WRITE block 8 on mmcblk0p12 (8 sectors)
<7>[71477.930084] kswapd0(24): WRITE block 0 on mmcblk0p12 (8 sectors)
<7>[71478.086639] sdcard(159): READ block 23431168 on mmcblk0p12 (256 sectors)
<7>[71478.087036] sdcard(159): READ block 23430912 on mmcblk0p12 (8 sectors)
<7>[71478.258148] sdcard(159): READ block 23430920 on mmcblk0p12 (200 sectors)
<7>[71478.258514] sdcard(159): READ block 23431424 on mmcblk0p12 (8 sectors)
<7>[71478.266967] sdcard(138): READ block 23430656 on mmcblk0p12 (32 sectors)
<7>[71478.268798] sdcard(159): READ block 23430688 on mmcblk0p12 (64 sectors)
<7>[71478.269409] sdcard(159): READ block 23430752 on mmcblk0p12 (128 sectors)
<7>[71478.271484] sdcard(159): READ block 23430880 on mmcblk0p12 (32 sectors)
<7>[71478.600646] sdcard(138): READ block 23431432 on mmcblk0p12 (512 sectors)
<7>[71478.765136] sdcard(159): READ block 23431944 on mmcblk0p12 (256 sectors)
<7>[71478.958129] Compiler(412): READ block 327320 on mmcblk0p11 (8 sectors)
<7>[71478.958557] Compiler(412): READ block 327400 on mmcblk0p11 (48 sectors)

Tried on my rooted Galaxy Nexus with CyanogenMod 10.1.0-RC1.

 

How to install Android Ice Cream Sandwich (ICS) on Xperia X10 Mini Pro

ICS on Sony Ericsson Xperia X10 Mini Pro!

Let’s be honest: starting from zero it’s a huge process, but it’s possible.
This procedure is a bit complicated and needs some skills.
I can do (and I did) almost everything from GNU/Linux.

Prerequisites (my starting point)

  • a full backup done: you’ll lose your phone data
  • the phone must run the stock image.
    Latest 2.1.1.A.0.6 SE firmware is required for bootloader unlocking procedure.
    If you are running an unofficial ROM, you can check my preferred way to restore stock ROM. Firmware 2.1.1.C.0.0 is reported to work, too, but I can’t confirm it
  • phone must run baseband M76XX-TSNCJOLYM-53404015
  • a pc running Ubuntu Linux 12.04 64bit (32bit is reported to work too)
  • adb installed and runnable from the pc
  • standard USB cable

All needed software

  • FlashTool
    I used flashtool-0.8.0.0-linux.tar.7z
    You can find this tool on its official page http://androxyde.github.com/Flashtool/
  • msm7227.7z, see xda forum for download links
  • a bash script I wrote to run msm7227 from GNU/Linux. Download here
  • kernel image
    I used U20_nAa-ics-04_2.6.29.6-nAa-ics-04.ftf
    Download links on Google Code official pages. Kernel file names for our device start with “U20” string and they contain “ics” string as well
  • MiniCM9 ROM
    I used MiniCM9-3.0.3-mimmi.zip
    Download links on Google Code official pages. Be carefull, we have a device with codename “mimmi”
  • Google Apps (also known as gapps)
    I used gapps-ics-20120317-signed.zip
    You can find download links on goo.im official pages. Pick gapps for “ics”

What you’ll get

A super clean phone (no data and crappy bloatware).
One of the most recent mobile operating system: Android Ice Cream Sandwich.
All the goodies provided by CyanogenMod: the ROM I installed is MiniCM9.

Everything working great: camera, wifi etc. (I admit I have to check tethering…).

Disclaimer

I AM NOT RESPONSIBLE IF YOU BRICK / RUIN YOUR PHONE IN ANY WAY.
BASIC COMPUTER SKILLS REQUIRED.
PROCEED WITH CAUTION.

The instructions are provided only to show how reached my goal.
Please follow them at your own risk. Stop if you are not in my same situation.

Procedure summary

We have basically 3 things to do:

  1. unlock bootloader
  2. install custom kernel (suitable for ICS)
  3. install ICS ROM + Google Apps

Without an unlocked bootloader, you can’t install a custom kernel.
Without a custom kernel, you can’t install ICS.

0. Copy needed files on the phone

As pointed out by Fabian in his comment, it’s safer to copy the files you’ll use at the end of the procedure when your phone is still fully functional.

So, connect the device to your pc, use it as an external storage and copy these files on the sdcard

  • MiniCM9-3.0.3-mimmi.zip
  • gapps-ics-20120317-signed.zip

1. Unlock bootloader

I presume you’re starting from the very beginning, so I think you have a locked bootloader.

To fix this situation you’ll need some software:

  • msm7227.7z
  • my script: msm7227_semc.sh

This is the most difficult and dangerous step. The risk is that the phone get bricked. Be careful.

Probably you should read the full story here. There are reported some incompatible situations. If you have never unlocked your bootloader, probably you can go on as I did.

The software you downloaded is written for Windows types of operating systems.
I rewrote the cmd script and made a bash script.
Many kudos to xda forum user “the_laser”, I just translated his work.

You have to follow these steps:

  1. unpack archive in a new folder
    $ 7z x -omsm7227 msm7227.7z
  2. uncompress and copy my script in the same folder
    $ mv msm7227_semc.sh msm7227/
  3. connect the phone to an USB port
  4. enable debug USB on the phone itself
  5. run the script
    $ cd msm7227/
    $ ./msm7227_semc.sh
    see my output

2. Install custom kernel

You have successfully unlocked your bootloader and now you can now install a custom kernel.
You’ll need flashtool utility and the ftf image file containing the kernel to flash and the recovery software.

  • FlashTool
  • kernel image file

Follow these steps:

  1. uncompress and untar flashtool
    $ 7z x -oflashtool flashtool-0.8.0.0-linux.tar.7z
    $ tar -C flashtool -xf flashtool/FlashTool-0.8.0.0-linux.tar
    $ rm flashtool/FlashTool-0.8.0.0-linux.tar
  2. launch FlashTool, it’s a java tool with a simple GUI
  3. drag on the main window the ftf file
  4. follow the instructions
  5. at the end the program will tell you that the phone will reboot. It’s not true, so disconnect the USB cable
  6. wait 5 seconds
  7. boot the phone and repeatly push the back button to enter recovery menu.
    ClockworkMod must be installed and should come up.
    You must see nAa kernel logo.
    if CWM menu doesn’t appear you must retry with a reboot (at the moment the phone is unusable)

If you find yourself in troubles, keep in mind that everything can be repaired with a full system restore through SEUS.

3. Install MiniCM9 and the Google Apps

We are almost at the end.
At this time you have an useless phone which cannot even properly boot.
It’s time to flash MiniCM9.

If you followed all steps, you are now in ClockworkMod Recovery menu.

ClockworkMod on Xperia X10 Mini Pro (nAa kernel)

On the step number 0, you should have copied the files on the phone’s SD card. It’s time to use them.
If you skipped that part, you can still do the job via Recovery:

  1. connect the phone to the pc
  2. choose “Mounts and Storage”
  3. choose the last item “mount USB storage”
  4. copy the files I mentioned
  5. umount storage from the pc
  6. choose “umount” from Recovery menu

Follow these steps:

  1. choose “wipe data/factory reset” than confirm
  2. choose “wipe cache partition” than confirm
  3. choose “Advanced” -> “Wipe Dalvik Cache” than confirm
  4. go back
  5. choose “install zip from sdcard” -> “choose zip from sdcard” -> find “MiniCM9-3.0.3-mimmi.zip” and confirm
  6. choose “choose zip from sdcard” -> find “gapps-ics-20120317-signed.zip” and confirm
  7. go back
  8. choose “reboot system now”

The first boot can be a little slower. I saw nAa logo, than CyanogenMod boot animation for about 5 mintes, than the first use Android wizard.

Conclusions

If everything went well we reached our goal.
I found that ICS for Xperia X10 Mini Pro is fast and stable.

You can always revert back with a full restore or you can just install a different ROM.

References

Weird problem solved: I cannot activate “Debug USB”

update with latest cm10 ROM from Kalimochoaz (cm-10-FEATURED-crespo.v1.10.zip), the problem is solved. You can download all here
“Android debugging” is crashing

I’m testing Android Jelly Bean on my Nexus S running CyanogenMod 10.

The exact ROM is “cm-10-20120715-FEATURED-crespo.v0.6.zip”.

I’m getting this weird problem: if I disable USB debug, I cannot re-enable it.

I’m talking about the feature of Android which allows you to use adb from your pc.

The exact menu entry can be found under Settings -> Developer options -> Android debugging.

I managed to re-enable Android debugging with Tasker and the Secure Settings plugin.

Step by step procedure

I’m assuming you own a copy of Tasker, you have successfully installed Secure Settings and enabled the relative Helper. To do so you must have a rooted ROM like CyanogenMod.

I’m reporting here the steps I did:

  1. Open Tasker
  2. Go to “Tasks” tab
  3. Create a new task with the green “+” button
  4. Give the task a name (i.e. “Enable Debug”)
  5. Add a new action
  6. Choose “Plugin”
  7. Choose “Secure Settings”
  8. Choose “Edit”
  9. Pick “USB Debugging” from the list
  10. Activate the “On” state
  11. Save with the floppy icon on the bottom
  12.  Now run your task in Tasker (you can use the “play” button)
  13. Verify the state of the checkbox in the Android’s Settings menu

Android tip: Launch app through adb shell

Please note than I’m using CyanogenMod 7.

First of all you have to know the Intent and Activity of your interest.

The best way to find them I found is to use logcat.

Open a shell

adb shell

Start logcat filtering the needed rows:

logcat | grep 'Starting:'

Start the app you want to launch later in the standard way (use your phone launcher icon).

Take a look to the lines which come from logcat (i.e. launching Shazam):

I/ActivityManager( 205): Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 pkg=com.shazam.encore.androidd cmp=com.shazam.encore.android/com.shazam.android.Splash bnds=[365,244][475,362] } from pid 305 I/ActivityManager( 205): Starting: Intent { act=android.intent.action.VIEW flg=0x4000000 cmp=com.shazam.encore.android/com.shazam.android.Home (has extras) } from pid 8096

Now start the app via am:

localhost / # am start -a android.intent.action.MAIN -n com.shazam.encore.android/com.shazam.android.Splash

Look at your phone.

Now you can combine all in one single command:

adb shell 'am start -a android.intent.action.MAIN -n com.shazam.encore.android/com.shazam.android.Splash'

Done.