1.安装JDK,并配置环境变量
2.安装集成了Android SDK的Eclipse,并配置Android的相关环境变量
3.打开Eclipse,新建java工程
4.为工程导入uiautomator.jar和Android.jar
5.工程下新建类extends UiAutomatorTestCase
如果提示“The type junit.framework.TestCase cannot be resolved.It is indirectly referenced from require .class files”,则右键单击项目,选择Build Path>Configure Build Path,添加Junit3即可。