Run any app in iOS 10+ from command line without jailbreaking - ios

Is there a way to run any app in iOS 10+ from command line/Mac without jailbreaking?
Re-signing and none of the existing tools seem to work (ios-deploy, Instruments) nor have I been able to find a way via iTunes or other programs.

Yes it is possible for any App you have the source code for.
No it is not possible for any App you acquired from the App store or direct download.

Not quite sure I fully understand your emphasis on any app, but here is what I understand:
1) If you mean you want to run any app from the app store that can currently be downloaded, and you have a .ipa file, you can definitely install it manually to another device using this method (iTunes drag and drop)
2) If, however, you're trying to run an .ipa on a Simulator, that's not possible, as described by this answer.
3) Lastly, if you have source, which I'm confused about since you mention re-signing, then you can easily build that source into an executable for either Simulator or device using either Xcode, or since you asked about command line, you could also use xcodebuild, info found here
I hope one of these 3 options is what you're looking for, as it's hard to tell from the wording of the question. If it's not, expanding on exactly what use case you're trying to resolve would be very helpful.

From the comments in #BHendricks answer, it seems you want to use the command line on your computer to start apps that are installed on an iOS 10+ device.
This is not possible without jailbreaking the phone!
On a jailbroken phone it might be possible to write something that connects over ssh and starts apps, but on vanilla iOS this is disabled for security. You could search for an app that you can send commands, but I highly doubt iOS apps have access to system features like starting other apps, as this is also a large security risk.

If you have the ipa, you can install the app via iTunes. This is what we used to ask QAs to test apps on devices and it works fine. Please refer to this [SO] for detail Install IPA with iTunes 12.

Use Cydia Impactor (cydiaimpactor.com) to sign the app. 99% chance it will work

Related

(Programmatically/Automatically) Removing iOS-Apps

I'm looking for a solution how to remove all installed iOS-Apps from a device. I'm working on a project for iOS-Security. For different analytical stuff on a jail-broken device it's necessary to automatically install a fat bunch of apps, perform all the tests and remove them afterwards to get free space for further applications. The auto installation and test-logic is already done. I only stuck with the apps-removing part.
User installed iOS-Apps are located in /var/mobile/Applications/.
Each application has its own randomly named directory e.g. 7654BE30-F438-42CE-98E0-B95264458C49/.
To proof whether an application is already installed or not my software checks out the com.apple.mobile.installation.plist in /private/var/mobile/Library/Caches/
I've tried to remove the binaries of all applications in /var/mobile/Applications/ and there references in the com.apple.mobile.installation.plist. It seems like the iOS generates a new com.apple.mobile.installation.plist after each installation-process, so it makes no difference whether I remove all the entries out of com.apple.mobile.installation.plist or not. So if I would like to install an application which was already tested someday my software wouln't recognize that it's not installed yet, because it's still listed in com.apple.mobile.installation.plist.
I try to find out where the iOS stores all the information about a user installed application. Would appreciate any help or hint to find out the information. Thanks in advance!
Consider I'm working with an jailbroken iDevice, so everything is possible ;-)
Wipe whole device programmatically
Is there a way to programatically restore my iphone to factory settings?
Uninstall some app programmatically
if you want to uninstall apps, you can use private API "MobileInstallationUninstall". However, it requires entitlement "com.apple.private.mobileinstall.allowedSPI", which you can get, because your device is jailbroken.

Is it possible to distribute an iOS app for simulator testing on MacOS?

I'm in the early alpha stages of an iOS app and I'd like to be able to deploy it to some non-technical people within my company for early feedback. It's premature to deploy it to physical devices, and not all the people have them anyway.
What I'd like to do is somehow install the iOS .app file into the simulator app, and bundle that into a MacOS .app file that I can just email to people and have them run just by clicking on it.
Second best, but acceptable, would be to have the users install Xcode and have a way to send them the iOS .app file and have some sort of script that would load the app into the already installed simulator app.
This seems like it ought to be possible, but I can't find any way to accomplish it.
Note: There is a LOT of advice online about things like TestFlight or Over-The-Air apps, but that involves the physical hardware, which is not what I'm trying to do here.
Following the idea in this SO answer, I used SimLaunch, which packages your iOS .app file into a MacOS .app file. The recipient has to install Xcode, but once that's done, he/she just runs the app and the app invokes the simulator, with your iOS app installed. It totally works.
One potentially tricky thing: when you run SimLaunch, it asks you for the location of your iOS app. When you tell it, it creates the output MacOS app in the same location, with a file name like YourApp (iPhone Simulator).app, but doesn't give any message telling you this, and it says running, so it looks like the app is just frozen. In fact, it's done and waiting for more work, but it took me a while to realize this.

Xcode - How to move app out of sandbox with run script?

Basically from what I understand is that if my app wants to use serial communication via the dock connector (pins 12 / 13) the app has to live outside the app sandbox folder. Now I don't want to have to ssh into my phone and copy theAppFolder.app to /Applications/ everytime I click Run in Xcode (that would just be silly).
Now while doing some research I came across this blog post. Down in the comments, someone gives the idea of what I am talking about in this question.
Now is his solution the best way to do what I am thinking of doing, or is there a more elegant solution?
A bit late, but I use Xcode's build command with a post-build script to get my app on my jailbroken iOS device and also start it using a tool from Cydia (it will actually run the app from the /Applications directory). Check out my answer here for more info. The thing still missing is the ability to debug, but I've gotten used to using NSLog and tailing the syslog.

Deploying iOS App in Xcode 4.3+ without certificate

Hello all!
I want to test how my Cordova-ported apps run on real device, and if I like performance, I'll buy Apple Developer Certificate. But now I dont want to waste hundred bucks just to see my webapps running slow and ugly as shit. I've looked through all that forums and also here on stackoverflow, and all solutions seem to relate to iOS SDK 4.2 and earlier.
And what about Xcode 4.3+?
I've edited /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/SDKSettings.plist and also turned out code signing in project settings.
I've got two MyProject.app's from "Build for Running" and "Build for Archiving" and tried to sync them to my iPod touch 4 via iTunes, but in both cases app crashes immediately after launch.
I also extracted .ipa from iTunes and tried to install it via Installous, but got the same problem. Thing crashes.
I also got .xcarchive via Product->Archive but don't know what is to be done next with it..
So, question is here: how can I deploy my own app to my own jailbroken iPod touch?
Thank you.
I would suggest you to take a look at JailCoder.
It allows you to Debug your app made with XCode on a real device without a developer account.
Please keep in mind such solution should only be temporary. If it runs well and you want to do further developing / deployment consider buying a Developer account.
On jailbroken iDevices, Cydia (and other dpkg installers) install apps to /private/Applications/
So why not try:
/Applications/MyProject.app
Then open a terminal on the device and navigate to /Applications:
chmod -777 MyProject.app
chown root MyProject.app

sharing ios development between developer and non-developer

I'm about to make an individual iOS dev account, but I would like to share my work with a colleague or two for input that do not have an account (they have Xcode). They will look at the code maybe a bit, but mainly to test the app itself and provide feedback for me. Currently I don't have an account and what I have done is take a screencast of the app in the simulator and send the screencast. Obviously not ideal. So what are my options to share my progress on a daily basis? I think just to have them run in the simulator on their end is fine, until the app is almost complete then maybe on their phone would be good too. Thanks,
rc
A) look at testflight (testflightapp.com) - it's a site which allows you to email ad hoc builds of an app to testers.
B) put your code into version control and give them access. (ie GitHub.com) then they can build it themselves with Xcode onto their devices.
I'd go with A, it gives you more control and the potential for fewer support questions :)
I'm not sure why you would want non-developers looking at your code but I'd that's really needed, option B :)
The type of developer account you get and your ability to share your code are two unrelated issues. Unless you want your colleagues to be able to build your code and install it on test devices, they don't need developer program subscriptions. You can share your code with them in whatever way suits you (give them read access to your version control system), and you can build test versions that they can install on their devices. The only thing they won't be able to do is to build the app themselves for installation on a device.
If the main purpose is for testing, then get an enterprise certificate, sign the app with it and send the ipa file. They will install it and test the app.

Resources