development
Révision | d271d9a503b181b240250ce2664ff22fbf4e763b (tree) |
---|---|
l'heure | 2009-08-19 07:49:12 |
Auteur | Android (Google) Code Review <android-gerrit@goog...> |
Commiter | Android (Google) Code Review |
Merge change 21763 into donut
* changes:
@@ -45,8 +45,8 @@ import javax.imageio.ImageIO; | ||
45 | 45 | */ |
46 | 46 | public class MonkeyRunner { |
47 | 47 | |
48 | - static String monkeyServer = null; | |
49 | - static int monkeyPort; | |
48 | + static String monkeyServer = "127.0.0.1"; | |
49 | + static int monkeyPort = 1080; | |
50 | 50 | static Socket monkeySocket = null; |
51 | 51 | |
52 | 52 | static IDevice monkeyDevice; |
@@ -62,7 +62,7 @@ public class MonkeyRunner { | ||
62 | 62 | public static void main(String[] args) { |
63 | 63 | |
64 | 64 | processOptions(args); |
65 | - | |
65 | + | |
66 | 66 | initAdbConnection(); |
67 | 67 | openMonkeyConnection(); |
68 | 68 |
@@ -150,9 +150,13 @@ public class MonkeyRunner { | ||
150 | 150 | monkeyDevice = devices[0]; |
151 | 151 | } |
152 | 152 | |
153 | - } finally { | |
154 | - } | |
153 | + monkeyDevice.createForward(monkeyPort, monkeyPort); | |
154 | + String command = "monkey --port " + monkeyPort; | |
155 | + monkeyDevice.executeShellCommand(command, new NullOutputReceiver()); | |
155 | 156 | |
157 | + } catch(IOException e) { | |
158 | + e.printStackTrace(); | |
159 | + } | |
156 | 160 | } |
157 | 161 | |
158 | 162 | /** |