发布网友 发布时间:2022-12-17 00:09
共1个回答
热心网友 时间:2023-09-12 05:07
12345678910111213141516171819 package com.ibm.test; import java.io.File; import com.android.uiautomator.core.UiDevice;import com.android.uiautomator.core.UiObjectNotFoundException;import com.android.uiautomator.testrunner.UiAutomatorTestCase; public class MyUIauto extends UiAutomatorTestCase { private static final String TAG = "MyUIauto"; public void testPressHome() throws UiObjectNotFoundException { File file = new File("/data/local/tmp/local/tmp/qian.xml"); UiDevice uiDevice = getUiDevice(); //uiDevice.pressHome(); String realPath = "qian.xml"; uiDevice.mpWindowHierarchy(realPath); }}