appium框架之bootstrap

原文地址:http://www.it165.net/pro/html/201407/17696.html

bootstrap结构

如图所示为bootstrap的项目结构

appium框架之bootstrap

view sourceprint?
01.package io.appium.android.bootstrap;
02. 
03.import io.appium.android.bootstrap.exceptions.SocketServerException;
04. 
05.import com.android.uiautomator.testrunner.UiAutomatorTestCase;
06. 
07./**
08.* The Bootstrap class runs the socket server. uiautomator开发的脚本,可以直接在pc端启动
09.*/
10.public class Bootstrap extends UiAutomatorTestCase {
11. 
12.public void testRunServer() {
13.SocketServer server;
14.try {
15.// 启动socket服务器,监听4724端口。
16.server = new SocketServer(4724);
17.server.listenForever();
18.catch (final SocketServerException e) {
19.Logger.error(e.getError());
20.System.exit(1);
21.}
22. 
23.}
24.}