本人linux菜鸟,都说Android也是linux,既然linux可以同类链接工具链接,比如xshell,那么要怎么样才可以用xshell这样的工具链接安卓手机呢?
巴扎黑2017-04-17 17:31:02
Android is indeed a Linux system, but Android is not a standard GNU/Linux distribution. Unlike Raspbian (an ARM architecture Linux distribution based on Debian), you can directly connect to the OpenSSH Server on it through an ssh client. Management.
Of course, many GNU/Linux software can be cross-compiled and used on Android, but because Android does not allow root permissions by default, it is not practical to run OpenSSH Server on Android.
The poster can open a Shell through adb provided in the Android SDK to operate the Android system. First, the poster needs to install the Android SDK on your computer, then connect your Android phone to the computer using USB, and open the "Developer Options" of the Android phone. "USB debugging" in ", and then open this Shell by entering adb shell
on the command line.adb shell
打开这个Shell.
当然,楼主可能不想安装Android SDK,也不想通过USB连接手机进行管理,而是想通过无线网络进行管理,那你可以试试下面这个变通的方法.简单说,就是在浏览器里跑Shell,界面无非就是一个文本域textarea用于填写命令,一个AJAX运行按钮,下面显示运行结果,服务器(这里指的是Android端)运行用户输入的命令.
首先,在你的Android手机上安装一个PHP服务器,比如监听0.0.0.0:8181端口,网站根目录为SD卡下的phpdroid.php -S 0.0.0.0:8181 -t /path/to/sdcard/phpdroid
因为Android没有防火墙的说法,所以无线局域网内的其他设备可以通过Android手机的IP直接访问这个PHP服务器.
PHP这边可以用echo shell_exec('ls');
First, install a PHP server on your Android phone, such as listening on port 0.0.0.0:8181, and the website root directory is phpdroid in the SD card.php -S 0.0.0.0:8181 -t /path/ to/sdcard/phpdroid
Because Android does not have a firewall, other devices in the wireless LAN can directly access this PHP server through the IP of the Android phone.
For PHP, you can use echo shell_exec('ls ');
Easily execute commands and return.
I cross-compile and package the Android version of PHP package on Ubuntu, which is called PHPDroid. For details, please see my blog post: