private void launchServer ( ) { try { log . info ( "Configuring Android SDK" ) ; if ( config . getAndroidHome ( ) != null ) { AndroidSdk . setAndroidHome ( config . getAndroidHome ( ) ) ; } if ( config . getAndroidSdkVersion ( ) != null ) { AndroidSdk . setAndroidSdkVersion ( config . getAndroidSdkVersion ( ) ) ; } if ( config . getBuildToolsVersion ( ) != null ) { AndroidSdk . setBuildToolsVersion ( config . getBuildToolsVersion ( ) ) ; } if ( config . getAvdManager ( ) != null ) { AndroidSdk . setAvdManagerHome ( config . getAvdManager ( ) ) ; } if ( config . getAdbHome ( ) != null ) { AndroidSdk . setAdbHome ( config . getAdbHome ( ) ) ; } log . info ( "Using Android SDK installed in: " + AndroidSdk . androidHome ( ) ) ; log . info ( "Using Android SDK version: " + AndroidSdk . androidSdkFolder ( ) . getAbsolutePath ( ) ) ; log . info ( "Using build-tools in: " + AndroidSdk . buildToolsFolder ( ) . getAbsolutePath ( ) ) ; log . info ( "Using adb in: " + AndroidSdk . adb ( ) . getAbsolutePath ( ) ) ; log . info ( "Starting Selendroid standalone on port " + config . getPort ( ) ) ; server = new SelendroidStandaloneServer ( config ) ; server . start ( ) ; } catch ( AndroidSdkException e ) { log . severe ( "Selendroid standalone was not able to interact with the Android SDK: " + e . getMessage ( ) ) ; log . severe ( "Please make sure you have the latest version with the latest updates installed: " ) ; log . severe ( "http://developer.android.com/sdk/index.html" ) ; throw Throwables . propagate ( e ) ; } catch ( Exception e ) { log . severe ( "Error building server: " + e . getMessage ( ) ) ; throw Throwables . propagate ( e ) ; } Runtime . getRuntime ( ) . addShutdownHook ( new Thread ( ) { public void run ( ) { log . info ( "Shutting down Selendroid standalone" ) ; stopSelendroid ( ) ; } } ) ; }
Starts the Selendroid standalone server and exits immediately . This method might return before the server is ready to receive requests .