multilang MIUI 6 Special Edition 4.4 for Xiaomi Mi 2/2S Flashing via Linux

for everybody that owns a Xiaomi Mi2S and doesn’t have access to a windows box and the MiPhone flash tool, flashing the kitkat miui v6 rom through fastboot is quite easy.

first install fastboot either through the android sdk or if you’re running a debian based distro:

sudo apt-get install android-tools-fastboot

power off you’re phone and enter fastboot mode with volume down + power

i preferred running the next steps with root so i just used

sudo -i

so i wouldn’t always have to run everything with sudo.

now check if your phone is visible with

fastboot devices

if you see a device and number you’re ready to go.

download the new rom from here and unpack the archive. here’s a link to the thread containing more information.

in there you’ve got some batch files, shell scripts and a folder with all the images.

make sure the flash_all_except_storage.sh is executable and just run it. it does all the work for you.

here’s what you should see:

./flash_all_except_storage.sh
soc-id: 109
sending 'tz' (196 KB)...
OKAY [  0.017s]
writing 'tz'...
OKAY [  0.013s]
finished. total time: 0.030s
sending 'sbl1' (82 KB)...
OKAY [  0.008s]
writing 'sbl1'...
OKAY [  0.007s]
finished. total time: 0.016s
sending 'sbl2' (128 KB)...
OKAY [  0.012s]
writing 'sbl2'...
OKAY [  0.010s]
finished. total time: 0.022s
sending 'sbl3' (296 KB)...
OKAY [  0.024s]
writing 'sbl3'...
OKAY [  0.017s]
finished. total time: 0.042s
sending 'rpm' (136 KB)...
OKAY [  0.012s]
writing 'rpm'...
OKAY [  0.027s]
finished. total time: 0.039s
sending 'aboot' (1020 KB)...
OKAY [  0.081s]
writing 'aboot'...
OKAY [  0.049s]
finished. total time: 0.130s
erasing 'boot'...
OKAY [  0.011s]
finished. total time: 0.011s
sending 'misc' (8 KB)...
OKAY [  0.004s]
writing 'misc'...
OKAY [  0.003s]
finished. total time: 0.007s
sending 'modem+modem1' (51910 KB)...
OKAY [  4.067s]
writing 'modem+modem1'...
OKAY [  4.542s]
finished. total time: 8.609s
sending 'system+system1' (420865 KB)...
OKAY [ 32.988s]
writing 'system+system1'...
OKAY [ 60.549s]
finished. total time: 93.538s
sending 'cache' (32768 KB)...
OKAY [  2.578s]
writing 'cache'...
OKAY [  2.275s]
finished. total time: 4.853s
sending 'userdata' (204332 KB)...
OKAY [ 16.001s]
writing 'userdata'...
OKAY [ 11.741s]
finished. total time: 27.742s
sending 'recovery' (6640 KB)...
OKAY [  0.524s]
writing 'recovery'...
OKAY [  0.378s]
finished. total time: 0.902s
sending 'boot+boot1' (4764 KB)...
OKAY [  0.376s]
writing 'boot+boot1'...
OKAY [  1.239s]
finished. total time: 1.615s
rebooting...
 
finished. total time: 0.001s

your phone should now boot into the brand spanking new beta version of miui.
your sd card storage will not get wiped but it’s always a good idea to create a backup first.

as soon as your phone has booted you can go and locate the updater app and flash the weekly multilang rom releases from here the way you are used to.

have fun!

connect to local computer from android emulator (hosts file)

connecting to something running on your local computer from you android emulator device is something which makes debugging alot easier.

since you can’t connect to localhost or 127.0.0.1 since that is the android emulator itself we need to make sure that the hosts file contains what we need.

to make this possible you need to start your AVD with the -partition-size parameter so we can actually change the system stuff (maybe try 512 if that still doesn’t work):

emulator -avd myAVDName -partition-size 256

afterwords we need to remount the system partition to make it writable:

adb remount

since the computer running the AVD can be called through IP 10.0.2.2 we’ll create a hosts file locally for example:

127.0.0.1	localhost  
10.0.2.2	myawesomewebsite
10.0.2.2	andanothervirtualhost

now we need to push this file onto the AVD:

adb push /path/to/hosts /system/etc

and open a browser and check if http://myawesomewebsite works

woohoo!