小米电视机通过ADB远程安装APP

电视机信息

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
shell@xmen:/ $ free
total used free shared buffers
Mem: 1703063552 1636855808 66207744 0 63692800
-/+ buffers/cache: 1573163008 129900544
Swap: 524283904 19439616 504844288
shell@xmen:/ $ cat /proc/cpuinfo
Processor : AArch64 Processor rev 4 (aarch64)
processor : 0
processor : 1
processor : 2
processor : 3
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 wp half thumb fastmult vfp edsp neon vfpv3 tlsi vfpv4 idiva idivt
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4

Hardware : Amlogic
Serial : 230c0200e8748f53c4354026985ac903
shell@xmen:/ $

电视端设置

设置-账号与安全-允许安装未知来源的应用-允许ADB调试。

设置-关于-产品型号-遥控连续按5下OK键-开启开发者模式。

设置-关于-网络信息-查看电视机IPv4网络IP。

电脑端操作

1
https://github.com/Genymobile/scrcpy
1
C:\Users\Administrator>adb connect 192.168.8.31
1
2
3
4
5
6
7
8
9
10
C:\Users\Administrator>adb device
List of devices attached
192.168.8.31:5555 unauthorized

E:\>adb install .\ESFileExplorer-cn.apk
Performing Push Install
adb: error: failed to get feature set: device unauthorized.
This adb server's $ADB_VENDOR_KEYS is not set
Try 'adb kill-server' if that seems wrong.
Otherwise check for a confirmation dialog on your device.

电视机端,遥控器操作,确认OK。

1
2
3
4
5
6
7
8
9
10
11
E:\>adb devices
List of devices attached
192.168.8.31:5555 device


E:\>adb install .\ESFileExplorer-cn.apk
Performing Push Install
.\ESFileExplorer-cn.apk: 1 file pushed, 0 skipped. 0.4 MB/s (43862869 bytes in 107.818s)
pkg: /data/local/tmp/ESFileExplorer-cn.apk
电视机端,遥控器操作,确认OK。
Success

电脑端传文件到电视机,文件名不含中文。

1
2
E:\>adb push .\CA.png /storage/3ED8CA53D8CA08DB
.\CA.png: 1 file pushed, 0 skipped. 10.4 MB/s (106863 bytes in 0.010s)

查看小米电视安卓版本

1
adb shell getprop ro.build.version.release

远程关闭“文档管理”

1
C:\Users\Administrator>adb shell am force-stop com.xiaomi.mitv.mediaexplorer

远程开启小米电视资源管理器(打开默认选中”视频“)

1
2
 C:\Users\Administrator>adb shell am start -n com.xiaomi.mitv.mediaexplorer/.NewScraperMainEntryActivity
Starting: Intent { cmp=com.xiaomi.mitv.mediaexplorer/.NewScraperMainEntryActivity }

远程开启“文档管理”应用中的“远程管理”功能(此功能通过SwiFTP 3.3.14实现,需要root权限)

1
2
3
adb root

adb shell am startservice -n com.xiaomi.mitv.mediaexplorer/com.xiaomi.mitv.media.ftp.FtpServerService

远程查看电视机U盘等外设

1
2
3
4
5
6
7
C:\Users\Administrator>adb shell ls /storage/
09BA-0F01
3ED8CA53D8CA08DB
emulated
self

adb shell ls /storage/3ED8CA53D8CA08DB

远程打开电视机U视频播放(不循环)

1
2
3
C:\Users\Administrator>adb shell am start -a android.intent.action.VIEW -d file:///storage/3ED8CA53D8CA08DB/2023年9月8日新闻.mp4 -n com.mitv.mivideoplayer/com.mitv.videoplayer.VideoPlayerActivity

Starting: Intent { act=android.intent.action.VIEW dat=file:///storage/3ED8CA53D8CA08DB/2023年9月8日新闻.mp4 cmp=com.mitv.mivideoplayer/com.mitv.videoplayer.VideoPlayerActivity }