I was trying to use the SSH.NET NuGet package to remotely execute a command to grab an app version that is installed on one iPhone connected to a Mac.
If executed on the Mac itself with below command, will get me its version:
ideviceinstaller -l|grep <bundleIdOfMyAppPackage>
So I build a small utility in C# with this package, hoping that I would leverage it. However, all I get is just an empty string. Would anyone let me know what I could do to get the result I want ? Thank you !
var host = "myhost";
var username = "username";
var password = "password";
using (var client = new SshClient(host, username, password))
{
client.HostKeyReceived += delegate(object sender, HostKeyEventArgs e) { e.CanTrust = true; };
client.Connect();
var command = client.CreateCommand("ideviceinstaller -l|grep <bundleIdOfMyAppPackage>");
command.Execute();
var result = command.Result;
Console.WriteLine(result);
client.Disconnect();
}
The error that I've got from command.Error is
zsh1: command not found ideviceinstaller`
which is weird because I can see ideviceinstaller inside that folder if I browse to there.
I've got it working thanks to @Martin Prikryl by changing the command to:
/usr/local/bin/ideviceinstaller -l|grep <myAppBundleId>