0

Is there any way to use command line commands in ruby code ?

Like : Some third party .ipa installer command inside ruby code(reinstall the app between scenarios using a 3rd party installer like ideviceinstaller).

1

1 Answer 1

1
  • Kernel#exec, that replaces your ruby process with the one you specified, as a corresponding syscall. Therefore, it ends the program even if there's more code to run. Probably not what you want. Works like: exec("this")
  • Backticks. `this` will run this and return its stdout as a string. The same thing with different syntax: %x(this)
  • Kernel#system: mostly same as exec, but doesn't replace your Ruby process and returns a boolean... most of the time: whether it worked successfully (true), it returned non-zero (false) or failed to run at all (nil); runnable as system("this")
  • See these three and links to more
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.