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

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.

Related

Collect iOS application logs automatically through script

I have been going crazy over this, is there a way to collect iOS application logs through script? I am working on an iOS application and have written some UI Tests now in order to gather logs i had to manually take it, is there a way some utility may be in form of script which i can fire and download the logs on my mac. Ofcourse my devices under test are connected to my mac machine. I have been going over cfgutil, apple script but so far no luck. Anybody with knowledge and care to help. Please do so!! Thanks!!
no. you can't, mainly because the output of debug in xcode is handled by xcode it self

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

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

How can I be sure my app has the proper permissions when I distribute it?

About two years ago, I ran into a problem where my app will crash immediately on start up and it turned out to be a permission error. I got a solution and I haven't had this problem lately. The problem came back with the latest release of my app. I gave my app proper permissions the same way I had since the problem first occurred. I installed the compiled app on my iPod Touch in /Applications, give it the proper permissions via SSH, make sure it runs on the iPod, the copy it back to my Mac, zip it up and submit it to the repo. I never had a problem with this method until now. Even if I give the app proper permissions on the Mac and then zip it up, the app still does not have the proper permissions after being zipped up. My question is how can I make sure my has the proper permissions so that it will run on the users device when I distribute it? Just to be clear, I'm not asking how to give the app execute permissions, I know how to do that.

iOS : Shell script from an iOS App

I believe, we can run shell scripts from iOS App.
Can someone tell me what is the default shell in iOS and how to call a shell script from iOS App?
((
Please consider that I run the script in background. I catch the return value of the script into a variable. (following line is not exact code. Pseudo. Zsh shell is default - I think.)
myVar=MyiOSAppBundle\Script.zsh
))
Regards
You cannot do this in iOS. If you are jailbroken, you may be able to, but otherwise applications are not given admin permissions.
Apple's guide on The iOS Environment in which an app lives may give you more insight.
Apple says in their May 2012 document titled "iOS Security":
Because iOS achieves a reduced attack surface by limiting listening ports and removing unnecessary network utilities such as telnet, shells, or a web server, it doesn’t need firewall software.
Your question lacks details. What are you trying to accomplish? What have you tried? Are you intending to develop for a jailbroken device or for the App Store? Please edit your original question or create a new, more complete one.

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.

Resources