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).

Mesh
  • 193
  • 1
  • 7

1 Answers1

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
D-side
  • 9,150
  • 3
  • 28
  • 44