Cygwin configuring personal environments, Android emulator root and Babun

Source: Internet
Author: User

# base-files version 4.1-1 # /etc/profile:executed by the command interpreter for login shells.

Your home directory (~)

    • . Profile
    • . VIMRC
Alias emulator='/cygdrive/d/developer/sdk/tools/emulator.exe'alias. ='CD. ' alias ... ='CD. /.. ' alias adb='/cygdrive/d/developer/sdk/platform-tools/adb.exe'
Agdb= '/cygdrive/d/developer/ndk/android-ndk-r9d/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/ Bin/arm-linux-androideabi-gdb.exe '
    • . Profile
# base-files version 4.1-1 # ~/.profile:executed by the command interpreter for login shells. # the copy in your home directory (~/.profile) is yours, please feel # Free to customise it to create a shell   # User dependent. profile file # This file was not read by bash (1) if ~/.bash_profile or ~/.bash_login exists.

# base-files version 4.1-1 # ~/.bashrc:executed by Bash (1) for interactive shells.

    • . VIMRC
set Nocompatiblefiletype onfiletype indent onsyntax onset backspace=2set Showmatchset matchtime< /c7>=5set autoindentset smartindentset cindentset tabstop=4set Softtabstop= 4 set Shiftwidth=4set Noexpandtabset numbercolorscheme desert

Better Cygwin Babun is a cygwin-based shell, with a more complete package, richer colors, more convenient to use than Cygwin, for "Https://github.com/babun/babun". Babun comes with Git,python and other software packages, Vim is also more in line with the general usage habits, the shell information is very rich, the hint is very powerful, and also comes with a "pact" command for the management of software packages, very intimate.

first, let Ubuntu support GBK encoding

Ubuntu default to Chinese only support UTF-8 encoding, can be modified to let Ubuntu support GBK encoding.

First use gedit/var/lib/locales/supported.d/local to modify the/var/lib/locales/supported.d/local file, add the following in the file:
Zh_cn. UTF-8 UTF-8
en_US. UTF-8 UTF-8
Zh_cn. GBK GBK
Zh_cn. GB2312 GB2312
Then use sudo dpkg-reconfigure--force locales Force update settings

second, set up VIMRC support GBK

Set fileencodings=utf-8,gbk,gb2312

Root simulator

Cygwin

    • EMULATOR-AVD avd_for_galaxy_nexus_by_google -qemu-nand system,size=0x1f400000, File=d:/developer /sdk/system-images/android-17/default/armeabi-v7a/system_rooted.img

Among them,-avd <name> 0x1f400000 refers to the space/system partition 500MB.

    • adb shell mount after system boot | grep system

      /dev/block/mtdblock0 /system yaffs2 ro 0 0

mount-o rw,remount-t yaffs2 /dev/block/mtdblock3/system

mount-o remount /dev/block/mtdblock3 /system

/dev/block/mtdblock0 /system yaffs2 rw 0 0

    • Before modification

$ adb shell ls-l/system/xbin/su
-rwsr-sr-x root root 67080 2013-02-13 15:24 su

    • Download the Chainfire supersu Update zip package and unzip

$ adb push d:/developer/sdk/su/system/xbin/
247 kb/s (75364 bytes in 0.297s)

[Email protected] ~
$ adb shell ls-l/system/xbin/su
-rw-rw-rw-root root 75364 2008-02-29 03:33 su

$ adb shell ls-ld/system/
Drwxr-xr-x root root 2013-02-13 15:24


$ adb shell chmod 06755/system
$ adb shell chmod 06755/system/xbin/su
$ adb Install d:/developer/sdk/superuser.apk

    • In the simulator, enter Supersu, you will be prompted to update the binary files, select the general method.

    • Later through this boot

EMULATOR-AVD Avd_for_galaxy_nexus_by_google-qemu-nand System,size=0x1f400000,file=d:/developer/sdk/system-images /android-17/default/armeabi-v7a/system_rooted.img

Modify the configuration file to start from the AVD Manager.exe or revert to system.img.

. android\avd\Avd_for_galaxy_nexus_by_google.ini

Avd.ini.encoding=utf-8
Path=c:\users\sansan\.android\avd\avd_for_galaxy_nexus_by_google.avd
Path.rel=avd\avd_for_galaxy_nexus_by_google.avd
Target=android-17

. ANDROID\AVD\AVD_FOR_GALAXY_NEXUS_BY_GOOGLE.AVD
    • Hardware-qemu.ini file

Disk.systemPartition.initPath = d:\developer\sdk/system-images\android-17\default\armeabi-v7a\/system.img

    • Config.ini file

Image.sysdir.1=system-images\android-17\default\armeabi-v7a\

And some image files that are produced:. Android\avd\avd_for_galaxy_nexus_by_google.avd\ under the userdata-qemu.img, Userdata.img, Cache.img deleted like restore factory.

Enhanced Find_java.bat tolerance (F:\Android\sdk\tools\lib\find_java.bat)
@echo offREMCopyright (C) The Android Open Source ProjectRemremLicensed under the Apache License, Version 2.0 (the "License");REMYou are not a use of this file except in compliance with the License.REMobtain a copy of the License atRemremhttp://www.apache.org/licenses/LICENSE-2.0Remremunless required by applicable law or agreed to writing, softwareREMdistributed under the License is distributed on a "as is" BASIS,REMwithout warranties or CONDITIONS of any KIND, either express or implied.REMSee the License for the specific language governing permissions andREMlimitations under the License.REMThis script was called by the other batch files to find a suitable Java.exeREMTo use . The script changes the "Java_exe" env variable. The variableREMIs -left unset if Java.exe be not found.REMUseful Links:REMCommand-Line reference:REMhttp://technet.microsoft.com/en-us/library/bb490890.aspxREMQuery Whether this system is 32-bit or 64-bitREMSee also:http://stackoverflow.com/a/24590583/1299302Reg Query "Hklm\hardware\description\system\centralprocessor\0" |findstr/I "x86" > NUL && Set "arch_ext=32"|| Set "arch_ext=64" ::DEBUG PRINT arch_ext::echo%%arch_ext%% = "%arch_ext%" REMCheck We have a valid Java.exe in the path. The return code wouldREMBe 0 if the command worked or 1 if the Exec failed (program not found). for/F "delims="%%a in (' "%~dps0\find_java%arch_ext%.exe"-S ") Do SetJava_exe=%%aif  notDefined Java_exeGoto : checkfailed: SearchjavawREMCheck If we can find a javaw.exe at the same location than Java.exe.REMIf That's doesn ' t work, just fall back on the java.exe we just found. for/F "delims="%%a in (' "%~dps0\find_java%arch_ext%.exe"-s-w ') Do SetJavaw_exe=%%aif  not exist"%javaw_exe%"SetJavaw_exe=%java_exe% ::DEBUG PRINT java_exe javaw_exe::echo%%java_exe%% = "%java_exe%"%%javaw_exe%% = "%javaw_exe%" Goto : EOF: checkfailedEcho.EchoError:no suitable Java found. In order to properly UseThe Android DeveloperEchoTools, you need a suitable version of Java JDK installed onYour system.EchoWe recommend that you install the JDK version of Javase,available here:Echohttp://www.oracle.com/technetwork/java/javase/DownloadsEcho.Echo IfYou already have Java installed,You can define the Java_home environmentEchoVariable in Control panel/system/avanced System Settings to theEchoJDK folder.Echo.EchoYou canFindThe complete Android SDK requirements here:EchoHttp://developer.android.com/sdk/requirements.HTMLEcho.Goto : EOF

Cygwin configuring personal environments, Android emulator root and Babun

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.