Android开发常用命令

一、android命令
用法:android [global options] action [action options]
1、android sdk
打开SDK Manager window
2、android avd
打开AVD Manager window
3、android list avd
列出存在的avd设备
4、android target 
列出存在的所有targets
5、android list device
列出存在的所有设备
6、android list sdk
列出远程SDK地址
7、android create avd
创建一个新的虚拟设备
用法:android [global options] create avd [action options]
Options:
  -t --target  : Target ID of the new AVD. [required]
  -a --snapshot: Place a snapshots file in the AVD, to enable persistence.
  -c --sdcard  : Path to a shared SD card image, or size of a new sdcard for the new AVD.
  -p --path    : Directory where the new AVD will be created.
  -b --abi     : The ABI to use for the AVD. The default is to auto-select the ABI if the platform has only one ABI for its system images.
  -d --device  : The optional device definition to use. Can be a device index or id.
  -n --name    : Name of the new AVD. [required]
  -s --skin    : Skin for the new AVD.
  -g --tag     : The sys-img tag to use for the AVD. The default is to auto-select if the platform has only one tag for its system images.
  -f --force   : Forces creation (overwrites an existing AVD)
8、android move avd
移动或者重命名一个虚拟设备
用法:android [global options] move avd [action options]
Options:
  -r --rename  : New name of the AVD.
  -p --path    : Path to the AVD's new directory.
  -n --name    : Name of the AVD to move or rename. [required]
9、android delete avd
删除一个虚拟设备
用法:android [global options] delete avd [action options]
Options:
  -n --name    : Name of the AVD to delete. [required]
10、android update avd
更新一个虚拟设备去匹配一个新的SDK
用法:android [global options] update avd [action options]
Options:
  -n --name    : Name of the AVD to update [required]
11、android create project
创建一个工程
用法:android [global options] create project [action options]
Options:
-n --name          : Project name.
  -a --activity      : Name of the default Activity that is created. [required]
  -k --package       : Android package name for the application. [required]
  -v --gradle-version: Gradle Android plugin version.
  -t --target        : Target ID of the new project. [required]
  -g --gradle        : Use gradle template.
-p --path          : The new project's directory. [required]
12、android update project
更新一个工程
用法:android [global options] update project [action options]
Options:
  -s --subprojects: Also updates any projects in sub-folders, such as test projects.
  -l --library    : Directory of an Android library to add, relative to this project's directory.
  -p --path       : The project's directory. [required]
  -n --name       : Project name.
  -t --target     : Target ID to set for the project.

二、adb命令:
command normal:
  adb devices [-l]                  - list all connected devices ('-l' will also list device qualifiers)
  adb disconnect [<host>[:<port>]]  - disconnect from a TCP/IP device. Port 5555 is used by default if no port number is specified. Using this command with no additional arguments will disconnect from all connected TCP/IP devices.
device commands:
  adb push [-p] <local> <remote>
                               - copy file/dir to device  ('-p' to display the transfer progress)
  adb pull [-p] [-a] <remote> [<local>]
                               - copy file/dir from device ('-p' to display the transfer progress) ('-a' means copy timestamp and mode)
  adb shell                    - run remote shell interactively
  adb shell <command>          - run remote shell command
  adb install [-lrtsdg] <file>
                               - push this package file to the device and install it
                                  (-l: forward lock application)
                                  (-r: replace existing application)
                                  (-t: allow test packages)
                                  (-s: install application on sdcard)
                                  (-d: allow version code downgrade)
                                  (-g: grant all runtime permissions)
  adb install-multiple [-lrtsdpg] <file...>
                               - push this package file to the device and install it
                                  (-l: forward lock application)
                                  (-r: replace existing application)
                                  (-t: allow test packages)
                                  (-s: install application on sdcard)
                                  (-d: allow version code downgrade)
                                  (-p: partial application install)
                                (-g: grant all runtime permissions)
  adb uninstall [-k] <package> - remove this app package from the device ('-k' means keep the data and cache directories)
  adb help                     - show this help message
  adb version                  - show version num
scripting:
  adb wait-for-device          - block until device is online
  adb start-server             - ensure that there is a server running
  adb kill-server              - kill the server if it is running
  adb get-state                - prints: offline | bootloader | device
  adb get-serialno             - prints: <serial-number>
  adb get-devpath              - prints: <device-path>
  adb root                     - restarts the adbd daemon with root permissions
  adb unroot                   - restarts the adbd daemon without root permissions

三、使用SQLLite3查看数据库命令:
1、adb shell 
进入shell控制台根目录/,取得对设备的控制权
2、sqlite3 fileName.db 
打开fileName.db数据库 
3、.table
查看数据库表
4、pragma table_info(TABLE_NAME)
查看数据库表结构定义
5、.mode line
切换表结构显示模式
备注:每个SQLite数据库中都还有一个隐藏的sqlite_master表,这里记载了当前数据库中所有表的建表语句,可以使用select * from sqlite_master命令进行查看。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值