简体   繁体   中英

Launch an mobile app on emulator using appium

I wanted to launch my app in genemotion using Appium - Java.

I can launch the app on real device, But I feel its better to use Emulators instead of real devices. How I can do that ?

Just add a Virtual Emulator on Genemotion, make it up and running. Then open your terminal and type: adb devices

It will show, List of devices attached, make sure that new virtual device is running on some port. ie : 192.168.56.101:5555 device

Now use below use desired capabilities as below :

DesiredCapabilities capabilities = new DesiredCapabilities();

    capabilities.setCapability("deviceName", "Name of the Emulator");

    capabilities.setCapability("platformName", "Android");

    driver = new AndroidDriver(new URL("http://0.0.0.0:4723/wd/hub"), capabilities);

It will launch the apk in genemotion.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM