ADB
标题 | 命令 |
停止应用 | adb shell am force-stop com.wissen.mapa |
启动应用 | adb shell am start com.wissen.mapa/.activity.LauncherActivity |
安装应用 | adb install -r d:\filename.apk |
卸载应用 | adb uninstall com.wissen.mapa |
打开设置界面 | adb shell am start com.android.settings/com.android.settings.Settings |
获取当前Activity名称 | adb shell "dumpsys window | grep mCurrentFocus" |
所有安装的应用包 | adb shell pm list packages |
ADB远程连接, 开启 | adb tcpip 5555 |
ADB远程连接 | adb connect 192.168.43.1:5555 |
进入Shell管理 | adb shell |
重启 | adb reboot |
关机 | adb shell reboot -p (注意多了个shell) |
调整显示分辨率 | adb shell wm size 1920x1280 |
导出文件 | adb pull /data/data/com.wissen.mapa/databases/record.db |
logcat搜索 | adb logcat | find "xxx" cmd中显示 adb logcat | find "xxx" > log.txt 输出到文件 |
查看CPU架构 | adb shell getprop ro.product.cpu.abi |
配置网络IP | adb shell ifconfig eth0 192.168.1.100 netmask 255.255.255.0 adb shell ifconfig wlan0 192.168.1.100 netmask 255.255.255.0 |
添加IP | adb shell //需要root用户 # eth0 为有线网络 wlan0 为无线网络 ip addr # 添加路由规则到eth0网卡路由表
|
其它
标题 | Windows命令 | Linux命令 |
编译Release包 | gradlew assembleRelease | ./gradlew assembleRelease |
文件开头几行 | head -n 20 filename.log | |
文件最后几行 | tail -n 20 filename.log | |
中间几行 | sed -n '100,110p' filename.log | |
内容搜索 | grep "content" filename.log | |
查看本机IP | netcfg |