[Android Pro] app_process command in Android-阿里云开发者社区

开发者社区> 开发与运维> 正文
登录阅读全文

[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 :)

 

分类: Android Pro
本文转自demoblog博客园博客,原文链接http://www.cnblogs.com/0616--ataozhijia/p/4993148.html如需转载请自行联系原作者

demoblog

版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

分享: