我可以用 adb 开始一个活动,如下所示
adb shell am start -a android.intent.action.MAIN -n com.package.name/com.package.name.ActivityName
Run Code Online (Sandbox Code Playgroud)
如何将意图数据添加到此命令,以便我可以从启动的活动中检索它?
以下是一些示例命令:
# specifying the action and data uri
adb shell am start -a "android.intent.action.VIEW" -d "http://developer.android.com"
# specifying the action, mime type and an extra string
adb shell am start -a "android.intent.action.SEND" --es "android.intent.extra.TEXT" "Hello World" -t "text/plain"
# specifying an explicit component name
adb shell am start -n "com.example.application/.MainActivity"
Run Code Online (Sandbox Code Playgroud)
带有意图的应用程序允许发送意图。
我在那里找到了这些信息:http : //www.xgouchet.fr/android/index.php?article42/launch-intents-using-adb
| 归档时间: |
|
| 查看次数: |
10102 次 |
| 最近记录: |