Android常用命令

网络
  • ifconfig
ifconfig eth0 192.168.124.5 netmask 255.255.255.0
ifconfig eth0 192.168.124.5/24
  • iptables
busybox-x86_64 ip route show table all
busybox-x86_64 ip route show tables all
busybox-x86_64 ip route list table 0
ip route show table all
ip route show tables all
ip route list table 0
  • dns
getprop |grep dns
  • dhcp
getprop |grep dhcp
  • tcpdump
tcpdump -i eth0 -s 120 -C 100000 -w /sdcard/AAAA.pcapng
  • WiFi扫描
wpa_cli -i wlan0 scan
wpa_cli -i wlan0 scan_result
wpa_cli -i wlan0 enable_network 0
 wpa_cli -i wlan0 set_network 0 ssid '"name"'
 wpa_cli -i wlan0 set_network 0 key_mgmt NONE
 wpa_cli -i wlan0 set_network 0 wep_key0 '"psk"'
wpa_cli -iwlan0 set_network 0 protoWPA2

#查看信道

wl channels
1 2 3 4 5 6 7 8 9 10 11 36 40 44 48 52 56 60 64 100 104 108 112 116 120 124 128 132 136 140 144 149 153 157 161 165

查看端口

busybox netstat -tlp                                                                                                                                                            
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 localhost:webmin        0.0.0.0:*               LISTEN      1533/tcpserver
tcp        0      0 0.0.0.0:ssh             0.0.0.0:*               LISTEN      769/dropbear
tcp        0      0 0.0.0.0:https           0.0.0.0:*               LISTEN      1486/lighttpd
tcp        0      0 localhost:5037          0.0.0.0:*               LISTEN      2784/adbd
tcp        0      0 :::http                 :::*                    LISTEN      1486/lighttpd
tcp        0      0 :::5555                 :::*                    LISTEN      2784/adbd
tcp        0      0 :::ssh                  :::*                    LISTEN      769/dropbear
应用

pm list package
pm enable com.xx.xx
pm disable com.xx.xx
pm install *.apk
pm uninstall com.xx.xx
pm dump packagename | grep versionName
dumpsys package packagename (应用信息,包括权限信息)
pm clear packagename

am start -n com.test.demo/com.test.demo.MainActivity

查找某个应用的activity: dumpsys activity |grep 包名
查询Activity 任务栈: dumpsys activity -a
查询app 流畅度: dumpsys gfxinfo packageName 参考: Android UI性能测试——使用 Gfxinfo 衡量性能

dumpsys deviceidle whitelist
dumpsys app_permission -signature

电量
dumpsys battery
输入设备
查询当前使用的keylayout文件:dumpsys input
 input keyevent --longpress <键值>
服务
am startservice -n com.test.service/com.test.service.TestService
service list
广播
am broadcast -a com.test.demo.TEST_ACTION --ez state true --ei progress 100 --es testString "this is test string" 
dumpsys |grep BroadcastRecord
界面
查看分辨率 : wm size
查看密度: wm density                                                                                                                                                                                    
Physical density: 320

- 在当前焦点输入框中输入信息
 input text “1122”

- 界面相关信息打印
dumpsys display
音频
虚拟声卡配置
cat /proc/asound/card1/pcm1*/sub0/*ms


tinymix -D 2 0
设置
{system, secure, global}
- 获取值
settings get system namespace key
settings get global namespace key
settings get secure namespace key

- 设置值
settings put system namespace key
settings put global namespace key
settings put secure namespace key

settings put global hidden_api_policy  1 避免部分内部接口不可见

输入法

settings get secure default_input_method

日期

settings get system date_format

当前语言获取

getprop |grep locale
dumpsys language_service
USB
cd /sys/kernel/debug 
cat hid/XXXXX/rdesc
cat usb
调试
Android内存查看
dumpsys meminfo

ubuntu 好用工具:

ubuntu14.04 安装vscode
Ubuntu16.04下配置VScode的C/C++开发环境
ubuntu安装Beyond Compare 4 并破解

#清除bcompare缓存
rm -rf ~/.config/bcompare/

BeyondCompare的使用小技巧

#ubuntu打开当前目录:
nautilus .
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值