1.Comment/Un-Comment
How to use?
<Ctrl-C> To commentHow to install?
<Ctrl-X> To un-comment
For VIM 6 and higher, stick this file in your ~/.vim/plugin directory or in some other 'plugin' directory that is in your runtime path
<Ctrl-C> To commentHow to install?
<Ctrl-X> To un-comment
For VIM 6 and higher, stick this file in your ~/.vim/plugin directory or in some other 'plugin' directory that is in your runtime path
$ wget http://goo.gl/dz3ZB2.Create froyo AVD
$ android create avd --target 8 --name froyo3.Start emulator
$ emulator -avd froyo -partition-size 963.Modified build.prop and comment "ro.config.nocheckin=yes"
$ adb pull /system/build.prop
$ vim build.prop
#ro.config.nocheckin=yes4.Restore to system
$ adb remount /system5.Remove SdkSetup.apk
$ adb push build.prop /system
$ adb shell rm /system/app/SdkSetup.apk6.Shut down the emulator
$ adb push GoogleServicesFramework.apk /system/app
$ adb push Vending.apk /system/app
$ adb reboot7.Remove emulator image
$ cd /path/to/avd8.Restart emulator
$ rm userdata-qemu.img userdata.img cache.img
$ adb install GoogleServicesFramework.apk2.Restart emulator
$ adb install Vending.apk
-rw-r--r-- 1 44768826 2010-11-24 11:11 pediy.tar.bz -rw-r--r-- 1 47059808 2010-11-24 11:25 pediy.rar -rw-r--r-- 1 45356338 2010-11-24 11:27 pediy.tar.gz -rw-r--r-- 1 45355127 2010-11-24 11:18 pediy.zip這四種格式看起來是bzip2的壓縮效率最好,雖然沒有在網路上找到壓縮比的評比來實證,但wikipedia還是有列出一些其他方面的比較
$ sudo vim /etc/sysctl.conf新增一行
vm.swappiness=10重啟sysctl讓設定生效
$ sudo sysctl -p
$ sudo apt-get install readahead
$ sudo apt-get install localepurge
$ sudo apt-get install preload
$ sudo apt-get install prelink修改設定
$ sudo vim /etc/default/prelink新增一行
PRELINKING=yes執行cron
$ /etc/cron.daily/prelink
System -> Preferences -> Startup Applications
$ sudo apt-get install sysv-rc-conf
$ sudo sysv-rc-conf
$ sudo vim /etc/init.d/rc修改CONCURRENCY從none改為shell
CONCURRENCY=shell
$ sudo apt-get install bootchart
$ cd /path/to/android改變init系統時間
$ touch system/core/init/init.c載入Android bash工具
$ . build/envsetup.sh編譯init模組
$ m INIT_BOOTCHART=true啟動機器
$ emulator -system {/path/to}/system.img -data {/path/to}/userdata.img -ramdisk {/path/to}/ramdisk.img設定init的time out
$ adb shell 'echo 180 > /data/bootchart-start'
$ adb shell 'mkdir /data/bootchart'
$ adb reboot
$ adb shell ls /data/bootchart
header kernel_pacct proc_diskstats.log proc_ps.log proc_stat.log
$ cd /whatever/path
$ adb pull /data/bootchart/header
$ adb pull /data/bootchart/kernel_pacct
$ adb pull /data/bootchart/proc_diskstats.log
$ adb pull /data/bootchart/proc_ps.log
$ adb pull /data/bootchart/proc_stat.log
$ {path/to/android}/system/core/init/grab-bootchart.sh
$ java -jar /usr/share/bootchart/bootchart.jar bootchart.tgz
Parsing /tmp/android-bootchart/bootchart.tgz Wrote image: ./bootchart.png
A small partition image with gzipped cpio archive that is mounted read-only by the kernel at boot time. It only contains /init and a few config files. It is used to start init which will mount the rest of the system images properly and run the init procedure. A Ramdisk is a standard Linux feature.
A partition image that will be mounted as /system and thus contains all system binaries
A partition image that can be mounted as /data and thus contains all application-specific and user-specific data.
$ cd whatever/path2.Copy the original ramdisk.img
$ cp /path/to/ramdisk.img .3.Create a temporary folder, say ramdisk-ext
$ mkdir ramdisk-ext4.Change directory to ramdisk-ext
$ cd ramdisk-ext5.Extract the ramdisk.cpio in the ramdisk-ext folder
$ gunzip -dcv ../ramdisk.img | cpio -idm6.Check out the directories in ramdisk.img
$ ls
data dev init.goldfish.rc proc sys default.prop init init.rc sbin system7.Do some modifications
$ touch foo8.Recreate the ramdisk.cpio
$ mkdir bar
$ find . | cpio -H newc -o | gzip -9 >../ramdisk.img9.Start the emulator
$ emulator -system system.img -data userdata.img -ramdisk ramdisk.img10.Check out the directories in the emulator
$ adb shell ls -l
drwxrwxrwt root root 2010-11-26 16:54 sqlite_stmt_journals drwxrwx--- system cache 2010-11-26 16:54 cache d--------- system system 2010-11-26 16:54 sdcard lrwxrwxrwx root root 2010-11-26 16:54 etc -> /system/etc drwxr-xr-x root root 2010-11-15 07:33 system drwxr-xr-x system system 2010-11-26 16:53 bar drwxr-x--- system system 2010-11-26 16:52 sbin -rwxr-x--- system system 1677 1970-01-01 00:00 init.goldfish.rc dr-xr-xr-x root root 1970-01-01 00:00 proc -rw-r--r-- system system 0 2010-11-26 16:52 foo -rwxr-x--- system system 106696 1970-01-01 00:00 init -rwxr-x--- system system 10700 1970-01-01 00:00 init.rc drwxr-xr-x root root 1970-01-01 00:00 sys -rw-r--r-- system system 118 1970-01-01 00:00 default.prop drwxrwx--x system system 2010-11-16 09:04 data drwx------ root root 2009-08-07 03:35 root drwxr-xr-x root root 2010-11-26 16:54 dev
-c, --stdout write on standard output, keep original files unchanged -d, --decompress decompress -v, --verbose verbose mode -1, --fast compress faster -9, --best compress better
-i, --extract Extract files from an archive (run in copy-in mode) -d, --make-directories Create leading directories where needed -m, --preserve-modification-time Retain previous file modification times when creating files -H, --format=FORMAT Use given archive FORMAT -c Use the old portable (ASCII) archive format -o, --create Create the archive (run in copy-out mode) -v, --verbose Verbosely list the files processed -B Set the I/O block size to 5120 bytes -u, --unconditional Replace all files unconditionally Examples: cpio -covB > [file|device]<== Backup cpio -icduv < [file|device]<== Restore "-H newc" use the new (SVR4) portable format. If you wish the old portable (ASCII) archive format, use "-H odc" instead.