|
1 | 1 | package processing.mode.android; |
2 | 2 |
|
3 | | -import java.io.IOException; |
4 | | -import java.util.ArrayList; |
5 | | -import java.util.Collections; |
6 | | -import java.util.HashSet; |
7 | | -import java.util.List; |
8 | | -import java.util.Set; |
9 | | -import java.util.regex.Matcher; |
10 | | -import java.util.regex.Pattern; |
11 | | - |
12 | 3 | import processing.app.Base; |
13 | 4 | import processing.app.RunnerListener; |
14 | 5 | import processing.app.exec.LineProcessor; |
|
18 | 9 | import processing.core.PApplet; |
19 | 10 | import processing.mode.android.LogEntry.Severity; |
20 | 11 |
|
| 12 | +import java.io.IOException; |
| 13 | +import java.util.*; |
| 14 | +import java.util.regex.Matcher; |
| 15 | +import java.util.regex.Pattern; |
| 16 | + |
21 | 17 |
|
22 | 18 | class Device { |
23 | 19 | private final Devices env; |
@@ -47,6 +43,28 @@ public void bringLauncherToFront() { |
47 | 43 | } |
48 | 44 | } |
49 | 45 |
|
| 46 | + public String getName() { |
| 47 | + String name = ""; |
| 48 | + |
| 49 | + try { |
| 50 | + ProcessResult result = AndroidSDK.runADB("-s", id, "shell", "getprop", "ro.product.brand"); |
| 51 | + if(result.succeeded()) { |
| 52 | + name += result.getStdout() + " "; |
| 53 | + } |
| 54 | + |
| 55 | + result = AndroidSDK.runADB("-s", id, "shell", "getprop", "ro.product.model"); |
| 56 | + if(result.succeeded()) { |
| 57 | + name += result.getStdout(); |
| 58 | + } |
| 59 | + } catch (InterruptedException e) { |
| 60 | + e.printStackTrace(); |
| 61 | + } catch (IOException e) { |
| 62 | + e.printStackTrace(); |
| 63 | + } |
| 64 | + |
| 65 | + return name + " [" + id + "]"; |
| 66 | + } |
| 67 | + |
50 | 68 | // adb -s emulator-5556 install helloWorld.apk |
51 | 69 |
|
52 | 70 | // : adb -s HT91MLC00031 install bin/Brightness-debug.apk |
|
0 commit comments