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" 
相关推荐
__Witheart__6 小时前
3568 Android otg模式下adb热拔插不识别
android·adb·rockchip
starvapour1 天前
在关机键损坏的情况下让手机关机
android·adb·手机
Cry丶3 天前
【已解决】adb devices 能识别手机,但 HBuilderX 搜索不到设备的避坑指南
android·adb·uni-app·hbuilderx·真机调试
溜达的大象3 天前
Prometheus怎么监控MySQL?mysqld_exporter部署与告警教程
mysql·adb·prometheus
辰同学ovo4 天前
从一条 SQL 到三个原则:MySQL 心智模型
sql·mysql·adb
betazhou5 天前
MySQL8.0.45主从搭建
adb·mysql主从
alice--小文子6 天前
安卓(Android)- 怎么在adb中通过真机操作日志相关
android·adb
大尚来也6 天前
老项目 PHP 5.6 升级 PHP 8 完整迁移步骤与兼容坑汇总
android·adb
寒水馨7 天前
macOS下载、安装scrcpy-v4.1(附安装包scrcpy-macos-aarch64-v4.1.tar.gz)
macos·adb·手机控制·scrcpy·投屏软件·android投屏·屏幕镜像
—Miss. Z—7 天前
计算机二级MySQL——简单应用题(事件&视图)
android·mysql·adb