1.获取手机cpugit
./adb -s emulator-5554 shell "getprop ro.product.cpu.abi | tr -d '\r'"github
arm64-v8ashell
2.获取Android sdk版本架构
./adb -s emulator-5554 shell "getprop ro.build.version.sdk | tr -d '\r'"tcp
25ide
3.根据cpu架构和sdk版本ui
下载minicap:spa
https://github.com/openstf/minicap/archive/v2.2.0.zipip
4.将minicap推送到手机v8
./adb -s emulator-5554 push minicap /data/local/tmp
2378 KB/s (576032 bytes in 0.236s)
./adb -s emulator-5554 push minicap.so /data/local/tmp
1333 KB/s (18480 bytes in 0.013s)
5. 给minicap添加运行权限
./adb -s emulator-5554 shell chmod 0755 /data/local/tmp/minicap
6. 获取设备长宽
./adb -s emulator-5554 shell wm size
Physical size: 320x480
6.运行minicap
./adb -s emulator-5554 shell LD_LIBRARY_PATH=/data/local/tmp /data/local/tmp/minicap -P 1080x1920@1080x1920/0
7. 端口转发
./adb -s emulator-5554 forward tcp:1717 localabstract:minicap