Adb 模拟外调

方式一、通过指定包名 +类名启动:

  • 包名:com.xx.xx.xx

  • 类名:com.xx.xx.xx.RouterActivity

  • 参数名:param

java 复制代码
Intent intent = new Intent();
ComponentName comp = new ComponentName("com.xx.xx.xx", "com.xx.xx.xx.RouterActivity");
intent.setComponent(comp);
intent.putExtra("param", ${EPG下发的参数});
mContext.startActivity(intent)
java 复制代码
am start -n "com.xx.xx.xx/com.xx.xx.xx.RouterActivity" --es "param" "xxxxx" 

方式二、通过 Action启动:

  • action:com.xx.xx.topage

  • 参数名:param

java 复制代码
Intent intent= new Intent();
intent.putExtra("param", ${EPG下发的参数});
intent.setAction("com.xx.xx.topage");
mContext.startActivity(intent);
java 复制代码
am start -a com.xx.xx.topage --es param "xxxxx" 
相关推荐
loosed16 小时前
Ubuntu mysql8 tar.xz 安装
linux·ubuntu·adb
坐吃山猪1 天前
AutoGLMPhone05-源码-ADB模块
adb
菜择贰1 天前
ubantu下载mysql
数据库·mysql·adb
坐吃山猪1 天前
AutoGLMPhone03-adb模块
adb·llm·glm
今晚务必早点睡1 天前
MySQL 新手避坑指南:安装、区分、检查一步到位
数据库·mysql·adb
我的offer在哪里2 天前
mysql修改密码
adb
编程小Y2 天前
MySQL 与 MCP 集成全解析(核心原理 + 实战步骤 + 应用场景)
数据库·mysql·adb
嘻哈baby2 天前
MySQL主从复制与读写分离实战指南
数据库·mysql·adb
Neolnfra2 天前
系统敏感安全文件路径
linux·windows·安全·web安全·网络安全·adb·系统安全
何妨呀~3 天前
mysql 8服务器实验
android·mysql·adb