Solution to my above question
Each step below has literally 100 more steps internally. If you are not familiarized with jailbroken apps/tools development, this is going to be a nightmare. Sorry, I cannot share code since I did it for a client. but stack overflow has answers for how to do the various components i mentioned below separately. once you do a little POC on separate components, my answer will help you to put them together.
This will work only in jailbroken devices and cracked ipa files
- Create a daemon application.
- make sure it runs 24/7 in background.
- To trigger installation from server, add socket.io(or any other
similar framework) to the app (since daemon app is running always,
make sure the socket connection to the server is also always alive)
- Send the URL of zipped ipa file to daemon app via socket.io server.
- In the daemon app, unzip the .zip to .ipa
- once it is unzipped there are two ways you can install the app.
- easy way is to unzip .ipa further to .app and move .app folder to the
applications folder in iPhone.
- There is a private springboard api, which takes ipa file path as
input and installs it
If you cannot crack the ipa
This is way more complex than above :) you have to run a code which opens AppStore, Search for the application and install it.
- same as above upto step 3
- Manually(for POC) record the coordinates of all the button clicks inside AppStore required to install any app in general. like click on search tab at the bottom, select the search bar, insert text in search bar, click on search button, click get/install button from result....
- create a dynamic library which takes those coordinates as an input and do a uiautomation. inject this dynamic library into AppStore.
- from the server, send this coordinates to your daemon application, which will pass on this coordinates to dynamic library and open AppStore from background.
- once AppStore is opened, beauty of dynamic library is, it will kick in automatically and start you ui automation.