How to check if iPhone is jailbroken or not, from terminal on a Mac? - iphone

I would like to execute some scripts on my Mac, to which an iOS device is connected. The intent of the script would be to identify whether the connected device is jailbroken or not. Would be great if you could suggest the solution using bash or py.

You can attempt to SSH into it via the iPhone's connection program "usbmux" (to forward the wired data connection to a port on your computer). There is a script, as well as instructions on this GitHub page

Try this https://github.com/libimobiledevice/ifuse You can check if device allows you to access it's root folder. If you can access root folder then it's definitely jailbroken.
It's true that jailbreak doesn't necessarily mean you can access it's entire filesystem but all modern jailbreak solutions install AFC2 service which allows full filesystem access.

Related

Get iPhone app to iPod from remote machine for testing

My problem is - I work on a remote mac through Remote Desktop Connection - from a windows host.
I have my app ready on remote mac.
I have my iPod with me, connected to my windows host.
How do I get this app onto my device for testing purpose?
My access to the mac is through RDP.
I edited the rdp connection to allow local usb access to my remote mac, (remotely) hoping that my mac would see it as a device. But it didn't.
Is there any way it would see my iPod?
(I already read this and it requires mac-to-ipod direct connection.)
Or is there any other path I can get my app package on my device for testing through windows machine?
Firstly you will have to add your iPod to the developer portal if you haven't already. Next you can do a build and archive which will export your app into organiser. Click on the app version in organiser and click the distribute button and make sure you select ad-hoc distribution. This will give you a .app packaged version of your app which can then be sent across to your windows machine from your remote desktop where you can then drag it into iTunes and install it on your iPod.
If you are testing lots of different builds of your app over a short space of time then i would suggest using test flight, which can be found easily when googled. It allows you to upload versions of your app through and ad-hoc .app package which ca then be installed across all your devices using the test flight app on your phone. I would only recommend doing this if you are doing lots of builds and testing on lots of devices though.
Hope this helps
Sam

Application Loader (Apple) stuck on "Sending API usage to iTunes Connect"

I am submitting an iOS app to the App Store using Application Loader, however, it never gets past the "Sending API usage to iTunes Connect" stage. There is no error - this stage just doesn't complete.
I have verified that the Mac is connecting to the internet (I can visit websites). Also, the app is tiny (6MB) so this can't conceivably just be a long upload. I've tried leaving this for 20 minutes.
The background to this is that I developed in Flash CS5 on a Windows PC, built it for distribution there, and now on the Mac I am loading the final file into Application Loader to submit it. It verifies/validates the file just fine, but won't go beyond this point.
Any ideas anyone? Perhaps it's a network issue?
I had this problem when behind a firewall.
I got around it by going to Xcode > Contents > Applications > Application Loader > Contents > MacOS > itms > java > lib - Open net.properties with TextEdit and change the line
# https.proxyPort=443
to https.proxyPort=80. This enables the application to use the HTTP port for HTTPS. Worked straight away after this. Hope this helps.
You can solve this with a different approach using your iPhone. Disconnect ethernet internet cable connection (if you have one) and/or switch off wifi connection on your mac. Switch off your iPhone's wifi connection so G3 or G4 is active and turn on personal hotspot. Connect your iPhone with a usb cable with your computer and check in System Preferences -> Network if you're connected to internet via usb with iPhone. Start delivering your app with Application Loader program on your computer via your iPhone's internet connection. And yes you will cross the “Sending API usage to iTunes Connect” barrier and you will be able to upload the package to the iPhone store. At least I was!
If your Mac is has both a WiFi and an Ethernet connection, try turning off WiFi. That solved the problem for me (this time anyway).
I solved only rebooting mac.
I'm still searching for a less drastic solution!
I had my DNS set up to Google DNS. I removed the DNS settings and it worked for me.
Turning off iphone's wifi worked for me
Are you using Xcode Organiser > Upload to App Store or Application Loader?
I found I had the same issue when going though Xcode Organiser so tried it from the Application Loader (found within Xcodes application files) and it worked just fine. If that doesn't work there is a detailed activity log you can check to get a more detailed error.
Other things to try
- check your firewall settings, maybe temporary disable them.
- use an alternative connection, another wifi hotspot if you are on a MacBook, if not do what Oliver said and use your iPhone's cellular data.
I was connected to a VPN, disconnected and problem was solved.

Testing Adobe Air App for iPhone

how can I deploy my prototype app in order to test it on my iphone? obviously it isn't at the stage where it can go on the app store but I;d like to play about with it for testing..
Do I HAVE to enrol in the developer program?
You need to be enrolled in the Apple Developer Program to receive a certificate you can use to sign your apps to be installed on your iDevice.
In short, yes. But you knew that.
Although we as a developer don't suggest illegal installation, but some developers may find it is actually easier with the dark method:
Install you iPhone or iPad with "Installous" and "iFile",
with iFile, you can open a wifi port for any computer in the same wifi network to access the machine from there browser and upload file to the machines (without using iTune), so you can put your *.ipa file in the machine.
In order to manually install the ipa file, you may want to use the Installous, so what someone will do is to put the ipa to the [root]/mobile/Documents/Installous/Downloads, then when you open up Installous, go to Downloads, you will see your ipa and be able to install it!
Hope this hope.

Plug an iOS device into a computer, and then have the computer read its local files?

I'm developing a "two-part" app, where companion apps are installed on an iOS device and an OS X computer. What happens is:
iOS device gets connected to a computer via USB
Once connected, the iOS app writes some stuff to a local file.
Now how can I get the computer to read from that file? Would this require something like Bonjour, even though it is directly connected?
Without going through iTunes and it's File Sharing mechanism or trying to mine backups (also created through syncing in iTunes), you're pretty much out of luck moving data between the iOS device and the computer via the USB connection.
Unfortunately, the only reasonable way to handle this sort of thing is via a wifi network connection between the iOS app and a service running on the Mac. Bonjour is very handy for service location in getting the Mac/iOS device together.

iOS Sync & Backup

Given a jailbroken iPhone and iPad, various windows machines, and a possible shared web host environment, how would I setup the iphone/iPad to automatically sync a folder of files, such that modifying the files or adding on the iPad would result in them being updated/added on the iphone within the file system ( assuming wifi/internet connection)?
I have SSH on both devices, and Im not fussed on wether the latest and greatest version of the file needs to be on a local desktop/laptop or remote host, so long as when the iPad and the iPhone come into contact on the wifi network, the two copy over the latest version of the file.
I am aware of tutorials using rsync, but this would require me to manually perform the operation, and I would like to automate this as much as is possible
You could start with dropping rsync in favor of unison, which is quite good at syncing files "the right way". It doesn't matter on which host you fire it up, it makes sure both have the most recent versions.
It also can use ssh natively. But you would need to get or build a version for the iPhone.
With that in place, set up RSA authentication (copy public key to otherhost:~/.ssh/authorized_keys2), and let the phone fire up unison every once in a while (using cron), or when the wifi fires up. (maybe find the iOS equivalent of post-up on the wifi interface)