0

i try to debug my android app via usb,

and first time i run it works perfectly,

but i close android studio and restart again,it reports

(i checked usb debug option is open)

12/12 23:48:42: Launching 'app' on HUAWEI VTR-AL00.
$ adb shell am start -n "com.example.onhw/com.example.onhw.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Error while executing: am start -n "com.example.onhw/com.example.onhw.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.onhw/.MainActivity }
Error type 3
Error: Activity class {com.example.onhw/com.example.onhw.MainActivity} does not exist.

Error while Launching activity

but it still works on virtual device

can anyone give some advices?

my phone is HUAWEI P10

ratsafalig
  • 442
  • 5
  • 21

1 Answers1

0

finally i found it was huawei's system causing the problem

because in debug mode,even i uninstall the application,it still remain the debug-signature of the application,but android use signature to tell if a app has been installed

so when i try to debug this app again,the debug-signature is still in the system so it can't be install

sovling way:

is to use adb.exe which in Sdk/platform-tools/adb.exe and executeadb uninstall com.example.application to totally remove the debug-signature

ratsafalig
  • 442
  • 5
  • 21