1

I have a issue regarding Appium Android emulator.

When I start with the Android emulator by launching it with cmd : emulator -avd emulaotr name.

The emulator takes a lot of time to load completely and due to this when i am trying to invoke an android app through appium server is generating the error : A new session could not be created. (Original error: UiAutomator quit before it successfully launched).

And often the android is getting stuck on the Android screen and not getting launched further. so till I launched emulator completely , I cant do nothing to invoke apps. please help.

I think this is due to slow emulator. How can i resolve it please suggest.

Code for the desired capabilities :

    File appDir = new File("Src");

            File app = new File(appDir, "honkamp.apk");

            DesiredCapabilities cap = new DesiredCapabilities();
            cap.setCapability(MobileCapabilityType.PLATFORM_NAME,MobilePlatform.ANDROID);

            cap.setCapability(MobileCapabilityType.DEVICE_NAME, "Android Emulator");
            cap.setCapability(MobileCapabilityType.VERSION, "4.4.2");
            cap.setCapability(MobileCapabilityType.APP_PACKAGE, "com.Honkampkrueger.hk");
            cap.setCapability(MobileCapabilityType.BROWSER_NAME, "");
            cap.setCapability(MobileCapabilityType.APP_ACTIVITY, ".MainActivity");

            cap.setCapability(MobileCapabilityType.APP, app.getAbsolutePath()); 


            AndroidDriver and = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"),cap);

             and.startActivity("appPackage","com.example.android.apis", null, null);


        How can i launch android emulator much quicker completely to proceed further    .

Please advice..............

kuldeep Sahu
  • 41
  • 2
  • 6
  • 1
    Please provide appium server error log – Chandrashekhar Swami Feb 05 '16 at 14:22
  • 1
    you can speed up android emulator a lot by using intel haxm tools (intel processor required). See here: https://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager . If you can't do that, the next best thing is a physical Android device. This is my preferred method because it imitates real world better and also runs very fast.Else, I think all you have to do is increase the device ready timeout by using `--device-ready-timeout` and you may also need to increase `--command-timeout`. See here for more info: http://appium.io/slate/en/v1.2.0/?csharp#server-flags – econoMichael Feb 06 '16 at 00:52
  • should add tags relative to the problem, `android` `emulator` would have seeked better attention – Naman Feb 07 '16 at 04:48
  • @kuldeep Sahu : do read http://stackoverflow.com/questions/1554099/why-is-the-android-emulator-so-slow-how-can-we-speed-up-the-android-emulator if it helps – Naman Feb 10 '16 at 04:02

0 Answers0