@Test public void startTcpDump() throws TimeoutException, IOException, AdbCommandRejectedException, ShellCommandUnresponsiveException { IDevice device = mock(IDevice.class); doNothing().when(device).executeShellCommand(any(String.class), any(IShellOutputReceiver.class)); assertTrue(androidImpl.startTcpDump(device, false, Util.getCurrentRunningDir())); }
@Override public boolean startTcpDump(IDevice device, boolean seLinuxEnforced, String traceFolderName) { String tcpName = TCPDUMP_PATH + (seLinuxEnforced ? "_pie" : ""); String strTcpDumpCommand = tcpName + " -w " + traceFolderName + (seLinuxEnforced ? " \"tcp port not 5555\"" : " port not 5555"); LOGGER.info("tcp >> >" + strTcpDumpCommand + ">"); traceRunning = true; boolean result = executeShellCommand(device, strTcpDumpCommand); traceRunning = false; return result; }
AndroidImpl implements IAndroid { @Override public boolean startTcpDump(IDevice device, boolean seLinuxEnforced, String traceFolderName) { String tcpName = TCPDUMP_PATH + (seLinuxEnforced ? "_pie" : ""); String strTcpDumpCommand = tcpName + " -w " + traceFolderName + (seLinuxEnforced ? " \"tcp port not 5555\"" : " port not 5555"); LOGGER.info("tcp >> >" + strTcpDumpCommand + ">"); traceRunning = true; boolean result = executeShellCommand(device, strTcpDumpCommand); traceRunning = false; return result; } }
AndroidImpl implements IAndroid { @Override public boolean startTcpDump(IDevice device, boolean seLinuxEnforced, String traceFolderName) { String tcpName = TCPDUMP_PATH + (seLinuxEnforced ? "_pie" : ""); String strTcpDumpCommand = tcpName + " -w " + traceFolderName + (seLinuxEnforced ? " \"tcp port not 5555\"" : " port not 5555"); LOGGER.info("tcp >> >" + strTcpDumpCommand + ">"); traceRunning = true; boolean result = executeShellCommand(device, strTcpDumpCommand); traceRunning = false; return result; }  }
AndroidImpl implements IAndroid { @Override public boolean startTcpDump(IDevice device, boolean seLinuxEnforced, String traceFolderName) { String tcpName = TCPDUMP_PATH + (seLinuxEnforced ? "_pie" : ""); String strTcpDumpCommand = tcpName + " -w " + traceFolderName + (seLinuxEnforced ? " \"tcp port not 5555\"" : " port not 5555"); LOGGER.info("tcp >> >" + strTcpDumpCommand + ">"); traceRunning = true; boolean result = executeShellCommand(device, strTcpDumpCommand); traceRunning = false; return result; }  boolean setExecutePermission(IDevice device, String remotePath); @Override boolean isEmulator(IDevice device); ShellOutputReceiver getShellOutput(); ShellCommandCheckSDCardOutputReceiver getOutputReturn(); @Override boolean pushFile(IDevice emulator, String local, String remote); @Override DeviceState getState(IDevice device); @Override boolean isSDCardAttached(IDevice device); @Override boolean isSDCardEnoughSpace(IDevice device, long kbs); @Override boolean pullTraceFilesFromEmulator(IDevice device, String remoteFilepath, String localFilename); @Override boolean pullTraceFilesFromDevice(IDevice device, String remoteFilepath, String localFilename); @Override boolean makeAROTraceDirectory(IDevice device, String traceName); @Override boolean makeDirectory(IDevice device, String dirpath); @Override String getProperty(IDevice device, String property); @Override SyncService getSyncService(IDevice device); @Override boolean removeEmulatorData(IDevice device, String deviceTracePath); @Override boolean stopTcpDump(IDevice device); Socket getLocalSocket(); @Override boolean checkTcpDumpRunning(IDevice device); @Override boolean startTcpDump(IDevice device, boolean seLinuxEnforced, String traceFolderName); @Override boolean isTraceRunning(); @Override String[] getShellReturn(IDevice device, String arocmd); @Override boolean checkPackageExist(IDevice device, String fullpackageName); @Override boolean runApkInDevice(IDevice device, String cmd); @Override boolean runVpnApkInDevice(IDevice device); }
AndroidImpl implements IAndroid { @Override public boolean startTcpDump(IDevice device, boolean seLinuxEnforced, String traceFolderName) { String tcpName = TCPDUMP_PATH + (seLinuxEnforced ? "_pie" : ""); String strTcpDumpCommand = tcpName + " -w " + traceFolderName + (seLinuxEnforced ? " \"tcp port not 5555\"" : " port not 5555"); LOGGER.info("tcp >> >" + strTcpDumpCommand + ">"); traceRunning = true; boolean result = executeShellCommand(device, strTcpDumpCommand); traceRunning = false; return result; }  boolean setExecutePermission(IDevice device, String remotePath); @Override boolean isEmulator(IDevice device); ShellOutputReceiver getShellOutput(); ShellCommandCheckSDCardOutputReceiver getOutputReturn(); @Override boolean pushFile(IDevice emulator, String local, String remote); @Override DeviceState getState(IDevice device); @Override boolean isSDCardAttached(IDevice device); @Override boolean isSDCardEnoughSpace(IDevice device, long kbs); @Override boolean pullTraceFilesFromEmulator(IDevice device, String remoteFilepath, String localFilename); @Override boolean pullTraceFilesFromDevice(IDevice device, String remoteFilepath, String localFilename); @Override boolean makeAROTraceDirectory(IDevice device, String traceName); @Override boolean makeDirectory(IDevice device, String dirpath); @Override String getProperty(IDevice device, String property); @Override SyncService getSyncService(IDevice device); @Override boolean removeEmulatorData(IDevice device, String deviceTracePath); @Override boolean stopTcpDump(IDevice device); Socket getLocalSocket(); @Override boolean checkTcpDumpRunning(IDevice device); @Override boolean startTcpDump(IDevice device, boolean seLinuxEnforced, String traceFolderName); @Override boolean isTraceRunning(); @Override String[] getShellReturn(IDevice device, String arocmd); @Override boolean checkPackageExist(IDevice device, String fullpackageName); @Override boolean runApkInDevice(IDevice device, String cmd); @Override boolean runVpnApkInDevice(IDevice device);  }