Code Monkey home page Code Monkey logo

androidripper's Introduction

AndroidRipper

AndroidRipper is a toolset for the automatic GUI testing of mobile Android Applications.

It is developed and maintained by the REvERSE (REsEarch laboRatory of Software Engineering) Group of the University of Naples "Federico II".

Test Environment Setup

Android Ripper works both on Windows and Unix OSs (it has been tested on Windows 10 and Ubuntu/Mint Linux) and has been tested on the latest Android APIs, up to Android 7.0 Nugat. To setup the environment to run Android Ripper, please follow the steps below.

Step 1 - Install Android SDK

Download and Install the Official Android SDK.

Step 2 - Install Oracle JAVA 8

On Ubuntu Linux you can do this via the following commands:

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
sudo apt-get install oracle-java8-set-default

Step 3 - Download Android Tools and APIs using the Android SDK Manager

Use Android SDK Manager to download and install the required:

  • Android SDK Tools
  • Android SDK Platform Tools
  • Android SDK Build Tools

For each API download the related SDK Platform and the relatd Intel and ARM System Images.

Step 4 - Modify the PATH environment variable

Add to the PATH environment variable the following directories:

  • PathToAndroidSdk/tools/
  • PathToAndroidSdk/platform-tools/
  • PathToAndroidSdk/build-tools/BUILDNUMBER/

e.g. in Linux add to the .bachrc file in the home folder:

export PATH=$PATH:/home/utente/android-sdk-linux/platform-tools/:/home/utente/android-sdk-linux/tools/:/home/utente/android-sdk-linux/build-tools/24.0.2/

Step 5 - Android Virtual Devices (AVDs) Setup

The Android Ripper needs at least two AVDs to work properly because some apps can only run on a specific architecture. Create two different virtual devices, one equipped with an Intel System Image and one with an ARM System Image.

The values of the avd_name_x86 and the avd_name_arm paramaters in the configuration file have to match the name of these two virtual devices.

Android Ripper uses the Intel virtual device unless the app under test only works on an ARM architecture.

Android Ripper Configuration

The default.properties file contains the Android Ripper configuration parameters. This file is used by default if no properties parameter is specified when running AndroidRipper. It is possible to create new properties files to manage different AndroidRipper configurations.

A template default.properties files is provided with the Android Ripper release.

Configuration parameters

target = specifies the target device: can be device for Hardware Device or avd for Virtual Device

avd_name_x86 = Name of the AVD equipped with an x86 architecture avd_name_arm = Name of the AVD equipped with an ARM architecture avd_port = Port number used to communicate with the AVD (e.g. 5554)

device = the device id (e.g. obtained by the adb devices command)

To exploit an Hardware Device please enable USB Debug and USB Tethering on the device.

driver= Exploration strategy. Valid strategies: random, systematic scheduler= Strategy implemented by the component that schedule the next event to be executed. For a Random Exploration Strategy the only possible value is "random" (default). For a Systematic Exploration Strategy: "breadth", "depth".

random.events= Number of events to be fired (used only for the random strategy) random.seed= Random seed (used only for the random strategy; default is System.currentTimeMillis())

sleep_after_event= 1000 sleep_before_start_ripping= 10000 model= if set to 1 the model output is enabled, otherwise is disabled

Android Ripper Execution

To launch Android Ripper from the command line:

java -jar AndroidRipper.jar apkFile [config.properties]

Parameter 1 APK name and path.

Parameter 2 Configuration name and file. A default property file is used if the last argument is left empty. This configuration file (default.properties) is placed in the AndroidRipper folder.

Android Ripper Produced Artifacts

The following outputs are produced by Android Ripper:

  • Execution Log (Logcat โ€“v) in the logcat folder
  • Execution Statistics In the report.xml file
  • GUI Model of the Application in xml format, in the model folder

License

GNU Affero General Public License, version 3

Copyright (c) 2014-2017 REvERSE, REsEarch gRoup of Software Engineering @ the University of Naples Federico II, http://reverse.dieti.unina.it/

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Open Source Library Beeing Used

androidripper's People

Contributors

nicola-amatucci avatar reverse-unina avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

androidripper's Issues

Config file does not exist!

To launch Android Ripper from the command line:java -jar AndroidRipper.jar apkFile [config.properties]
For example,To launch Android Ripper from the command line:java -jar AndroidRipper.jar E:\GuiRipper\AndroidRipper-2017.10\tool\tools\AndroidRipperService.apk [default.properties]
Error message:
ERROR: Config file does not exist!
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: java.lang.NullPointerException
at it.unina.android.ripper.boundary.AndroidRipper.main(AndroidRipper.java:80)
... 5 more
I need help badly, thank you very much!

gen folder should be removed

It looks like you added my mistaken the gen folder. As content of this folder is automatically generated by the guild, it should not be added to the git repo.

APK build failed

I'm getting this error while executing the jar:-
[1569484396889] Signing AUT...
[EXCEPTION][AndroidRipperStarter.createAPKs] apk build failed
I tried changing the apk file several times but getting the same error again and again. Please help.

Ripper goes into loop

While executing the jar, everything works fine until the target app is installed on the device. After that the ripper starts and goes into an infinite loop and shows this error in between:-

aut.apk installed!
Success
ripper.apk installed!
adb chmod 777...
[1569485568136] Installation finished!
Killing com.android.launcher3...
[1569485568393] Start ripper...
it.unina.android.ripper.RipperTestCase:[1569485590641] Connect...
[1569485590642] Connecting to Android Ripper Service...
[1569485590690] Ping...
[1569485591466] Startup time: 38514
[1569485591467] Alive...
[1569485591899] Sending describe msg...
[1569485592258] Description Received!
[1569485603790] Plan...
[1569485603793] plannedTasks 3
[1569485605975] executeEvent.event:android.support.v7.widget.AppCompatButton,click
[1569485606394] Wait ack (0)...
[1569485607650] Wait ack (1)...
[1569485607654] Alive...
[1569485608213] Sending describe msg...
[1569485608442] Description Received!
[1569485626262] Plan...
[1569485626263] plannedTasks 3
[1569485627584] executeEvent.event:openMenu
[1569485628012] Wait ack (0)...
[1569485628892] Alive...
[1569485629377] Sending describe msg...
[1569485629622] Description Received!
[1569485647110] Plan...
[1569485647112] plannedTasks 3
[1569485648400] executeEvent.event:openMenu
[1569485648855] Wait ack (0)...
[1569485649752] Alive...
[1569485650660] Sending describe msg...
[1569485650915] Description Received!
[1569485668850] Plan...
[1569485668851] plannedTasks 3
[1569485670257] executeEvent.event:openMenu
[1569485670815] Wait ack (0)...
[1569485671641] Alive...
[1569485672255] Sending describe msg...
[1569485672479] Description Received!
[1569485690483] Plan...
[1569485690484] plannedTasks 3
[1569485691907] executeEvent.event:back
[1569485692376] Wait ack (0)...
[1569485693641] Wait ack (1)...
[1569485694917] Wait ack (2)...
[1569485694922] Alive...
[1569485695499] Sending describe msg...
[1569485695632] Description Received!
[1569485706650] Plan...
[1569485706651] plannedTasks 3
[1569485708095] executeEvent.event:openMenu
[1569485708657] Wait ack (0)...
[1569485709436] Alive...
[1569485710040] Sending describe msg...
[1569485710153] Description Received!
[1569485720844] Plan...
[1569485720845] plannedTasks 3
[1569485722147] executeEvent.event:back
[1569485722597] Wait ack (0)...
[1569485723847] executeTask(): AckNotReceivedException
[1569485723850] msg == null || running == false
[1569485723851] Alive...
[1569485724118] ... NOT Alive!
[1569485724124] End message...
[1569485725319] Uninstall AUT APK...
Test results for InstrumentationTestRunner=.

Time: 155.927

OK (1 test)

What to do? Please help!

EMMA

I am trying to get code coverage from the AUT using Android ripper. In your paper, you state that you use EMMA. Could you guide me in the right direction, i.e. how to use it? I can not find any documentation on this subject.

cant find androidripper.jar

Hi, when I run the command line, system cant find androidripper.jar

I build and create apk app for test and run it in my phone.
and I write default.properties file by myself an address it to command line... but i cant find or create androidripper.jar

please help me!! :((

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.