Does any body know how to call
am start -a ACTIVITY from uiautomator code.
Or is it possible to start activity right from junit
What I have done, is make the starting the app and running your UIAutomator tests part of the build. This is how I get my UIAutomator test to run after I build the Ant build.xml. This snippet is added to the end of the build.xml and causes your application to start, then starts your UI tests. Using eclipse make sure you go to right-click build.xml then -> Run As -> Ant Build... and make sure the correct targets are selected: 'build', 'install', 'start', 'mytest'. Targets 'start' and 'mytest' are added by following snippet.
Starting Navigation Example
Running UI Tests