一、运行命令介绍:

Android无线测试之—UiAutmator运行命令介绍与快速调试

#Test.java

package com.uiautomatortest;

import android.os.Bundle;
import android.os.RemoteException;

import com.android.uiautomator.core.UiDevice;
import com.android.uiautomator.testrunner.UiAutomatorTestCase;

public class Test extends UiAutomatorTestCase {
    
    public void testHome(){
        
        UiDevice.getInstance().pressHome();
        sleep(2000);
    }
    
    public void testMenu(){
        
        UiDevice.getInstance().pressMenu();
        sleep(2000);
    }
    
    public void testRecent() throws RemoteException{
        
        UiDevice.getInstance().pressRecentApps();
        sleep(2000);
    }
    
    public void testDemo(){
        
        UiDevice.getInstance().pressHome();
        sleep(2000);
        Bundle bundle=getParams();
        String phone=bundle.getString("phone");
        System.out.println("PHONE="+phone);
    }

}
Test.java

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案