rahul.ramanujam
rahul.ramanujam

Reputation: 5618

adb "am start -n" not working for debug version

I am trying to use adb to launch activites for testing,But it does not work for the debug version :

This works

adb shell am start -n com.xx.xx/.main.ParentActivity

This doesn't

adb shell am start -n com.xx.xx.debug/.main.ParentActivity

Both debug and release packages are available under /data/data

Upvotes: 0

Views: 866

Answers (2)

koral
koral

Reputation: 2533

If you have class com.xx.xx.main.ParentActivity and your application id is com.xx.xx.debug then you have to specify FQCN like this:

adb shell am start -n com.xx.xx.debug/com.xx.xx.main.ParentActivity

Dot just after slash is shortcut which can be used only if FQCN starts with application id.

Upvotes: 1

petey
petey

Reputation: 17140

  1. use adb shell am start -D -n com.xx.xx.debug/.main.ParentActivity -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
  2. then you will be able to attach your debugger (via your IDE) and the app will start (see https://blog.jetbrains.com/idea/2011/05/new-in-105-attach-debugger-to-a-running-android-process/)

Upvotes: 0

Related Questions