Friday, March 25, 2011

Android Tricks

Mount a filesystem read-write

Very often when you want to write files to a particular partition on ADP1, you will get a "Permission Denied" if the partition is mounted read-only.
To get around this, you need to mount the partition read-write. Typically this is done with /system partition

adb shell
su
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system (or mount -o rw,remount,rw /system)

(Replace /dev/block/mtdblock3 & /system with appropriate device path and mount point, as obtained from cat /proc/mounts)


Moving Android cache to SD Card

Some Android devices, which have little internal memory or when download data and application data fills the cache area, will issue “insufficient space” warning.  A quick workaround would be to move device cache and/or application caches to SC card.
It is assumed that the device is already rooted and a way to run commands on the device is available. i.e “Terminal Emulator” app, Android ADB.
Basically, the idea is to create a cache folder on SD card, remove the cache folder on internal memory and then link the internal folder to the folder on SD card so SD card space is used.
To move the cache folder
1
2
3
4
5
umount /cache
mount -o rw,remount -t rootfs rootfs /
rmdir /cache
mkdir /sdcard/cache
ln -s /sdcard/cache /cache
Browser Cache
1
2
3
4
cd /data/data/com.android.browser/cache
rm -R webviewCache
mkdir /sdcard/cache/webviewCache
ln -s /sdcard/cache/webviewCache webviewCache
Google Maps
1
2
3
4
cd /data/data/com.google.android.apps.maps
rm -R files
mkdir /sdcard/cache/files/maps
ln -s /sdcard/cache/files/maps files
Google StreetView
1
2
3
4
cd /data/data/com.google.android.street
rm -R cache
mkdir /sdcard/cache/streetCache
ln -s /sdcard/cache/streetCache cache
Market Cache
1
2
3
4
cd /data/data/com.android.vending
rm -R cache
mkdir /sdcard/cache/marketCache
ln -s /sdcard/cache/marketCache cache
imeem Cache
1
2
3
4
cd /data/data/com.imeem.gynoid
rm -R cache
mkdir /sdcard/cache/imeemCache
ln -s /sdcard/cache/imeemCache cache
Tunewiki Cache
1
2
3
4
cd /data/data/com.tunewiki.lyricplayer.android/cache
rm -R webviewCache
mkdir /sdcard/cache/tunewikiCache
ln -s /sdcard/cache/tunewikiCache webviewCache
Steel Browser Cache
1
2
3
4
cd /data/data/com.kolbysoft.steel/cache
rm -R webviewCache
mkdir /sdcard/cache/steelCache
ln -s /sdcard/cache/steelCache webviewCache
OR
1
2
3
4
5
cd /data/data/com.kolbysoft.steel
mkdir cache
cd cache
mkdir /sdcard/cache/steelCache
ln -s /sdcard/cache/steelCache webviewCache
MeetMe Cache
1
2
3
4
cd /data/data/com.stylem.meetme
rm -R cache
mkdir /sdcard/cache/meetmeCache
ln -s /sdcard/cache/meetmeCache cache
MySpace
1
2
3
4
cd /data/data/com.myspace.android
mkdir /system/sd/cache/files/myspace
rm -R files
ln -s /sdcard/cache/files/myspace files
Gmail
1
2
3
cd /data/data/com.google.android.gm/cache
rm -R webviewCache
ln -s /sdcard/cache/webviewCache webviewCache
Voice Search
1
2
3
cd /data/data/com.google.android.voicesearch/cache
rm -R webviewCache
ln -s /sdcard/cache/webviewCache webviewCache
My Maps Editor
1
2
3
cd /data/data/com.google.android.apps.mymaps/cache
rm -R webviewCache
ln -s /sdcard/cache/webviewCache webviewCache

Credits:

Thanks to birdman81484 for imeemm, Tunewiki, Steel Browser, MeetMe, MySpace