[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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值