Moving archives from Mac OS X to iPhone OS - iphone

My iPhone application has a fair amount of data that it needs to run, which I would like to store in the bundle as archives, and unpickle the data when the application starts up. Can I create these archives (which include instances of custom classes) on a Mac OS X system, and read them from the iPhone app?

If your question is: can you create archive files on the Mac, then ship them in your app's bundle, and have code on the iPhone access those bundled files, the answer is: sure, why not?
If your question is: can you have these archives live on the Mac, and have your iPhone app go find and download them when it first runs, the answer is: maybe, but it's much harder. And doesn't work too well for users whose devices aren't online when they try to run the app.

Related

Access iOS app documents directory from OS X

I'm working on an iOS app that creates some files and saves it in its documents directory. It would be really helpful for this app if I could create an OS X app that could access that apps documents directory as well as the pictures on the device. I know it's possible because of this app, but I can't seem to find a way to implement it. The iOS app does need to be approved by apple, but the desktop app doesn't. With these apps I am targeting non-jailbroken iOS 5 devices and OS X Lion. Any ideas on how I could do this?
A few other solutions I am considering:
upload the apps documents directory to iCloud and then download it on the desktop
upload to dropbox for auto syncing
make the desktop app into a server and upload from the app to the desktop over the network
Those are all backup solutions, but it would be great if I could do this without having to depend on the network.
Take a look at: libimobiledevice. It's a library designed just for that. Anyway, all of this is not supported by Apple, as there isn't any public API for accessing the filesystem.
You can make your device to act as a HTTP server. There are several 3rd parties libraries that can help you get started. I personally have used iPhonrHTTPServer3 which is based on CocoaHTTPServer?

Reading iPhone files from PC / Mac programmatically

Applications like iPhone Explorer can show the contents for each installed iPhone application on Mac OS X (even on non-jailbroken devices) when iPhone is connected using USB-cable. I'm trying to do something similar, programmatically copy some files from my iPhone app's folder.
I have done some experiments with open-source frameworks/products built to use iTunes-framework, like iPhoneBrowser and MobileDevice Library. I can connect to iPhone, now the problem is how to enumerate Apps folder items? iPhoneBrowser or MobileDevice Library don't support or provide any easy way for that. Even when hardcoding my application path to iPhoneBrowser it still refuses to display the folder. iPhone Explorer can read the folder without any trouble on the very same device, so it is definitely possible.
Second problem is getting path to apps, on each device they have different path with some hash number folder names. How to 'decrypt' the paths so that I can access my app folder on every device?
the app enumerate use another protocol, you may find some in this https://github.com/phildrip/fruitstrap
I wrote a open source program that works on Windows, here is the github project url:
https://github.com/Moligaloo/iPhoneFS
It can access files on jailbroken iPhone/iPod/iPad (non-jailbroken devices files are limited accessible).
It can also enumerate apps on iDevice.

IPA file support prerequisites?

I have an in-house iPhone app. Developed about a year and a half ago. Up until now, I'd ship it to users as an ZIP-archived app bundle, instructing them to unzip, add to iTunes library and sync.
Now, there's this fancy new IPA file format that simplifies this process considerably. Question - what are the prerequisites for its support? Does it require a specific version of iOS or iTunes? If yes, which version?
Preempting the questions - yes, we do support over-the-air installation. iTunes-based installation has to stay for the sake of remaining iOS 3.x users.
It shouldn't, as:
An IPA file is merely a ZIP file with a different extension
iTunes has been using IPA files for apps since the App Store first launched

How to transfer Core Data store from provisioned iPhone to iPhone simulator?

I have a lot of data stored in my app on my provisioned device, and I want to do additional testing on my computer which is much faster than using the device. What is the best way to transfer the data store into the iPhone simulator so I can access it on the computer?
I think that you can download the data from your device in the Organizer in Xcode.
Once you unzip that folder you should be able to find your sqlite database file.
Now look for the folder on your hard drive where the simulator keeps its files. I think it's somewhere in ~/Library/Application Support/iPhone Simulator or something like that. There should be a folder for each app somewhere in there (the folder name will be some random ID), and you should be able to find an sqlite database with the same name. Replace that database with the one you downloaded from the device.
Sorry I can't give more detailed instructions. I'm at work currently and don't have access to my Macbook to get the exact folder names and such.

Develop iPhone app without a Mac? [duplicate]

This question already has answers here:
Closed 13 years ago.
Possible Duplicates:
How can I develop for iPhone using a Windows development machine?
I'm looking to build an iPhone app for my wife's phone, but am not interested in buying a Mac as a development platform for a one-off piece of work. The app:
should run standalone on the iPhone (i.e. without network connectivity)
would be perfectly acceptable with a GUI created using one of the iPhone Javascript libraries that are around
will do some database IO to read and update data
has no commercial value and will never be used by anyone else
Here's my thinking:
jailbreak the iPhone
install Ruby + Sinatra on the iPhone
write the app using Sinatra, hitting a database (SQLite?) on the iPhone
To access the app on the iPhone:
start the Sinatra app in the
background (is this possible?)
start a Safari browser session
navigate to the Sinatra app at e.g. http://localhost:12345
etc.
This seems like a strange approach, but I can't think of a simpler way of writing a standalone iPhone app without buying a Mac. Is there a better way of doing this?
The only reliable info I could find is at the always-excellent MetaFilter
http://ask.metafilter.com/110466/Anyway-to-develop-iPhoneiTouch-apps-without-investing-in-a-Mac
The answer is apparently no.
You absolutely need an Intel Mac of some description.
The entire iPhone build process is too deeply ingrained in XCode to build elsewhere; and the only other Objective-C compiler I know is gcc, which doesn't support any Apple's additions to the language (nor their libraries).
And, in direct opposition to what people are saying above, Objective-C is absolutely my favorite native, compiled language. Elegant, small (only a few changes from C), late-binding, dynamic, straightforward. It's what C++ should have been.
Lots of people recommend picking up a secondhand Intel (remember, must be Intel!) Mac Mini as the cheapest "port of entry".
What you have described is a viable solution, however you should consider using the open toolchain for the iphone.
You don't need a mac then, only need to jailbreak the phone to make sure your app will work.
For all those who say it can't be done, this was the only way to make Apps for the iphone before the SDK was out :)
Also if you are after a guide to using the open toolchain then I highly recomend this book
If you're considering creating a GUI using a javascript library anyway, why don't you just write a web app instead of an iPhone-native one? It seems like overkill to jailbreak the device just so that you can install a ruby + sinatra web app on it. Can't you just put the ruby web app on a server and create a Safari shortcut to it on the home screen? If you don't have a server, you could always run the website off a PC in your home...
Jailbreaking the OS and running a ruby app onto it would be technically cool, don't get me wrong - I just think it'd end up being a time sink.
Just my 2c!
Depends on what your time is worth, I guess. That seems like a terribly convoluted way to get what is otherwise a simple app on the phone to avoid the US$400 purchase of a used Mac Mini.
There is the hackintosh route, which may work on your existing hardware, but again one has to put a price on time. It's what got me started before I dropped big coin on a Macbook Pro, an MSI Wind then a home-built. It's of questionable legality (the right thing to do is fork over US$129 for Leopard regardless), but you are already talking about jailbreaking. :-)
Get someone else to do it, or rent the resources that you need.
Another option is to find nearby iPhone developer who has it all setup and either get him to write the app or do it together, he provides development environment you code the solution or code it together.
The only problem is that you wont be able to update maintain it.
I would still consider getting older gen Mac or Mac mini - all the other options sound more complicated.
If you are going to be stubborn about not using a mac, but you want an app that will work offline with the iPhone / iPod Touch and Android devices, then I would use HTML 5 to create an offline app.
You can do a lot now with HTML 5 - Google have an email client that uses HTML 5 for the iPhone now and it can work offline etc. If you do this and get the user to add a bookmark to their home screen for your app - it will be almost as good.
If I was you I'd fork out for a mac - or look to see if you could borrow one - or time-share with someone - you will not create a very good quality app without it.
You can jailbreak the phone and install Python. There are some sample applications in Cydia for it (it's called iPhone/Python. Search for Python in cydia).
Then you will have a "native" app, not a web application and you can use the entire iPhone UI library (the part of it that is accessible via py-objc anyway) and you don't need to run a web server in the background.
You can do your development on the phone itself via SSH or you can use an iPod Touch for it. Packaging is also easy (should you need it), just create your own Cydia repository and host your package(s) in there.
Look at iPhone applications in Python for more information.
Come on, just look on eBay for the cheapest intel mac mini you can find. Even a Mac laptop with a busted screen (that you could hook to an external display) would work. You're talking just a few hundred dollars probably and then you can maintain it as her phone/Touch is upgraded.
there's some special meta tags you can put in a webpage to make your web app savable and full screenable to the iphone hard drive. (so it can work offline) Here's an example : http://mrgan.tumblr.com/post/125490362/glyphboard2
There's also frameworks like phonegap that let you access cocoa apis from javascript, but it sounds like you don't need that.
Does your wife enrolled in any kind of data plan? If so, you can simply write a small webapp which runs on some cheap webspace and access it via MobileSafari.
If you need a full grown iPhone application, you better look after one of the first intel-based mac minis on eBay, should be to expensive, in my opinion. And as a plus you avoid the hassle of a jailbreak.