• Android am start命令


    Android am start 命令详解
    start [options]
    option:

    -D: Enable debugging.
    -W: Wait for launch to complete.
    –start-profiler : Start profiler and send results to .
    -P : Like --start-profiler, but profiling stops when the app goes idle.
    -R: Repeat the activity launch times. Prior to each repeat, the top activity will be finished.
    -S: Force stop the target app before starting the activity.
    –opengl-trace: Enable tracing of OpenGL functions.
    –user <USER_ID> | current: Specify which user to run as; if not specified, then run as the current user.

    -a
    启动时,要执行的动作,如:android.intent.action.VIEW,也可以自己定义action
    -d <DATA_URI>
    启动时,要传入的URI
    -t <MIME_TYPE>
    启动时的文件类型,视频,音频,还是网页
    -c
    -n

    直接启动一个组件,例如:adb shell am start -n com.example.app/.ExampleActivity

    :在windows下执行下述命令时

    am start -a com.vod.action.videoplayer.open -d"video2://?video_id=7LM3dd.dF6df0be0e2b5c2ab1&cover_id=7LM3dd.M.2e7bd2d836927fd7&vendorId=327"
    
    • 1

    发现应用在接收到intent后,intent中的参数变为“video2://?video_id=7LM3dd.M.2e7bd2d836927fd7”。$符号后的数据被截断了。
    原因:
    adb shell相当于是在linux shell环境下运行的,而&符号是shell中的特殊字符,表示后台运行,因此会出现截断的情况
    解决方法
    1.

    adb shell
    am start -a com.vod.action.videoplayer.open -d"video2://?video_id=7LM3dd.dF6df0be0e2b5c2ab1&cover_id=7LM3dd.M.2e7bd2d836927fd7&vendorId=327"
    
    • 1
    • 2
    adb shell am start -a com.vod.action.videoplayer.open -d"video2://?video_id=7LM3dd.dF6df0be0e2b5c2ab1&cover_id=7LM3dd.M.2e7bd2d836927fd7'&'vendorId=327"
    
    
    • 1
    • 2
  • 相关阅读:
    JAVA实现兔子问题--递归
    ThinkPHP5 按年度水平分表实例
    顺序表详解(SeqList)
    音视频开发基础知识
    java生成pdf
    个人电影网站web网页设计制作—— 影视公司5页 DIV+CSS制作 浮动布局
    Java的序列化
    Dubbo使用invoke指令来调用dubbo接口
    AlexNet论文笔记
    Python-进程和线程
  • 原文地址:https://blog.csdn.net/qq_36390114/article/details/125606185