Answers:
您可以使用Android调试桥(ADB)外壳在电话上发出基本的Linux命令,就像在终端仿真器应用程序中一样。要安装,您需要执行以下操作:
Settings -> About phone
,然后点击“内部版本号”七次。这启用了开发人员工具。Developer options
在“系统”部分下看到。Developer options
,启用“ Android调试”选项,然后点击OK
验证提示。adb devices
adb shell
并按Enter,您应该已连接到电话的终端。这应该使您入门。ADB命令列在Google网站上的此处。该外壳程序提供了一些基本的Linux命令,如ls
,cp
等。请注意,大多数文件和设备管理命令将需要root(即提升的特权),这是一个单独的主题。
除了Chahk描述的ADB变体(至少需要在计算机上至少部分安装ADB)之外,还可以在设备上安装SSH服务器应用程序(示例包括但不限于SSH Server,DigiSSHD,Servers Ultimate)。然后,您可以使用ssh
Linux / Mac上的命令或Windows上的PuTTY之类的工具连接到设备并运行Shell命令,就像在设备本身上使用终端应用程序一样。
你会需要
Your Android phone ( Rooted and with Wi-Fi functionality )
SSHDroid (SSH server)
PuTTY.exe (SSH client)
设置SSHDroid
Install “SSHDroid” from android market to your phone this will turn your phone into a SSH server
For the first time you need to set-up a password to log-in shell. Default password is admin which may you have to change on first time
设置腻子
Download PuTTY.exe for SSH Client on your windows PC, it comes in single executable file so you don’t need to install that just double click on that and PuTTY will start.
There is no need to setting up any thing in PuTTY.
开始吧
First step is to running Wi-Fi and connect your android phone to target PC, then run SSHDroid server into your mobile phone, but before that make sure under the SSHDroid’s application window click Options -> “Require WiFi” is checked as seen on above pic screen 2. And then click “start” option.
Once SSH server is successfully started it will show IP address of your mobile phone in light sky color like this root@192.168.43.129 as seen on screen 4.
Take the IP “192.168.43.129” and type it to your PuTTY program’s (PC) host field and hit connect. Make sure port number is 22 as seen in second pic.
It will ask for certification click ok and then command line log-in window will appear, type “root” hit enter and then type the password for root user, default is “admin” as i mentioned before. After successful log-in you will be able to use Linux commands like ls, reboot -f, mkdir, find, etc.
如果您的电话已连接到Internet,则还可以使用网络命令,例如ping,wget,telnet等。