androidrubycalabashcalabash-android

Is it possible to start app without starting test server?


I need to start app before running tests in order to initialize some folders in /data/data/appName/files/ and then I want to use adb command to push some files there.

If I use start_test_server_in_background, it will start tests also...

#I can't do this, bcs it will run my tests before I have data in there
start_test_server_in_background
shutdown_test_server

#I tried something like this, I am not sure how it should be written
http("/ready")
http("/kill")

#Pushing files to created folders afterwards
system("#{default_device.adb_command} push /someFolder/someFiles /data/data/appName/files")

Solution

  • I was able to start app like this:

    pn = package_name(ENV['APP_PATH'])
    cmd = "#{default_device.adb_command} shell monkey -p \"#{pn}\" -c android.intent.category.LAUNCHER 1"
    result = `#{cmd}`
    

    But in the end it was not the problem I got, so my question was misleading