Android studio2.0 build Robotium Environment--eclipse--apk Environment

Source: Internet
Author: User

1. Configure the Android SDK, Java environment

2. Re-sign the apk file

In the user directory, there will be a. Android directory, put Re-sign.jar in the directory. Execute command Java-jar Re-sign.jar

Then take the apk file off to the open re-sign. Save the re-signed file.

Note that the pop-up needs to be followed by the following.

You can also use scripts to manipulate them directly. The bat script is as follows

BAT script and Re-sign.jar in the same directory.

@echo Offecho "your. Android directory is:" Echo%userprofile%\.androidcopy/y  re-sign.jar  %userprofile%\.android\ & & Java-jar Re-sign.jarpause

3.

Create a test project such as: Select Testtarget when selecting this project

4. After creating the project, create a new JUNIT4 test class

5. Import the Robotium jar package

6. Writing code

7. Configuration

In Eclipse, create a new Android test Project that is configured to associate the automation script with the APK to be tested.

1) Modify the Androidmainfest.xml file under Android Test project so that the package name marked in bold is consistent with the name generated by resign <instrumentation Android:nam E = "Android.test.InstrumentationTestRunner"Android:targetpackage = " Com.example.mobile.testedapp "/> 2) in the Automation script test class, declare the initial class, as well as the resign generated main activity class name consistent     private static Final String Launcher_activity_full_classname=" com.example.mobile.testedapp.MainActivity" ;

8. Running

1.android self-equipped simulator installation

1) Open the Android SDK installation directory

2) Locate the Platform-tools directory under the SDK

3) put the re-signed APK file in this directory

4) Open command prompt: cmd

5) CD .../sdk/platform-tools

6) Open the simulator to install APK

7) Run command: adb install testedapp.apk. See success, the APK has been installed successfully.

The problem occurs in the re-installation:

Prompt for this error when you publish a program to your phone:

Install_failed_insufficient_storage

Reason: Not enough space

Workaround:

1. ADB shell

2. #df

Found/data under insufficient space, the original was installed too many applications caused.

3. Remove some unwanted programs.

The first way: when you repeatedly install Android APK, sometimes you may encounter the ADB install error, the content is: Failure [install_failed_update_incompatible]
This is probably because you were in the previous uninstall application, did not do a thorough, just simple rm/data/app/the following apk file, a remedy is as follows:
Start the emulator and go to the menu
Settings->applications->mange
Applications-> Select the Application->select "Unistall".
This will remove it completely, and then reinstall the APK will be no problem.

Second approach: Modify the emulator memory size

4. Create a new simulator

2. Night God simulator Run

Reference: http://www.cnblogs.com/enjoytesting/p/3622657.html

http://blog.csdn.net/annkie/article/details/8714716

Http://www.cnblogs.com/easypass/p/3867211.html

Android studio2.0 build Robotium Environment--eclipse--apk Environment

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.