path: android-platform-frameworks-base_1:14~beta1-5/tests/BootImageProfileTest/src/com/android/bootimageprofile/BootImageProfileTest.java private boolean forceSaveProfile(String pkg) throws Exception { String pid = mTestDevice.executeShellCommand("pidof " + pkg).trim(); if (pid.length() == 0) { // Not yet running. path: android-platform-frameworks-base_1:14~beta1-5/tests/ApkVerityTest/src/com/android/apkverity/ApkVerityTest.java CLog.d("lsof: " + expectRemoteCommandToSucceed("lsof " + apkPath)); Thread.sleep(1000); String pid = expectRemoteCommandToSucceed("pidof system_server"); mDevice.executeShellV2Command("kill -10 " + pid); // force GC } catch (InterruptedException e) { path: android-platform-frameworks-base_1:14~beta1-5/tests/RollbackTest/StagedRollbackTest/src/com/android/tests/rollback/host/StagedRollbackTest.java // the last crash was finished. while ("".equals(pid) || lastPid.equals(pid)) { pid = getDevice().executeShellCommand("pidof " + processName); } getDevice().executeShellCommand("kill " + pid); path: android-platform-frameworks-base_1:14~beta1-5/tests/AppLaunch/src/com/android/tests/applaunch/AppLaunch.java try { String[] pids = getDevice().executeShellCommand( "pidof screenrecord").split(" "); for (String pid : pids) { // Avoid empty process ids, because of weird splitting behavior. path: android-platform-frameworks-base_1:14~beta1-5/tests/UpdatableSystemFontTest/src/com/android/updatablesystemfont/UpdatableSystemFontTest.java private static String pidOf(String appId) throws Exception { return expectCommandToSucceed("pidof " + appId).trim(); } path: android-platform-frameworks-base_1:14~beta1-5/apct-tests/perftests/inputmethod/src/android/inputmethod/ImePerfTest.java private void killBaselineIme() { // pidof returns a space separated list of numeric PIDs. String result = SystemUtil.runShellCommand( "pidof com.android.perftests.inputmethod:BaselineIME"); path: android-platform-frameworks-base_1:14~beta1-5/apct-tests/perftests/inputmethod/src/android/inputmethod/ImePerfTest.java // pidof returns a space separated list of numeric PIDs. String result = SystemUtil.runShellCommand( "pidof com.android.perftests.inputmethod:BaselineIME"); for (String pid : result.trim().split(" ")) { // The output may be empty if there is no process with the name.