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" 
相关推荐
独行soc7 小时前
2025年渗透测试面试题总结-254(题目+回答)
网络·python·安全·web安全·adb·渗透测试·安全狮
h***066511 小时前
MySQL无法连接到本地localhost的解决办法2024.11.8
数据库·mysql·adb
百***864612 小时前
Linux下MySQL的简单使用
linux·mysql·adb
r***86981 天前
mysql的主从配置
android·mysql·adb
百***48071 天前
Linux下MySQL的简单使用
linux·mysql·adb
q***61501 天前
【数据库】MySQL的安装与卸载
数据库·mysql·adb
q***71852 天前
MySQL--》如何在MySQL中打造高效优化索引
android·mysql·adb
q***82912 天前
MySQL--》如何通过选择合适的存储引擎提高查询效率?
数据库·mysql·adb
百***99243 天前
MySql的慢查询(慢日志)
android·mysql·adb