Is there a tool/approach to automatically generate an app on an iOS or Android device from HTML5 or jQuery Mobile code so that the app loads/runs entirely on the mobile device i
What you are looking for is the Intel XDK. http://xdk-software.intel.com/
You can build, emulate, debug, test and publish your HTML5 code as native apps directly from the XDK, for iOS, Android and Windows Mobile.
The answer your looking for I believe is bassically No on both counts.
There is nothing to turn HTML5 into native apps on iOS or Android (Windows 8 is "native" with HTML5).
You can however use PhoneGap to create a natively packaged WebApp, and this does not require an internet connection, it can be full local, and the outcome can be very good.
Yes - Trigger.io apps bundle all your HTML/CSS/JS into a natively packaged app - there's no internet access required for it to work.
Of course, if your app will only fully function if it has access to remote services, then the experience will degrade, but you can handle that with forge.is.connection.connected.