【问题】:
~ $ adb shell screenrecord /sdcard/test.mp4
/system/bin/sh: screenrecord: inaccessible or not found
这是因为现在很多手机为了安全把 screenrecord 功能给回收了,导致我们无法再用该命令行进行录屏操作。
通过adb shell ls /system/bin/命令可以看到ls: /system/bin//screenrecord: Permission denied,说明确实没有录屏权限了。
另外一种简单易用的录屏方法
安装 (仅 macOS):
brew install scrcpy
如果没有 adb,则需要先安装:
brew cask install android-platform-tools
运行 scrcpy
安装完毕后,电脑连接手机,执行 scrcpy 可在电脑上面看到手机实时投屏:
scrcpy
录屏
如果想要录屏,执行以下两个命令之一:
scrcpy --record test.mp4
scrcpy -r test.mp4
也可以在不开启实时镜像显示的情况录屏:
scrcpy --no-display --record file.mp4
scrcpy -Nr file.mkv
更多