toybox

how to use find command in adb shell

房东的猫 提交于 2019-12-07 01:09:00
问题 I want to check if there is a certain file inside a directory in my android device. I use the following line in my windows batch adb shell find /mnt/sdcard/koinoxrista -name Bill.txt I want to do something if the file exists and something else if file does not exist. How can I do this? 回答1: Find command is not supported in adb shell. This command will also show you hidden files adb shell ls -laR | grep filename 回答2: I am afraid that the Android emulator does not provide with the 'find'

how to use find command in adb shell

倾然丶 夕夏残阳落幕 提交于 2019-12-05 05:32:58
I want to check if there is a certain file inside a directory in my android device. I use the following line in my windows batch adb shell find /mnt/sdcard/koinoxrista -name Bill.txt I want to do something if the file exists and something else if file does not exist. How can I do this? Find command is not supported in adb shell. This command will also show you hidden files adb shell ls -laR | grep filename I am afraid that the Android emulator does not provide with the 'find' program. The find command is supported in Android since version 6.0 (Mashmallow). This is because it's including Toybox

Using “printf” for hex values in android shell

人走茶凉 提交于 2019-12-02 07:53:38
I am porting my shell script (quite big shell script) from bash to android shell (mksh shell). In Android, printf does not seem to be working the same way as it works in other Linux systems. Sample code : $ cat sample.sh ... func1() { A=100 HEXA=`printf "%04x" ${A}` echo "A - ${A} HEXA - ${HEXA}" } func1 This function's output is as follows. $ ./sample.sh A - 100 HEXA - 300000078 It is printing a really weird number. I saw from other posts and from the manpage of mksh that printf is not recommended to be used in mksh . My shell script, which is quite big, is using it very heavily. So, I want

Using “printf” for hex values in android shell

你说的曾经没有我的故事 提交于 2019-12-02 06:54:11
问题 I am porting my shell script (quite big shell script) from bash to android shell (mksh shell). In Android, printf does not seem to be working the same way as it works in other Linux systems. Sample code : $ cat sample.sh ... func1() { A=100 HEXA=`printf "%04x" ${A}` echo "A - ${A} HEXA - ${HEXA}" } func1 This function's output is as follows. $ ./sample.sh A - 100 HEXA - 300000078 It is printing a really weird number. I saw from other posts and from the manpage of mksh that printf is not