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