2727import com .android .ddmlib .IDevice ;
2828import com .google .common .util .concurrent .ListenableFuture ;
2929import com .google .common .util .concurrent .SettableFuture ;
30+ import com .yeetor .adb .AdbDevice ;
3031import com .yeetor .adb .AdbServer ;
3132import com .yeetor .minitouch .Minitouch ;
3233import com .yeetor .minitouch .MinitouchListener ;
3839 */
3940public class EngineDevice {
4041
41- private IDevice iDevice ;
42+ private AdbDevice device ;
4243 private Minitouch minitouch ;
4344 private boolean minitouchOpen = false ;
4445
4546 public static EngineDevice getDevice (String serialNumber ) {
46- IDevice iDevice = AdbServer .server ().getDevice (serialNumber );
47+ AdbDevice iDevice = AdbServer .server ().getDevice (serialNumber );
4748 if (iDevice != null ) {
4849 EngineDevice device = new EngineDevice (iDevice );
4950 if (device .isMinitouchOpen ()) {
@@ -53,8 +54,8 @@ public static EngineDevice getDevice(String serialNumber) {
5354 return null ;
5455 }
5556
56- public EngineDevice (IDevice iDevice ) {
57- this .iDevice = iDevice ;
57+ public EngineDevice (AdbDevice iDevice ) {
58+ this .device = iDevice ;
5859 minitouch = new Minitouch (iDevice );
5960 SettableFuture future = SettableFuture .create ();
6061
@@ -102,11 +103,11 @@ public void touchUp() {
102103 }
103104
104105 public String executeShellAndGetString (String command ) {
105- return AdbServer .executeShellCommand (iDevice , command );
106+ return AdbServer .executeShellCommand (device . getIDevice () , command );
106107 }
107108
108109 public void startApp (String str ) {
109- AdbServer .executeShellCommand (iDevice , "am start " + str );
110+ AdbServer .executeShellCommand (device . getIDevice () , "am start " + str );
110111 }
111112
112113}
0 commit comments