It’s not secure and inconvenient to do some low-level testing task depending on third party APPs. Shell is especially useful for such purpose.
1. Install Android Debug Bridge(ADB)
Download Android SDK and run SDK Manager to install the platform-tools, as following image shows:
2. Connect to android device with ADB
In order to push file into /system file system, root mount is required, so run following commands:
$ adb root $ adb remount
If no error occurred, you should see “remount succeeded” on terminal.
3. Write shell scripts
It’s almost the same as writing general shell scripts for Linux except the first line, for the android shell is located at /system/bin directory.
#!/system/bin/sh # DO SOMETHING
4. Push script to android
Push the script, test_script for example, to android:
$ adb push /path/to/test_script /system/xbin/test_script
And change permission:
$ adb shell chmod 6755 /system/xbin/test_scripts
5. Run from Android
If you wanna run the scripts on Android, you’d better install Android Terminal Emulator.