cygwin配置个人环境,android模拟器root和Babun

# 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‘
alias 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  environment to your liking. 

# User dependent .profile file

# This file is 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 nocompatible
filetype on
filetype indent on
syntax on
set backspace=2
set showmatch
set matchtime=5
set autoindent
set smartindent
set cindent
set tabstop=4
set softtabstop=4
set shiftwidth=4
set noexpandtab
set number
colorscheme desert

更好的Cygwin

  Babun是一个基于Cygwin改造的Shell,具有更完整的软件包,更丰富的色彩,使用起来要比Cygwin更方便一些,下载地址为“https://github.com/babun/babun”。

  Babun自带Git,Python等软件包,VIM也更符合一般的使用习惯,Shell的信息很丰富,提示功能很强大,另外还自带了一个“pact”命令用于管理软件包,非常贴心。

一、让ubuntu支持GBK编码

Ubuntu默认对中文只支持UTF-8编码,可以通过一些修改让Ubuntu支持GBK编码。

首先用gedit /var/lib/locales/supported.d/local来修改 /var/lib/locales/supported.d/local文件,在文件中添加如下内容:
zh_CN.UTF- 8 UTF- 8
en_US.UTF- 8 UTF- 8
zh_CN.GBK GBK
zh_CN.GB2312 GB2312
接着用sudo dpkg-reconfigure --force locales强制更新设置

二、设置Vimrc支持GBK

set fileencodings=utf-8,gbk,gb2312

ROOT模拟器

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

其中,-avd <name> ;0x1f400000是指给/system分区500MB的空间。

  • 系统启动后  adb shell mount | 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

  • 修改前

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

  • 下载Chainfire的SuperSU的UPDATE zip包,并解压缩

$ 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

  • 在模拟器里,进入SuperSu,会提示更新二进制文件,选择常规方法即可。
  • 以后通过这个启动

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

修改配置文件从AVD Manager.exe启动还是恢复成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文件

disk.systemPartition.initPath = D:\Developer\sdk/system-images\android-17\default\armeabi-v7a\/system.img

  • config.ini文件

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

而把产生的某些image文件: .android\avd\AVD_for_Galaxy_Nexus_by_Google.avd\下的userdata-qemu.img, userdata.img, cache.img删除掉类似恢复出厂。

增强 find_java.bat的容错性(F:\Android\sdk\tools\lib\find_java.bat)

@echo off
rem Copyright (C) 2007 The Android Open Source Project
rem
rem Licensed under the Apache License, Version 2.0 (the "License");
rem you may not use this file except in compliance with the License.
rem You may obtain a copy of the License at
rem
rem      http://www.apache.org/licenses/LICENSE-2.0
rem
rem Unless required by applicable law or agreed to in writing, software
rem distributed under the License is distributed on an "AS IS" BASIS,
rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
rem See the License for the specific language governing permissions and
rem limitations under the License.

rem This script is called by the other batch files to find a suitable Java.exe
rem to use. The script changes the "java_exe" env variable. The variable
rem is left unset if Java.exe was not found.

rem Useful links:
rem Command-line reference:
rem   http://technet.microsoft.com/en-us/library/bb490890.aspx

rem Query whether this system is 32-bit or 64-bit
rem See also: http://stackoverflow.com/a/24590583/1299302
reg 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%"

rem Check we have a valid Java.exe in the path. The return code will
rem be 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 set java_exe=%%a
if not defined java_exe goto :CheckFailed

:SearchJavaW
rem Check if we can find a javaw.exe at the same location than java.exe.
rem If that 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 set javaw_exe=%%a
if not exist "%javaw_exe%" set javaw_exe=%java_exe%

::DEBUG PRINT java_exe javaw_exe
::echo %%java_exe%% = "%java_exe%" %%javaw_exe%% = "%javaw_exe%"

goto :EOF

:CheckFailed
echo.
echo ERROR: No suitable Java found. In order to properly use the Android Developer
echo Tools, you need a suitable version of Java JDK installed on your system.
echo We recommend that you install the JDK version of JavaSE, available here:
echo   http://www.oracle.com/technetwork/java/javase/downloads
echo.
echo If you already have Java installed, you can define the JAVA_HOME environment
echo variable in Control Panel / System / Avanced System Settings to point to the
echo JDK folder.
echo.
echo You can find the complete Android SDK requirements here:
echo   http://developer.android.com/sdk/requirements.html
echo.
goto :EOF
时间: 2024-10-07 09:28:56

cygwin配置个人环境,android模拟器root和Babun的相关文章

Android模拟器ROOT

需要下载  http://pan.baidu.com/s/1nueP8NJ adb remount adb push su /system/bin/su adb push su /system/xbin/su adb shell chmod 4755 /system/bin/su adb shell chmod 4755 /system/xbin/su 这一对命令 就是复制SU文件 然后安装APK

ArcGIS4Android 3 :最快Android模拟器Genymotion

整理了使用方法和资源: Android开发人员都知道,原生的模拟器启动比较慢,操作起来也不流畅,还会出现莫名的问题.当然很多人都会选择直接使用android手机来开发,但是有时候需要在投影仪上演示程序的时候手机不太好做到吧.这里给大家介绍一款很好的android模拟器——genymotion. 一.安装方法 1.Genymotion安卓模拟器其实不是普通的模拟器,严格来说,genymotion是虚拟机,被网传定义为模拟器,加载APP的速度比较快,操作起来也很流畅. 2.Genymotion依赖于

Android模拟器怎么配置网络连通

PC机可以上网,PC机上面的android模拟器不能上网.其实只要使模拟器跟自己的PC在同一个网段内就行了: 首先,如果没有配置sdk的环境变量的,那么在CMD命令下进入sdk安装路径的platform-tools目录下(D:\Program Files\Android\android-sdk-windows\platform-tools),然后使用adb shell命令 ,如果配置了sdk的环境变量 的,那么直接在CMD窗口中输入adb shell,如:C:\Documents and Set

我的Android 4 学习系列之开始入手:配置开发环境与理解Hello World!

p { padding-left: 10px; } 目录 如何安装Android SDK.创建开发环境和调试项目 移动设计中一些注意事项 使用Android虚拟设备.模拟器和其他开发工具 如何安装Android SDK.创建开发环境和调试项目 下载和安装Android SDK : 我的是window7系统,当然下载 SDK starter package 最合适了: http://developer.android.com/sdk/index.html 下载完打开压缩包如下: 然后把这个包解压到

用C++语言开发Android程序 配置开发环境

如果你是一个C++语言的死忠,你喜欢C++语言到了偏执的状态,如果不想学习Java语言,或者你很讨厌Java语言,如果你认为Java虚拟机的内存占用太多和执行低效.如果你过度关注Andoird程序的执行效率,对Android程序的执行速度过于敏感,喜欢自己用手动档来控制程序的内存和线程等资源,如果你在其他平台下用C++语言开发了一个程序,想要移植到Android平台下,本教程就是为了满足你的以上诸多怪癖而发布的,本文的目的就是指导你学习如何只用C++语言来开发Android程序,而不使用任何其他

配置android模拟器

配置android模拟器 1. 将android-sdk-windows.rar和eclipse_android.rar解压到D盘根目标下 直接将两个压缩文件解压到当前分区(D盘)即可 2. 配置环境变量 a) 配置ANDROID_SDK_HOME:D:\android-sdk-windows b) 配置JAVA_HOME:D:\Program Files\Java\jdk1.6.0_20 a) 配置Path:D:\android-sdk-windows\platform-tools;D:\an

cocos2dx系列笔记(2)- windows环境配置后续之 Android环境配置

续上篇 对于想用cocos2dx来开发Android游戏的人来说,最痛苦的莫过于配置Android环境和之后的奇奇怪怪的编译失败问题.这是经历了多次成功与失败之后,血与泪的经验包,大家请收好.如果你有更便捷的方法,请一定要指教我,感谢! android环境搭建由于中国长城的原因,你需要借助一些外界的帮助,比如VPN,又或者是这个网站:AndroidDevTools,里面包含android开发需要的绝大部分东西. 对于android环境如何搭建,由于时间比较紧,我就不图文并茂了,本篇我来简单描述就

weex 启动 android 模拟器(mac环境)

一.android studio和android sdk下载 1.android studio下载并安装https://developer.android.com/studio/index.html 下载后会自动安装andriod studio,在下载时如果点canel,那下次还是要重新下载.如果在安装时没有下载,那preferences - Appearance & Behavior - System Settings - Android SDK点击Edit也可以下载 二.jdk下载和环境配置

; AutoHotkey全自动安装环境设置和测试JAVA+Eclipas+Android+JRE+JDK+SDK+ADT+Android模拟器+Android Virtual Device Manager+NDK+Studio+Doc+Help+Android Application Project编程调试windows环境[草稿版] DetectHiddenWindows,On SetTitl

; AutoHotkey全自动安装环境设置和测试JAVA+Eclipas+Android+JRE+JDK+SDK+ADT+Android模拟器+Android Virtual Device Manager+NDK+Studio+Doc+Help+Android Application Project编程调试windows环境[草稿版] DetectHiddenWindows,OnSetTitleMatchMode,2 ; 激活窗口并单击按钮IfWinExistActiveControlClick