• Stars
    star
    199
  • Rank 196,105 (Top 4 %)
  • Language
    Ruby
  • License
    MIT License
  • Created over 11 years ago
  • Updated about 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Monkey Test Tool For iOS

CrashMonkey

Japanese

About

This is a tool of monkey test(random operation test) for iOS applications. Please watch the demo movie. CrashMonkey uses UIAutomation and modified ui-auto-monkey for iPhone Simulator manipulation.

Environment

It is confirmed only in the following environment.

  • Max OS X 10.8.4
  • Xcode 4.6.3(Build version 4H1503)
  • Ruby 1.8.7-p371

Ruby versions may be OK 1.9.x and 2.0.x.

Features

Good Points

  • No need to modify the app's project.
  • It can specify the running period and times.
  • The results of Screenshots and Operations history can be shown as HTML.
  • the console log and crash report can be shown.
  • It is easy to be used from CI tools like Jenkins.

Restrictions

  • It can be run only in iPhone Simulator.
  • The test can not continue when another application(like Safari) is the most front. (detect and finish the test).
  • It can not input suitable characters like ID/Pass.

Install

gem install crash_monkey --no-ri --no-rdoc

How to use

Simple Usage

crash_monkey -a <APP_NAME or APP_PATH> -w <DEVICE>

-a specify AppName or PATH. -w specify the device on which to run. A list of available devices can be obtained with crash_monkey --list-devices. In case no device is specified, it will take the first from the list.

Example

crash_monkey -a MyAwesomeApp.app                               # (1)
crash_monkey -a build/Debug-iphonesimulator/MyAwesomeApp.app   # (2)
crash_monkey -a ~/Library/Developer/Xcode/DerivedData/MyAwesomeApp-ffumcy/Build/Products/Debug-iphonesimulator/MyAwesomeApp.app # (3)
  • in (1) case, an application is executed which matches the app's name installed in iPhone Simulator. If there are same name apps, the app of latest updated time is used.

  • in (2)(3) cases, an app which in the PATH is excuted. It is required that the app is built for iPhone Simlator.

Options

% crash_monkey
Usage: crash_monkey [options]
    -a app_name                      Target Application(Required)
    -w device                        Target Device(Required)
    -n run_count                     How many times monkeys run(default: 2)
    -d result_dir                    Where to output result(default: ./crash_monkey_result)
    -t time_limit_sec                Time limit of running(default: 100 sec)
    -c config_path                   Configuration JSON Path
    -e extend_javascript_path        Extend Uiautomation Javascript for such Login scripts
    --show-config                Show Current Configuration JSON
    --list-app                   Show List of Installed Apps in iOS Simulator
    --list-devices               Show List of Devices
    --reset-iPhone-Simulator     Reset iPhone Simulator

-n

The times for monkey test excution.

-d

The directory for output results.

-t

Timeout seconds for one monkey test.

-c

Specify configuration file(JSON format) for UIAutomation library. The template is shown by --show-config option.(example)

-e

Specify extend Javascript file for UIAutomation library.
It could be used for login.(example)

--show-config

Output configuration for UIAutomation library by JSON format.(example)

--list-app

List apps for iPhone Simulator.

--list-devices

List devices (simulator and attached) on which the monkey can be run.

--reset-iPhone-Simulator.

Reset iPhone Simulator.

For Jenkins

CrashMonkey has CUI interface, so easy to use from Jenkins. There are a few notes.

Confirmation dialog from UIAutomation is displayed and stop tests.

The first time in the Mac CrashMonkey run, Instruments(UIAutomation) may display a confirmation dialog and require to input password.

In this case, the test can not run if the password is not entered. The following management may be valid.

  • The Jenkins running User has Administration privilege.

  • In case Jenkins is running as slave, launch with X like following.

     javaws http://<SERVER>/computer/<NodeName>/slave-agent.jnlp
    
  • The first time a Jenkins Job runs in the Mac, if the dialog is displyed then input correct password.

Other conditions may be OK, but this is also work.

Troubleshooting

CASE: xcode-select is not set.

symptoms

% crash_monkey -a MyGoodApp.app
.....
Run: ["instruments", "-l", "100000", "-t", ........... ]
xcode-select: Error: No Xcode folder is set. Run xcode-select -switch <xcode_folder_path> to set the path to the Xcode folder.
.....

measures

Please specify the install path of Xcode by xcode-select.

ex)

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

Contributing to CrashMonkey

  • Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
  • Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
  • Fork the project.
  • Start a feature/bugfix branch.
  • Commit and push until you are happy with your contribution.
  • Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

Copyright

Copyright (c) 2013 Ken Morishita. See LICENSE.txt for further details.

More Repositories

1

reversi-alpha-zero

Reversi reinforcement learning by AlphaGo Zero methods.
Python
676
star
2

keras_npi

NPI(Neural Programmer-Interpreters) implementation with Keras
Python
244
star
3

keras_BEGAN

Implementation BEGAN([Boundary Equilibrium Generative Adversarial Networks](https://arxiv.org/pdf/1703.10717.pdf)) by Keras.
Python
36
star
4

Android_NFC_FelicaEdit

FelicaEdit is an application which can view and edit FeliCa data using Android devices.
Java
28
star
5

docker_capture_web

Docker Container to take full screenshot of a web page
Python
21
star
6

EventCenter

Swift Library of Type Safe Event Notification like Android's EventBus.
Swift
13
star
7

AWSSimpleConsole

Amazon Web Service's EC2 SImple Console that can start/stop and scheduled start/stop.
Ruby
9
star
8

iBeaconNotifier

Objective-C
9
star
9

MemoryWarningSender

A Plugin of iOS Simulator send 'MemoryWarning' repeatedly.
Objective-C
8
star
10

reversi-arena

Python
7
star
11

CanvizPlain

Canviz(JavaScript xdot drawer using Canvas) without prototype.js
CoffeeScript
6
star
12

PlayingChainer

Python
6
star
13

DeepTransition

Objective-C
5
star
14

LyncToNotification

SIMBL Plugin of 'Microsoft Lync for mac' to send notifications to Notification Center(of Mountain Lion).
Objective-C
5
star
15

jupyter-tensorflow

Shell
4
star
16

android_refactor_training

Java
4
star
17

reversi-alpha-zero-models

Models trained by reversi-alpha-zero
3
star
18

ObjectJsonMapperGenerator

Ruby
3
star
19

moke_config

This is a config utility for tree structure, PyCharm complement and overriding by dictionary.
Python
2
star
20

UnityChanRoadRunner

C#
2
star
21

fluent-plugin-basecreate

create a fluent plugin development environment with Bundle gem.
Ruby
2
star
22

CheckRelease

Check Tool of PROPERTY Release in Objective-C
Python
2
star
23

rust_wasm_example

Rust
2
star
24

openai

Python
1
star
25

FileTransfer

JavaScript
1
star
26

walk88

Ruby
1
star
27

embulk-encoder-encrypted_zip

Java
1
star
28

senpai-tasukete

Test Environment of https://paiza.jp/poh/ec-campaign
Shell
1
star
29

obstacle_tower

Python
1
star
30

spr_adbi

Python
1
star
31

embulk-parser-regex

Java
1
star
32

scaf_code

scaf_code is a tool for generating code from reference and specification files by Large Language Models.
Python
1
star
33

docker-python39-chrome99

Dockerfile
1
star
34

tv_info

Python
1
star
35

UnitySmartPhoneInputController

Unity Input Controller with SmartPhone using WebSocket.
C#
1
star