How to access iphone Memory card (SDcard) programmatically - iphone

I want to access sdcard of iphone, I have some question regarding this.
by searching little bit i think iphone donot support sdcard ? if it support SDcard then kindly tell how we access iphone expanded memory what is path path of external storage of iphone. for example as in android we can access sdcard directory by
Environment.getExternalStorageDirectory(); ( return path to sdcard in android )
how to see sdcard contents in emulator of like in eclipse we can see android's SDcard folder in Forlder explorer any thing like this is in iphone?
how to get list of sdcard contents.

There is no SD card.
Applications may only access their own sandbox Documents and cache folders. If you need to transfer files, you have three options:
E-mail.
iTunes File Sharing
iCloud

hello salman Roy First of all i want to tell you that there is no external sdcard like android in the iphone or ipad.it is all sandbox environment.And one more thing for the iphone development there is no emulator its a simulator.

Related

Uploading or adding images to iOS device camera roll

I am testing an iOS mobile app on AWS Device farm that requires me to be able to select images from the iOS device. I cannot use the camera images on the device farm devices as they are dark and my testing requirement is to be able to use 'real' images. Is there a way to upload images to the iOS device/s that tests run on or easily add them to the devices as part of test setup? Thanks.
There is a way to add images to the app's bundle using the extra data feature of Device Farm.
The app should be able to access it using the bundle object and the file tree of the zip file uploaded to Device Farm. So the path to images would be something like: path/to/bundle/aatp/data/images
Assuming the zip uploaded has a directory called images.
Hth
-James

where is the file located in iphone after integrating a file to it via itune

By enable the option called
Application supports iTunes file sharing,
I can integrate a file ( example an image) into my device via iTune. My question is where is the location of that image in my device and are there any ways we can access it via xcode.
Please advice me on this issue if you have any ideas about this.
Thanks
In Xcode.... Organiser > Your Device > Applications > Click App > You can see the files in the sandbox
Each app is sandboxed. That means it has it's own filesystem generated by xcode (/library /documents) relative to the app. Your files are probably on [yourapp]/documents.

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.

Not loading all content of ipa file into device while using itunes

i developed an app which is meant to read books(pdf book reader).i loaded 25 books(total size of 320MB) into the app using absolute path.all the books are been seen in the simulator and also i can load all the books into my device through xcode(build and run).
my requirement:
when i loaded the above obtained ipa file into the same device or other device which are in ad-hoc distribution using itunes , it is strange that only few books are being seen in the device.
note: i made sure that all the books are present in the .ipa file,i deleted old app in the device which i run via xcode. the device is in ad-hoc distribution.
while code signing i used the iphone developer certificate.
is it necessary to use distribution certificate instead iphone developer certificate which i feel that might be one reason for my problem?
plz anyone suggest me with exact solution to the scenario.
tnx in advance
I know I have seen problems going from simulator to live device. The simulator is not case sensitive, but the device is. Recheck all your actual files in bundle vs what you are requesting when you open the file. They need to match exactly for device, but not so much for simulator.
I would also try seting the apps-Info.plst to have "Application supports iTunes file sharing" on so you could see what is in the documents folder (this is if your moving files in that area).
One problem might be as RAZ suggested that iPhone is case sensitive, but there could be other problems.
For starters I would check the that ipa does contain everything you think should be there. Take the ipa, change the extension to zip and open it. You'll get a folder containing you're app. Right click the .app and choose show package. You'll now see all the files/resources included in your app. If the files that won't load in the app are there then you'll need to provide more information about the problem.
If they're not you need to make sure xCode knows to copy them to the app resources.
You might have resources that you haven't copied into the project, and you're only referencing the files on your hard disk. Then when you make the .ipa file it's not included. Try re-importing all your resources and select "copy to project".

Accessing the iPhone filesystem from a Mac OS X application

I need to get a file (sms.db) from an iPhone connected to a Mac. I cannot find any way to access the iPhone filesystem searching in Apple Developers Connection...
I cannot SSH to the iPhone, the application I want to develop is meant to be used on non-jailbroken iPhones... And I would like to avoid some MacFuse modules I found googling, too... I would like to access the filesystem thru some sort of API, the simpler the better.
Thanks!
This api was developed to allow access to ios devices:
http://www.libimobiledevice.org/
There is no Apple-documented public API for accessing the entire filesystem on a stock OS iOS device. Even private OS/API calls won't work due to the app sandbox restrictions.
Xcode, iTunes, and probably other apps that take over the iTunes USB driver, are using a non-Apple-documented private API that only works over the USB connection.
It appears that DiskAid silences all nay sayers. That app seems to have complete access to the iOS device filesystem - whether or not iTunes is running and whether or not the files are shared. It even sees files down to root level. I am still trying to figure out how it is done. Oh yea, this is all on a non jailbroken device.
It is not possible for non-jailbroken iPhone due to file system restrictions.
You can't access the filesystem from an OSX application, the filesystem is locked down.
Phoneview (as mentioned in a few comments) does not allow access to the file system.
It uses public APIs to get things like call data and contacts, and allows you to copy files into one location on the phone.
From the FAQ: "PhoneView will store your files in the media section of the iPhone's disk"
Smoke and mirrors.
If it's for your own app, use the document sharing included in iOS 4.x. You can then have files show up in iTunes, and drop files from the desktop into your app's section.
A tutorial is found here:
Ray Wenderlich's nice tutorial