You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用adb shell am启动Android Activity时提示“Bad component name”错误的排查求助

Fixing "Bad component name" Error with adb am start

Hey there, let's break down why you're hitting that frustrating "Bad component name" error when trying to launch your Activity via adb.

The Root Cause

The am start -n command requires a full component name in the strict format:
[APP_PACKAGE_NAME]/[FULL_ACTIVITY_CLASS_NAME]

Looking at your Manifest details:

  • Your app's official package name is com.telink.ble.mesh.demo (from the <manifest> tag's package attribute)
  • Your Activity's full class name is com.telink.ble.mesh.ui.DeviceProvisionActivity (from the <activity> tag's name attribute)

Your earlier attempts either omitted the package name entirely, or combined it with the Activity name in the wrong way (no / separator), which is why the system couldn't recognize the component.

Correct adb Command

Try running this command instead—it uses the proper component name format:

adb -s "R5CRC0HRRAW" shell am start -n com.telink.ble.mesh.demo/com.telink.ble.mesh.ui.DeviceProvisionActivity

How to Verify the Component

If you want to double-check that the component is properly registered, run this command to list all components for your app:

adb -s "R5CRC0HRRAW" shell dumpsys package com.telink.ble.mesh.demo | grep DeviceProvisionActivity

You should see a line referencing com.telink.ble.mesh.ui.DeviceProvisionActivity if the Activity is correctly set up in your Manifest.

Quick Side Note

Since your Activity doesn't have an <intent-filter> with a MAIN action, launching it via the explicit component name is the only valid approach here—this command should work once you use the correct format.

内容的提问来源于stack exchange,提问作者Enzo Abjean

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.27 18:07:30