iOS Sync & Backup - iphone

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)

Related

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

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.

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

Streamlining OTA testing on local network

I need to allow an iPad to quickly install an IPA saved on a local network. The solution I am using today is pretty cumbersome:
Create IPA
Uninstall previous version from iPad
Restart iTunes, if running
Drag new IPA over to iTunes
Sync
Populate the documents folder of the app with large test files which was deleted because of uninstall.
I tried several other ways, including the obvious just drag over the new IPA directly to iTunes without uninstalling it first, but the updated IPA is just ignored.
(Also, I cannot install over a cable from Monodevelop directly, as I am on a Windows machine and the remote controlled Mac doing the actually compilation is not physically anywhere near me. We also have other testers who need to install the IPA as well.)
Is there a faster way to do this? I am doing frequent benchmarks of my app, and this long testing cycle is seriously slowing everything down.
If you are using iOS 4+, you can accomplish this with wireless distribution:
http://developer.apple.com/library/ios/featuredarticles/FA_Wireless_Enterprise_App_Distribution/Introduction/Introduction.html#//apple_ref/doc/uid/TP40009979-CH1-SW2
If you don't want to use PHP you can have a look at my shell script that will help you generate all the necessary .plist files and links:
https://github.com/sveinungkb/ios-ota-buddy

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.

How to add adhoc application on multiple iphone on the same computer in itunes?

How to install my app in adhoc release on multiple device with the same computer/itunes, when i try to do it, itunes sync the devices..so i clean them up ...
Apple has solved your problem with an Enterprise Utility called the "iPhone Configuration Utility" which you may freely download from their information webpage here: http://support.apple.com/downloads/iPhone_Configuration_Utility_2_0_for_Mac_OS_X
Once you install this and connect a device and close iTunes (which typically launches in response to the device connection) you can easily use its simple interface to manage your adhoc provision profiles, add the device and install or remove adhoc apps directly.
I used this app months ago to put the Crash Landing demo I'd built with the SDK directly on my wife's 2.1 iPhone 3G from my desktop dev Mac without messing up her own laptop Mac iTunes sync management of her apps, music, etc. FYI: I've not tried this since the June update to v2.0 of the Utility which accompanied the release of OS 3.0. edit: I couldn't resist testing this (yes, it still works)
The only downside I noticed to this method is that the iPhone/Touch user will have to later delete the app manually on their device, as their iTunes management won't list the app in the device applications tab to be unchecked.
it should just work, as long as the mobileprovision file that you're using includes all of the devices that you're trying to use. (also assuming that all of the devices are set to sync to that one computer's iTunes library.)
If the device is jailbroken you can install sshd and copy the application directly.