Forum Xamarin.Android

adb shell am start -n com.package.name/.MainActivity not working as intented?

_JoshBrown_JoshBrown USUniversity ✭✭

When declaring Activities in Xamarin, they must begin with the Activity attribute.
With this attribute, Xamarin compiles it down to a AndroidManifest.xml in the Android project's obj\Debug\android\manifest\AndroidManifest.xml file.
If you examine this file, you notice that the activity names start with MD5 hash where they are declared. This hash also gets released out to an APK when it's released.
Because of this MD5 hash, I can't run the command...

adb shell am start -n com.package.name/.MainActivity

...which is something that Android documentation says I should be able to do.

https://developer.android.com/studio/command-line/shell.html

The only thing I can get to work is running this command...

adb shell am start -n com.package.name/md5********************************.MainActivity

Is this something I am just going to have to work with, or is there a work around to this feature of Xamarin?

Thanks,
Josh Brown

Best Answer

Answers

Sign In or Register to comment.