0
나는 sh 스크립트를 실행하기 위해 자바 프로그램을 작성했다. 그 동안 많은 장치에 많은 APK를 설치했습니다. 하지만 나는 내 스크립트에 약간의 문제가 있으며 그 이유를 모른다. 스크립트의 코드는 내가 어떤 명령을 알 수없는 및 스크립트가 완료되지 않습니다 문제가ls - *. apk?
#!/bin/bash
checkParameter() {
echo "$1"
if [ -d $1 ]; then
echo "$1 est bien un repertoire"
else
echo "Vérifier si vous avez bien séléctionné un reperoire"
fi
}
# pour chercher les devices connectés
devices(){
adb devices > devices.txt
}
install(){
echo "Debut de l'installation"
a=`ls $1 *.apk | wc -l`
for SERIAL in $(adb devices | tail -n +2 | cut -sf 1);
do
echo "le nombre des Applications à installer $a"
for APKLIST in $(ls $1 *.apk);
do
if [ $a -eq 0 ]
then
break;
fi
echo "Installatroning $APKLIST on $SERIAL"
#adb -s $SERIAL install $1/$APKLIST &
#adb bugreport > bug.txt
done
$a = `expr $a - 1`
done
echo "La fin de l'Installation "
}
checkParameter
devices
install
echo 'exit normally'
exit 0
입니다.
est bien un repertoire
Debut de l'installation
./codes/adb.sh: ligne 24: =3 : commande introuvable
le nombre des Applications à installer
ls: impossible d'accéder à *.apk: Aucun fichier ou dossier de ce type
expr: erreur de syntaxe
./codes/adb.sh: ligne 41: = : commande introuvable
La fin de l'Installation
exit normally
, 당신의 identation를 해결하십시오로
또는, 당신은 또한 쓸 수 있습니다. 탭과 스페이스의 혼합은 에디터에서와 같이 표시되지 않을 수 있습니다. – chepner
LANG = C./script'는 영어를 사용합니다.) ================================================================================================================================================================================================================== –