"<" doesn't work in adb shell

Asked 2 years ago, Updated 2 years ago, 116 views

I created a viable native binary that I could use with adb shell, but it works if I run it separately from the command to enter adb shell, but it doesn't work if I run it in a row.
If you know the solution, please let me know.

Successful Commands

 (C:\user~)$adb shell
(on adb shell) $/data/local/tmp/makeaction</mnt/sdcard/testtap.txt

A command that doesn't work (I want to make this work)

(C:\user~)$adb shell/data/local/tmp/makeaction</mnt/sdcard/testtap.txt
The specified path could not be found.

By the way, I did the following to find out how well it was going, and I was able to confirm that makeaction was running.

(C:\user~)$adb shell/data/local/tmp/makeaction

In addition, if you do the following, there will be no errors, but the results will be the same as when you did the previous makeaction only.

adb-s HT36MS908593 shell/data/local/tmp/makeaction<C:\testtap.txt

"I think there are some restrictions on the destination to the right of ""<"", but I stumble here."
Thank you for your cooperation.

By the way, I used this website as a reference.
http://techblog.qoncept.jp/?p=397

adb

2022-09-29 21:29

1 Answers

adb shell"/data/local/tmp/makeaction</mnt/sdcard/testtap.txt"

Quote the entire command with " 」 or 」 ' as shown in .

< is the redirect symbol, and it is up to the shell to interpret it and connect the file to the standard output of the command.
The question is which shell interprets this symbol to perform the redirect.

adb shell/data/local/tmp/makeaction</mnt/sdcard/testtap.txt

If so, it is the shell of the development (local) environment that interprets the redirect.
Attempt to connect the development machine /mnt/sdcard/testtap.txt to the standard input of the adb command.
The adb shell must handle the redirect.

If you quote < with "" and so on, the is also just a string for the development machine shell, and it goes straight to the adb shell.


2022-09-29 21:29

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.