android framework开发常用指令总结-git repo linux adb

1.linux环境下:

grep "   " ./ -rn  搜索文本工具

find -name " " 当前目录下查找文件 ,查找文件的具体位置

tar -vczf bootable.tar.gz bootable //打包 并保存源文件

tar -zxvf ......   //解包,.tar.gz后缀的名称

rm -rf  ...  //彻底删除文件,慎用

需要在android源码根目录执行source build.sh 脚本设置环境

m:编译所有的模块 

mm:编译当前目录下的模块,当前目录下要有Android.mk文件 

mmm:编译指定路径下的模块,指定路径下要有Android.mk文件

make clean  是清除android编译好的out文件

2.adb debug模式

adb remount  重新挂载系统分区

adb push E:\3D.so\libvision-jni.so system/lib 把本地文件推送到安卓系统

adb pull /system/app/Settings.apk c:\  从安卓复制到本地c盘下

adb -s emulator-5556 install helloWorld.apk  安装本地的apk

adb logcat                               logcat是打印上层信息(framework,应用) adb logcat -s ...  -s是过滤信息,...是显示TAG信息

cat /proc/kmsg  控制器获取debug信息指令,主要是kernel打印信息

adb install E:\android.armeabi-v7a-1033\bin\....apk  安装本地的apk软件

3.repo,git常用指令

repo start [branchnewname] --all  //创建分支
    创建本地分支(这一步是必须的,否则每次同步都会冲掉本地的提交)
    注意:1.repo start <branch name> (brance name 任意,推荐和上面-b参数指定的branch name一致)
           如出现错误:
           error: at least one project must be specified
           运行
           repo start <branch name> (brance name 任意,推荐和上面-b参数指定的branch name一致) --all

检查分支是否创建成功: repo status

查看当前所有工程分支:repo branch

repo forall -c git指令  -->为工程里每一个git仓执行相同的git命令//repo forall -c 'git fetch rk'

repo checkout vr-text//切换到自定义的分支
      注意:可能会出现这个问题:error: Your local changes to the following files would be overwritten by checkout:
            uboot.txt
            Please, commit your changes or stash them before you can switch branches.
            Aborting
       主要原因是:当前分支修改的信息没有提交到服务端,不允许你切换分支!要提交完毕,才能切换成另一个分支
      总结:切换分支前,最好保证当前分支的信息已经提交,在切换当前分支

git add . ,Git会递归地将你执行命令时所在的目录中的所有文件添加上去

git commit  -m "commit info"  //提交提示信息

git checkout old_cc //切换到存在的分支

git checkout -b mybranch  //创建并切换分支

git checkout . //本地所有修改的.没有的提交的,都返回到原来的状态

git branch //显示分支名称,前面带*表示当前分支

git branch -d branchName //删除本地分支,强制删除用-D

git diff   //可以查看当前修改的,与上一个版本的不同

git log //查看日志
      commit 38361a68138140827b31b72f8bbfd88b3705d77a 
      Author:..........
      Date:   .............

回复到某个版本
reset命令有3种方式:
   1:git reset –-mixed:此为默认方式,不带任何参数的git reset,即时这种方式,它回退到某个版本,只保留源码,回退commit和index信息//需要再git add 和git commit
   2:git reset –-soft:回退到某个版本,只回退了commit的信息,不会恢复到index file一级。如果还要提交,直接commit即可
   3:git reset –-hard:彻底回退到某个版本,本地的源码也会变为上一个版本的内容

猜你喜欢

转载自blog.csdn.net/fmc088/article/details/52207607