〖android〗 fast deployment of sshd and bash shells (Programs: droidsshd and Betterterminalemulatorpro)

Source: Internet
Author: User

~ ~ This article only makes the personal configuration record ~ ~

Because I often need sshd to connect the device, it crawl Logcat log too convenient, easy to troubleshoot problems, and multi-person sharing ;

And with the limitations of the USB hole, this is more meaningful;

The Super Terminal enhancement package deployed to the intranet, but also for the convenience of downloading, after all, it is not always possible to Sisu network, and the external network download is too slow;

The configuration of the enhanced package is relatively troublesome, also need to configure BIND9 domain name resolution server, Nginx or APACH2 Web server;

But for the general developer, the server that builds these things is not a thing;

In addition, SSH is different from the ADB shell, and some environment variables are not;

If this time, directly run PM or AM command, it will directly cause the Android device restart;

Of course, this is not no way, behind the sshcmd can solve this small problem;

File Download:

1. droidsshdv06.apk Download 1 (google) Download 2 (Domestic)

2. betterterminalemulatorpro.apk (super terminal) Download 1 (google) Download 2 (Domestic)

3. [Optional] HyperTerminal enhanced package bettertermpro_web.zip Download 1

To install the application:

1. Install the application droidsshd and HyperTerminal

2. [optional] extract bettertermpro_web.zip to Nginx or apache2 Web server root directory (direct external network conditions download is too slow, assuming this machine is HostA)

3. [Optional] wifi,dns parsing server settings for mobile Access (provided that there is an intranet domain name resolution Service) point magicandroidapps.com to HostA

Open sshd:

Run Droidsshd, select Run as root, assuming the port number is set to 3322, tick start on boot, and tick start

Ssh_config configuration:

VI ~/.ssh/config

Enter the configuration information, such as my Xiaomi 2 phone is configured:

Host Xiaomi     55.55. 137.149 3322 User    root      

No password login:

Ssh-copy-id Xiaomi

Because the $home variable is droidsshd assigned to/sdcard, you also need to log in to Xiaomi the device and perform some operations

After SSH Xiaomi Login, execute the following command:

busybox=/data/data/com.magicandroidapps.bettertermpro/bin/Busybox.exe$busyboxCP/sdcard/.SSH/authorized_keys/data/data/br.com.bott.droidsshd/files/etc/Authorized_keysuid_ssh=$ ($busyboxStat-C%g/data/data/br.com.bott.droidsshd/files/etc) $busyboxchmod$uid _ssh: $uid _ssh/data/data/br.com.bott.droidsshd/files/etc/Authorized_keysunset Uid_ssh$busyboxMount-O REMOUNT,RW/System$busyboxCP/data/data/com.magicandroidapps.bettertermpro/bin/SCP/system/xbin/SCP$busyboxCP/data/data/com.magicandroidapps.bettertermpro/bin/sftp-server/data/data/br.com.bott.droidsshd/files/bin/unset BusyBox

The SCP and Sftp-server are replicated to allow DROIDSSHD to support SSHFS mount for easy file operation

Sshcmd:

Let the SSH command completely replace the ADB shell command

#!/bin/bash# used to touch the ADB shell operation, stability comparison adb shell is much better! # Self:get Locationself=$(Readlink-F $0) Self_dir=$(dirname$self) DEVICE=${device:-'Xiaomi'}busybox=/data/data/com.magicandroidapps.bettertermpro/bin/busybox.exe# Run CommandSSH-F $emmdevices $DEVICE $busyboxEnvLocal_env_curr_modem=/DEV/BLOCK/PLATFORM/MSM_SDCC.1/by-name/modem1 Loop_mountpoint=/mnt/Obb Ld_library_path=/vendor/lib:/system/Lib Bootclasspath=/system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/ framework/ext.jar:/system/framework/framework.jar:/system/framework/framework_ext.jar:/system/framework/ android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/Qcom.fmradio.jar PATH=/sbin:/vendor/bin:/system/sbin:/system/bin:/system/XBin Local_env_curr_system=/DEV/BLOCK/PLATFORM/MSM_SDCC.1/by-name/system1 Mksh=/system/bin/SHAndroid_data=/Data Android_root=/system HOSTNAME=Android SHELL=/system/bin/SHAndroid_property_workspace=8,65536External_storage=/storage/sdcard0 android_assets=/system/App term=vt100 Asec_mountpoint=/mnt/ASEC HOME=/Data Android_bootlogo=1     "[email protected]"

This way, use a similar command for Env Device=xiaomi./sshcmd am start-n com.easyapp.injecta/com.fake.activity.fakeutil You can launch an application from the command line

Sshpidcat:

Of course, you also expect to grab logcat when you specify an application, right?

Perhaps everyone expects the crawl log to be like this: logcat <package_name> Specifies to crawl only the relevant log output

Yes, you can do it with Pidcat, download 1 (GitHub)

But this is also dependent on the USB connection, through a simple modification, so that it can be SSH to crawl the specified APK log output (dependent on the previous sshcmd)

Because the file is large, directly to the file download:

Sshpidcat.zip (contains Sshcmd and sshpidcat two files) Download 1

Like this, use a similar command . Env Device=xiaomi./sshpidcat com.easyapp.injecta to crawl only com.easyapp.injecta output

〖android〗 fast deployment of sshd and bash shells (Programs: droidsshd and Betterterminalemulatorpro)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.