Appium is how to connect to Android real machine

Source: Internet
Author: User
Tags appium

Import Org.openqa.selenium.by;import Org.openqa.selenium.webelement;import Org.openqa.selenium.remote.capabilitytype;import org.openqa.selenium.remote.desiredcapabilities;d Esiredcapabilities capabilities = new Desiredcapabilities (); Capabilities.setcapability (CapabilityType.BROWSER_NAME , "");//This sentence is not required capabilities.setcapability ("DeviceName", "Android Emulator"); Capabilities.setcapability (" Platformversion "," 4.4 "), Capabilities.setcapability (" PlatformName "," Android "); Capabilities.setcapability (" Apppackage "," Com.android.calculator2 "); Capabilities.setcapability (" Appactivity ",". Calculator "); Appiumdriver Driver = new Appiumdriver (New URL ("Http://127.0.0.1:4723/wd/hub"), capabilities);


Appium, need to modify this parameter in the following

Capabilities.setcapability ("DeviceName", "Android Emulator");

devicename: Type of phone or simulator used

iPhone SimulatoriPad SimulatoriPhone Retina 4-inchAndroid EmulatorGalaxy S4, and so on. On IOS, the value of this keyword must be using theinstruments -s devicesone of the available device names to get. On Android, this keyword does not work at this time.


Capabilities.setcapability ("DeviceName", "Android Emulator"); Here is the name of the linked device if you need to connect the real machine can ADB devices view the ID of the phone and then fill in the Android Emulator here




Appium is how to connect to Android real machine

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.