How do you keep ios ish running
What a great idear.
its almost like Termux on Android.
But how do you keep it running?
The sshd session stalls if you leave the app, and resumes if you return. The ish totally stalls if the screen dims and the ipad locks.
That is pretty useless for a Linux server that is supposed to run serves in the background to support other apps or home automation etc.
Has / can this be solved or worked around somehow?
Some post about this subject mentions its pretty hard to force an app to run in the background on ios. But there are solutions..like running geo locations etc.
Are there work in progress to make a useful solution?
Regards Requa3r0
ok
so making a start.sh script with
`cat /dev/location > /dev/null &
/usr/sbin/sshd `
and running it with ./start.sh & seems to do the trick
why is this not build in to ish from the start to keep it alive regardless. At least as an install option.
Yes, this is kind of disturbing. There is little profit of reading the location: instead of getting kilked, the app is getting freezed ;) I really don’t know much about iOS developement. But there are apps which have „allow background activity” switch in settings which usually makes the job done. Is there any reason it hasn’t been implemented into iSH?
Apps on iOS may not run in the background aside from a very narrow set of affordances that have been laid out directly by Apple. As iSH does not inherently fall into any of these categories, it cannot ship with a switch like the one you are describing and remain compliant with the guidelines for the App Store. iSH does have a device file at /dev/location that provides the current location when read from, which has the side effect that it puts iSH into one of the background modes that allow it to execute code. If you are not seeing this happen, it is probably a bug, but outside of this iSH being suspended by the OS is to be expected.
Going off of what @saagarjha said: there are technically some hacky ways to game those "very narrow set of affordances" to keep the app running, such as playing fake audio in the background, starting a fake GPS session, etc. But all of those options are intended for keeping the app doing exactly what it needs to do in the background and pretty much nothing more. In addition, hacky implementations like those are likely susceptible to be struck during the App Store review process, but could potentially work for AltStore and building from source if a separate codebase is kept from the App Store codebase?
But even for legit, proper implementations such as fetching updates from a server using the Background Service API, iOS itself still has the final say when things actually happen (e.g you've configured to fetch every hour, but it does NOT precisely do it at every 60 exact minutes), TL;DR iOS does what it feel like doing.
There isn't really a way to reliability set an app to run forever in the background, as foreground interactions seem to be what iOS wants.
It would be nice if it suspended its state to disk and resumed from it where it left off.