Search code examples
androidmonkeyrunner

Is it possible to send some arguments to monkeyrunner script


I start my monkeyrunner script like this

monkeyrunner my_script

but I want to pass some arguments for example like this

monkeyrunner my_script -n 100

and how can I read this value inside the my_script


Solution

  • You can access the script arguments in sys.argv list:

    #! /usr/bin/env monkeyrunner
    
    import sys
    
    print sys.argv