add watch.md exec.md
This commit is contained in:
parent
3767328655
commit
639759cd87
|
@ -1,7 +0,0 @@
|
|||
记录编译错误及解决方法
|
||||
|
||||
#### Error: Instruction csrw requires absolute expression
|
||||
|
||||
- 错误原因:这是由于编译器版本不正确引起的,由于riscv指令集尙处于发展阶段,所以不同版本的指令集可能是不一样的
|
||||
- 解决方法:重新编译工链,要使用指令集对应的编译器版本号
|
||||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
#### dumpsys
|
||||
|
||||
```
|
||||
|
@ -8,14 +6,46 @@ dumpsys [-t TIMEOUT] [-l | --skip SERVICES | SERVICE [ARGS]] # 显示所有的
|
|||
-t TIMEOUT # 如不指定TIMEOUT,默认为10秒
|
||||
--skip SERVICES # 除了SERVICES里的服务(用逗号分隔),显示其它服务的信息
|
||||
SERVICE [ARG] # 只显示服务SERVICE的信息
|
||||
|
||||
# 示例
|
||||
dumpsys activity [packagename] # 显示服务activity的信息,即查看正在运行的acitivity
|
||||
dumpsys battery # 查看电量信息
|
||||
dumpsys cpuinfo # 查看CPU信息
|
||||
dumpsys meminfo # 查看内存信息
|
||||
dumpsys package
|
||||
dumpsys window | grep mFocused # 查看处于最上层的窗口信息,可得到包名和活动名
|
||||
```
|
||||
|
||||
#### input
|
||||
|
||||
```
|
||||
input [source] <command> [args]
|
||||
# source : dpad, keyboard, mouse, touchpad, gamepad, touchnavigation, joystick, touchscreen, stylus, trackball
|
||||
#command
|
||||
text <string> # 向手机输入string
|
||||
keyevent <key code number or name>...
|
||||
tap <x> <y>
|
||||
swipe <x1> <y1> <x2> <y2>
|
||||
dragandtrop <x1> <y1> <x2> <y2>
|
||||
press
|
||||
roll <dx> <dy>
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### 管理器
|
||||
|
||||
##### am
|
||||
|
||||
```
|
||||
# 活动管理器
|
||||
am force-stop <package> # 关闭程序
|
||||
am start -n <package>/[package].<activity> # 打开一个活动
|
||||
am start-activity [option] <INTENT> # 打开一个活动,它应该和"am start"是等价的
|
||||
-D # 开启调试
|
||||
-N # 开启本地调试
|
||||
am startservice <service>/.<activity> # 打开一个服务
|
||||
am start-service [options] <INTENT> # 打开一个服务,它应该和"am startservice"是等价的
|
||||
```
|
||||
|
||||
|
||||
|
@ -25,6 +55,7 @@ dumpsys [-t TIMEOUT] [-l | --skip SERVICES | SERVICE [ARGS]] # 显示所有的
|
|||
```
|
||||
# 包管理器
|
||||
pm disable <package> # 使package不可用
|
||||
pm clear <package> # 删除package的所有数据
|
||||
pm install # 安装软件
|
||||
pm uninstall # 卸载软件
|
||||
-k # 卸载后保留数据和缓存目录
|
||||
|
@ -58,3 +89,17 @@ getprop [NAME [DEFAULT]] # 查看系统属性
|
|||
setprop NAME VALUE # 设置系统属性
|
||||
```
|
||||
|
||||
#### 启动或关闭服务
|
||||
|
||||
##### start
|
||||
|
||||
```
|
||||
start [services] # 开启服务,如不指定服务则开启netd/surfaceflinger/zygotes
|
||||
```
|
||||
|
||||
##### stop
|
||||
|
||||
```
|
||||
stop [services] # 关闭服务,如不指定服务则关闭netd/surfaceflinger/zygotes
|
||||
```
|
||||
|
||||
|
|
|
@ -98,22 +98,20 @@ ls .repo # 查看.repo目录
|
|||
|
||||
#### 错误解决
|
||||
|
||||
```
|
||||
# 问题1
|
||||
现象: 执行repo sync的出现如下错误提示:git prior sync failed; rebase still in progress
|
||||
##### repo sync的错误
|
||||
**错误提示**:git prior sync failed; rebase still in progress
|
||||
解决方法:进到出问题的目录,执行git rebase --abort,提示It looks like git-am is in progress. Cannot rebase.执行git am --abort。再回到原目录执行repo sync即可。
|
||||
原因分析:由于rebase操作还在进程中,导致sync失败。解决方法就是让rebase退出进程。
|
||||
|
||||
# 问题2
|
||||
现象:执行repo sync出现如下错误提示:error.GitError: platform/art rev-list ('4c2be345d6bfc25db87f23749912ae9d98d2ad62', 'HEAD', '--'): fatal: bad object HEAD
|
||||
**错误提示**:error.GitError: platform/art rev-list ('4c2be345d6bfc25db87f23749912ae9d98d2ad62', 'HEAD', '--'): fatal: bad object HEAD
|
||||
解决方法:删除art目录,再进行repo sync
|
||||
原因分析:可能是art目录进行了一些修改,导致git命令执行失败
|
||||
|
||||
# 问题3
|
||||
现象:执行repo sync出现如下错误提示:access denied or repository not exported
|
||||
**错误提示**:access denied or repository not exported
|
||||
解决方法:清空整个工作区,重新reop sync
|
||||
原因分析:删除出错的仓库都无效,删除整个工作区才有效,无法理解此问题
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -121,9 +121,9 @@ pacman -S --help # 查询安装软件包的方法
|
|||
|
||||
#### 错误解决
|
||||
|
||||
1. 错误提示:error: failed to commit transaction (conflicting files)。
|
||||
**错误提示**:error: failed to commit transaction (conflicting files)。
|
||||
|
||||
原因分析:这是文件冲突,pacman不会主动覆盖已经存在的文件。
|
||||
原因分析:这是文件冲突,pacman不会主动覆盖已经存在的文件。
|
||||
|
||||
解决方法:将冲突的文件删除,重命名或转移到其它文件夹。
|
||||
解决方法:将冲突的文件删除,重命名或转移到其它文件夹。
|
||||
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
```
|
||||
watch [options] <command> # 周期性执行command,全屏输出,默认周期为2秒
|
||||
```
|
||||
|
||||
#### 选项
|
||||
|
||||
```
|
||||
-d, --differences permanent
|
||||
-n, --interval seconds # 执行周期设为seconds秒
|
||||
-x, --exec # 命令默认是通过"sh -c"来执行的,这意味着要给命令加引号才能正确执行。而使用此选项,命令将通过"exec"来执行。
|
||||
```
|
||||
|
||||
#### 退出状态
|
||||
|
||||
```
|
||||
0 # 成功执行
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
7
|
||||
8
|
||||
other
|
||||
```
|
||||
|
|
@ -135,6 +135,18 @@ gcc一般会进行预处理,编译,汇编,连接四步。
|
|||
|
||||
解决方法:创建一个链接asm指向文件夹asm-generic
|
||||
|
||||
**错误提示**:Instruction csrw requires absolute expression
|
||||
|
||||
原因分析:这是由于编译器版本不正确引起的,由于riscv指令集尙处于发展阶段,所以不同版本的指令集可能是不一样的
|
||||
|
||||
解决方法:重新编译工链,要使用指令集对应的编译器版本号
|
||||
|
||||
**错误提示**:undefined reference to `__alltraps'
|
||||
|
||||
原因分析:没把包含`__alltraps`的源文件加入编译系统,导致链接器找不到对`__alltraps`的引用
|
||||
|
||||
解决方法:修改Makefile,把相应源文件加入编译系统
|
||||
|
||||
#### 安装gcc-riscv32(Ubuntu 16.04 x86_64)
|
||||
|
||||
##### 准备
|
||||
|
@ -262,7 +274,7 @@ export RISCV=/path/to/install/riscv/toolchain
|
|||
|
||||
##### 错误解决
|
||||
|
||||
出错提示:`error: invalid use of incomplete type ‘scm_t_port {aka struct scm_t_port}’`
|
||||
错误提示:`error: invalid use of incomplete type ‘scm_t_port {aka struct scm_t_port}’`
|
||||
|
||||
原因分析:新版本的guile不再提供对scm_t_port的定义
|
||||
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
```
|
||||
exec [options] [command [args]] [redirections] # 使用command来替代shell,即借尸还魂,尸是shell但魂已经变成command
|
||||
-a name # 将name传给command做为0号参数
|
||||
-c # 使用空环境来执行command
|
||||
-l # 给0号参数加个破折号
|
||||
```
|
||||
|
Loading…
Reference in New Issue