Fix Android SDK cannot be updated, Appium test hybrid app cannot return WebView issue

Source: Internet
Author: User
Tags appium android sdk manager

Problem:
1. Connection to the server is unsuccessful (file:///www/asset/index.html) (Reason: Android system issue, need to update)
2, Appium test mixed app, did not return WebView (reason: mainly due to Android version problem, need native system android4.4)
3. The Android SDK cannot update the package

4. Extra file update failure in Android SDK


Solution:
First, update the SDK, the steps are as follows:
1. Modify the Hosts file
Open C:/windows/system32/divers/etc/hosts and write the content

74.125.237.1 dl-ssl.google.com
203.208.46.146 www.google.com

74.125.113.121 developer.android.com

203.208.46.146 dl.google.com

203.208.46.146 dl-ssl.google.com

2. Configure Android SDK Manager
Open Android SDK manager>tools>options:
HTTP Proxy Server:mirrors.neusoft.edu.cn
HTTP Proxy port:80

and select Force https://... sources to be fetched using/http ...

Click Close, then click Package Reload to wait for the update

Second, install android4.4.2 native system
1. Tick all android4.4.2 files in the Android SDK update list to install
2. Check all tools Options, android4.4.2 all options, extra all options
3. If the extra update fails, manually download the file Haxm-windows_v6_0_3.zip (6.0.3) directly
: Https://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager
Simply follow the prompts to install

Third, open the Android AVD new simulator
1, Device:nexus One (3.7 ", 480*800:hdpi)
Target:android 4.4.2-api Level 19
Cpu:goole APIs Intel Atom (x86)
Skin:no Skin
Internal storage:200
SD Card:1gib (if 0, install app may fail)

Iv. in the Eclipse Environment, edit the script
private void Switchtocontext (String swindow) {
set<string> contextnames = Driver.getcontexthandles ();
for (String contextname:contextnames) {
if (Contextname.contains (Swindow)) {
Driver.context (Contextname);
Break
}
}
}

@Test
public void Test0 () {
Switchtocontext ("The name of your WebView");
Driver.findelementbyid ("WD"). SendKeys ("test");
Driver.findelementbyid ("Sub"). Click ();
Switchtocontext ("Native_app");
Driver.findelementbyid ("Com.blossom.android:id/back"). Click ();

}


Fix Android SDK cannot be updated, Appium test hybrid app cannot return WebView issue

Related Article

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.