简体   繁体   English

Android Shell脚本

[英]Android shell script

I have an android 4.2 phone on which I wish to run the following script: 我有一个Android 4.2手机,希望在其上运行以下脚本:

su
setprop service.adb.tcp.port 5555
stop adbd
start adbd

If I put it into and .sh file, and have the SManager app to run it, it does nothing, no error nothing, just get back the console. 如果我将其放入.sh文件中,并使用SManager应用程序运行它,则它什么也不做,也没有任何错误,只要回到控制台即可。 I allow root access for the app. 我允许对该应用程序进行root访问。

If I manually type it into Terminal Emulator, then it works. 如果我手动将其键入到Terminal Emulator中,那么它将起作用。

How can I run .sh files easily (without much typing) other then SManager, as its obviously not working. 除了SManager之外,我如何才能轻松运行.sh文件(无需过多键入),因为它显然无法正常工作。

Thank you 谢谢

All my scripts was ctrl c ctrl v to sh files. 我所有的脚本都是ctrl c ctrl v到sh文件。 Some windows spec char went into the script, and it did nothing. 一些Windows spec char进入了脚本,但是什么也没做。 As soon as i typed the whole thing in on touchkeyboard, AND allowed Root run within SManager (it was not enough to start it as rooted only), it came alive. 当我在触摸键盘上输入整个内容,并允许Root在SManager中运行时(仅以root用户身份启动它是不够的),它就变得活跃起来了。

Thanks! 谢谢!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM