#!/bin/bash
DIR_PATH="/sdcard/log/xxxxdir"
function useAdbReadLastFileFromDir(){
fileName=`adb shell ls $1|tail -1`
if [ -n $fileName ]
then
echo "fileName:"
echo "adb pull $PATH/$fileName"
fileContent=`adb pull $PATH/$fileName`
echo "fileContent:"$fileContent
else
echo "file not found exception"
fi
}
useAdbReadLastFileFromDir $DIR_PATH
android6.0 yotaphone / sunsang note5无法从sdcard中提取文件,错误消息说:
file or dir not exist
但是androi8.0 oppo findx / mi mix2可以。
help〜!
答案 0 :(得分:0)
adb pull
具有2个必需参数:REMOTE_FILENAME
和LOCAL_FILENAME
如果您想adb pull
将文本文件保存到stdout
,请改用adb shell cat FILENAME