I need to access the sandbox directory for an application installed on an iOS device, using the command line (non-gui) from a Mac or Linux. This is to help with development and testing automation. Dropping a json file into the sandbox lets me set parameters like extra debug messages and smaller refresh intervals.

A tool like iFunBox works perfectly but is graphical only, requiring numerous clicks to do this. Emails to the developers were unanswered. It also does not support AppleScript. I did find another app that provided a Fuse module, but it turned out buggy especially if the app was uninstalled and then reinstalled (in order to reset back to first time user experience). I reported the problems to the developer but there is no fix on the horizon.

The things I need to do are:

* Test if an app with a specific bundle id is installed
* Create Library/Caches/MYLIBNAME directory if it doesn't exist
* Copy a ~100 byte json file from the Mac to that directory
* Get a copy of that file
* A solution that only works from Linux is acceptable too
* Devices are not jailbroken and I would prefer not to need that as a requirement

In some cases I do not have the source code to the app since it is a third party using my library, so compiling different versions of the app isn't practical.

**Answer is below in many comments thanks to lxt. Summary is:**

* Various libraries and programs associated with libimobiledevice can solve the problems
	+ Use **patched** iFuse to mount an application sandbox
	+ Use idevicesyslog to see the console log
	+ Use ideviceinstaller to install/uninstall apps
* The various libraries and programs associated with libimobiledevice are incredibly difficult if not impossible to compile as is on Linux or Mac, and there is no unified distribution of the source or binaries
	+ For Ubuntu try libimobiledevice (may have 3 suffix), ideviceinstaller and libimobiledevice-utils packages
	+ For Mac a search for libimobiledevice-macosx may get you some of the way there