android手机版本

1.判断安卓手机是64位,还是32位

adb pull /system/bin/cat
file cat

32位
1418970-20181016200229757-517874278.png
64位
1418970-20181016201538098-967629133.png

2.判断安卓手机CPU是64位,还是32位

adb shell getprop|grep ro.product.cpu
#如果ro.product.cpu.abilist64内容为空,CPU为32位

32位
1418970-20181016200300776-147205246.png
64位
1418970-20181016200253813-464343383.png

3.判断安装包是否可以安装在32位的安卓机或模拟器

将库存放在lib/下,针对不同的平台、不同的指令,启动不同的库。可以通过查看lib目录下是否包含x86目录判断安装包是否支持真机
armeabi 真机
x86 模拟器或x86机型

#unzip -l 参数:  list files (short format)
unzip -l xueqiu_108_05221425.apk |grep lib/

1418970-20181022130303278-1032065252.png

4.adb shell input命令介绍

adb shell input
Usage: input [<source>] <command> [<arg>...]

The sources are: 
      dpad
      keyboard
      mouse
      touchpad
      gamepad
      touchnavigation
      joystick
      touchscreen
      stylus
      trackball

The commands and default sources are:
      text <string> (Default: touchscreen)
      keyevent [--longpress] <key code number or name> ... (Default: keyboard)
      tap <x> <y> (Default: touchscreen)
      swipe <x1> <y1> <x2> <y2> [duration(ms)] (Default: touchscreen)
      draganddrop <x1> <y1> <x2> <y2> [duration(ms)] (Default: touchscreen)
      press (Default: trackball)
      roll <dx> <dy> (Default: trackball)
      tmode <tmode>
#示例
adb shell input text "hello world" #输入hello world
adb shell input keyevent 4    #返回
adb shell input tap 250 250 #点击
adb shell input swipe 500 500 500 1500    #滑动
adb shell input draganddrop 500 500 500 1500    #拖放

更多keyevent code查看这里

5.获取手机分辨率

3种方式

adb shell dumpsys window displays|grep init=|awk '{print $1}'
adb shell dumpsys |grep init=|awk '{print $1}'    #适用于低版本的安卓机
adb shell wm size

1418970-20181213175927277-2145119490.png

转载于:https://www.cnblogs.com/csj2018/p/9800334.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值