使用am start -n启动com.isi.testapp.Welcome报错,求解决方法
Fixing "Bad component name" Error When Starting Activity via ADB
Hey there! Let's break down why you're hitting that "Bad component name" error and how to fix it quickly.
The Root Cause
The am start -n command requires a specific format for the component name: <app-package-name>/<fully-qualified-activity-class-name>. You only provided the activity class name (com.isi.testapp.Welcome) without pairing it with the app's package name separated by a slash—this is why the system can't locate the Activity.
The Correct Command
Since your app's package name is likely com.isi.testapp (matching the Activity's package path), the working command should be:
am start -n com.isi.testapp/com.isi.testapp.Welcome
Extra Troubleshooting Tips
If you still run into issues, try these steps to verify details:
- Confirm the app is installed and the package name is correct with:
pm list packages | grep isi - List all exported Activities for the app to double-check the full component name:
dumpsys package com.isi.testapp | grep -A 5 "Activity" - Ensure you're in a valid adb shell session (you should see a device-specific prompt like
device:/ $).
内容的提问来源于stack exchange,提问作者Utkarsh Agrawal
相关产品推荐
相关产品推荐

