()
| 45 | } |
| 46 | |
| 47 | @Command(name = "listApk", description = "List installed apks") |
| 48 | void ListApk() { |
| 49 | |
| 50 | Adb adb = new Adb(); |
| 51 | Adb.Output out = adb.ListApk(); |
| 52 | if (out.error != Adb.Error.ok) { |
| 53 | ShowAdbShellError(out); |
| 54 | return; |
| 55 | } |
| 56 | // output will look like |
| 57 | // package:com.android.offfice |
| 58 | // package:com.vivo.appstore |
| 59 | // "package:" should be trimmed for better view |
| 60 | for (int i = 0; i < out.strings.size(); i++) { |
| 61 | // use the caret symbol '^' |
| 62 | // to match the beggining of the pattern |
| 63 | String new_str = out.strings.get(i).replaceFirst("^package:", ""); |
| 64 | System.out.printf("%d %s\n", i, new_str); |
| 65 | } |
| 66 | System.out.printf("Found %d packages\n", out.strings.size()); |
| 67 | |
| 68 | } |
| 69 | |
| 70 | @Command(name = "apkInfo", description = "information about apk") |
| 71 | void ApkInfo( |
nothing calls this directly
no test coverage detected