zoukankan      html  css  js  c++  java
  • Android开发常用操作/命令备忘

    adb命令

    1. 常用adb命令

    a. 查看已连接的设备

    adb devices 

    b. 重启手机

    adb reboot

    c. 重启手机并进入fastboot模式

    adb reboot bootloader

    d. adb截屏保存到电脑:

    adb shell screencap -p /data/media/0/Pictures/1.png
    adb pull /data/media/0/Pictures/1.png ~/Desktop/

    2. adb shell 命令
    a. echo xxx > file | cat file

    echo 0 /persist/sensors/sensors_setting
    cat /persist/sensors/sensors_setting

    b. 查看/修改文件权限
    查看:

    ls -l sys/devices/system/cpu/cpu0/online

    修改:(本来为root权限,修改为system)

    chown -R system:system /sys/devices/system/cpu

    c. Android SELinux Enforing 和 Permissive 模式切换
    adb shell setenforce 1 // Enforing
    adb shell setenforce 0 // Permissive

    d. adb shell查看当前进程
    adb shell
    初级 ps
    高级 top 或 top -H | grep "name"
    结束进程:pkill -9 processname

    fastboot命令
    fastboot devices
    fastboot flash xxxx xxxx.img
    fastboot reboot

    git命令

    提交代码:

    git add .
    git commit
    按i輸入,編輯完esc,shift+:,wq保存退出
    git push xxxxx
    git commit --amend 覆蓋前一個提交,就不用撤銷了

    打patch:

    git diff > ~/Desktop/change.patch

    代码状态查看及清除

    git status 查看此project下代码修改状态
    git stash 清除新增的文件
    git clean -f -d 清除对代码的修改git checkout xxxxxx.java 恢复此文件到未修改状态,不用clean、stash全部project
    git log 查看当前project下提交的log git reset xxxxlogID --hard 恢复到此ID的状态,最好回滚到自己修改前一条
    如果回滚错了,需要再回来最新的,先用
    git reflog 查看回滚记录
    git reset xxxx(最新的ID) --hard 再回滚回来
  • 相关阅读:
    多线程
    Flume和 Sqoop
    Struts2部分
    hibernate学习笔记(一)
    idea创建普通的java小项目教程
    IntelliJ Idea 常用快捷键列表
    idea创建springMVC框架和配置小文件
    对于Git的总结
    关于jvm运行时时区的总结
    事务的总结笔记(详解很仔细),mysql事务隔离级别演示,,,
  • 原文地址:https://www.cnblogs.com/kunkka/p/8038385.html
Copyright © 2011-2022 走看看