• [Android Pro] app_process command in Android


    reference to : http://blog.csdn.net/wangkaiblog/article/details/46050587

    本来以为存放在/systen/bin/下的monkey、input、am等adb shell命令都是二进制可执行程,偶尔cat input下,发现不是二进制文件,内容如下:

    # Script to start "input" on the device, which has a very rudimentary
    # shell.
    #
    base=/system
    export CLASSPATH=$base/framework/input.jar
    exec app_process $base/bin com.android.commands.input.Input $*

    这段脚本的作用就是通过app_process工具启动放在/system/farmework/下的input.jar 文件。我查看了下framework文件夹里面的确有input.jar文件。

    What is this app_process

    Although not that popular “app_process” command is used heavily in Android, for example the well know “am” script is using it. Everybody knows how to start an application from adb shell:
    am start -n yourpackagename/.activityname
    However “am” is just a shell script and what stays in the base of the am script is our app_process binary:

    root@android:/ # cat /system/bin/am
    cat /system/bin/am
    # Script to start "am" on the device, which has a very rudimentary
    # shell.
    base=/system
    export CLASSPATH=$base/framework/am.jar
    exec app_process $base/bin com.android.commands.am.Am "$@"
    root@android:/ #

    So app_process is the binary used to start java code. All the apps, instrumentations or installations are tarted using this.

    Lets see the official usage output:

    root@android:/ # app_process
    Usage: app_process [java-options] cmd-dir start-class-name [options]
    Not quite complete as usual :)
  • 相关阅读:
    Selenium生成Report的利器- ExtentReports
    学习使用monkey 测试
    charles 结合mocky 模拟数据
    Vue.use()源码分析且执行后干什么了
    commonjs 与 es6相关Module语法的区别
    vue函数化组件 functional
    html5细线表格制作
    移动端H5页面禁止长按复制和去掉点击时高亮
    javascript生成器
    promise和生成器的结合
  • 原文地址:https://www.cnblogs.com/0616--ataozhijia/p/4993148.html
Copyright © 2020-2023  润新知