How to copy files in iPhone /var/mobile/Container/Data/Application/Document - iphone

I develop a test app for iPhone which needs to read some file. In simulator I copied those files showed by NSSearchPathForDirectoriesInDomains. Now I try to run the same app in iPhone and it is showing /var/mobile/Containers/Data/Application/ED49734D-0E61-4BB4-B3CC-D462F3BF9215/Documents/
location, but I don't know how to put my files in Documents folder so it can be read by my app.
Please help

To copy your files, you need to:
Make sure your iPhone is jail-braked (otherwise, you wont be able to access this folder)
Install tweak from Cydia: Apple File Conduit "2" (this is version for iOS 8/9)
Transfer files with one of the following PC tools:
iTools
iFunbox
Hope this helps

Related

How to extract sms.db from non-jailbroken iphone on linux

Objective: Extract the sms.db sms text message database from an Iphone 4S.
I have installed ifuse on ubuntu 12.04 and am able to browse certain folders. None seem to contain the 'sms.db' file.
It is possible to extract the sms.db using freely available tools on linux?
I don't know yet how to access the SMS.DB file directly from the phone. But if you backup an iPhone using for example iTunes, you can then read the SMS.DB file from within the backup. It will be SHA-1 hashed (the file name will be gibberish), but it should still be a .DB file. You'll need iPhone Analyzer to unhash the file names, or something similar. Then you can load it into SQLite.
Please post here if you find a solution.
I've figured out a way on how to access it with Jailbroken devices... It miiiiiight be the same if you aren't jailbroken based on what the Github says (https://github.com/libimobiledevice/ifuse)
Anyways, open a terminal
Sudo su
now make a folder in your home and direct ifuse to that folder
ifuse --root /home/<INSERT NAME>/<INSERT NAME OF FOLDER>
Now you gotta open that folder as root
nautilus
Browse through your /home/ and find the folder.
It should be in
/var/mobile/Library/SMS/sms.db
Then you just copy it to your desktop and your good to go!

iOS Writing Files

If a device is jailbroken, the file system is unlocked and open for you to see and modify. If I wanted to write an app that wrote a file to the /private/var/mobile/Library/Preferences/ folder, do I have to use a command other than [fileManager copyItemAtURL:fileTempPathURL toURL:filePathURL error:NULL];
? I'm using this command, but it is not working... Thanks for your help!
If you're on a jailbroken device, you can write to any place in the system. You can do this in many different ways, from the C FILE pointer to all kinds of iOS Foundation methods, like the one you mentioned in your question.
The only thing you'll have to mind is that your application has to be installed in the /Applications directory and not in the ~/Applications directory, what iTunes and Xcode will do by default. Only by putting them in that folder, along with the Apple base applications like MobileSafari, MobileMusicPlayer, etc. your app will launch from the springboard with those root privileges. You can put it in the /Applications folder through SSH.
If you do not manually put your app in the root application folder and your app resides in its own subfolder in ~/Applications like normal App Store applications do, your app will launch in a sandbox. This sandbox will then prevent you from accessing any file outside your application's sandbox.

Blackberry simulator won't load cod file from eclipse

I've got eclipse installed with the appropriate blackberry plug-ins, etc. I can build the project fine. When I try to debug using the simulator, the cod file is placed into the simulator's directory and the simulator starts, but I can't find the application. It is not in the Downloads directory-thingy or anywhere else that I can see...
How do you tell fledge to load a particular cod?
I've tried all of the "solutions" in these 2, similar questions, but have had no success.
I had apparently done something that made the cod file invalid. As such, it wouldn't load into the simulators. In this particular case, a resource file had a space in it's name.

Problem installing ad-hoc app on iphone: "resources have been modified."

I can install an app on my development iPhone compiled with "Debug" configuration using my Ad Hoc provisioning and everything works OK.
But when I build it using "Release" configuration, iTunes says:
The application XXX was not installed on the iPhone "YYYY" because its resources have been modified.
I've never seen this message before. Does anybody know what it means?
Thanks!
Antonio
We had the same problem during our first Beta. Someone on Windows dug in the xxx.app folder then Explorer created a Thumbs.db file inside and, boom, he got the message "The application XXX was not installed on the iPhone "YYYY" because its resources have been modified." when he tried to install.
He had to remove the app from iTunes, deleted all the Thumbs.db from xxx.app and then it worked.
We finally got rid of the problem. We were trying to include an image for iTunes after creating the build, but when we used this method (http://iosdevelopertips.com/xcode/itunes-icon-for-ad-hoc-distributions.html) everything went smoothly.
Just in case it helps someone: In my case, I copied the .app to a network drive, then to my Win7 computer before dragging into iTunes - then it did not work. When I zipped the .app first before copying, and then unzipped it on the other end - it worked. Of course, I have no real idea why....
Your debug configuration and your release configuration have some important differences, and release is a lot closer to what ad-hoc should look like. So you first need to duplicate the release configuration and make and call your copy "Ad-Hoc", and make sure you use your ad-hoc provisioning profile with it. Then you need to create a new entitlements file. The new version of Xcode has a cool feature where you can build and archive your app into an ipa file that includes your provisioning profile.
How to do all of this is explained here: http://www.tuaw.com/2010/05/23/devsugar-a-better-way-to-share-ad-hoc-builds/
In those instructions, when it tells you to make the entitlements plist file, it says to uncheck get-task-allow in the plist file. When I created the entitlements file, there wasn't a get-task-allow row at all, so I created one, set the type to boolean, and left it unchecked. It worked great for me.
The best solution to avoid wierdness like this is to create an IPA file. A good step-by-step guide to creating an IPA target in XCode is here:
http://idotcomllc.wordpress.com/2009/05/26/how-to-build-a-ipa-file-from-xcode/
It starts out with an introductory project so search for "Aggregate" to find the point where it starts telling you how to create a new IPA target for build.
I directly upload the app to a server where the windows can also visit. Then compress it in Windows.
I had it, did a clean build and never saw it again.
Incomplete ipa/zip archives (received at the installation end) were the cause for us.
I had this problem using a run script to cp -R the .app file to the Payload folder, for some reason when the script copied the file it modified it somehow, if I used finder and manually copied the .app file into the payload folder and manually zipped the .ipa file it worked fine. I tested it several times using codesign -v to verify the .app file. it always through the error after a build and the run script. but no error when I would copy the file manually.
For me the issue was the .Double files being added to every directory on a shared network drive. We are primarily a Windows environment, and the Mac was saving .Double file on the drive, in every directory.
Literally, to fix the issue referenced above, I simply deleted the .Double files in every directory (of the app being copied to iTunes) and it fixed it.
Hope this helps someone!
I was tasked to test some apps and for some reason was the only one on my team getting this this error. I am working on an XP. All the apps we are testing use the same provisioning file yet some would sync while others would not. Not sure what fixed it but I did go into my *My Music\iTunes\iTunes Media\Mobile Applications* folder, deleted the existing .ipa file for the app I was trying to sync and it seemed to sync fine after. It might not be the answer to your problem but give it a try.
If you work with asstes on a Mac, or have versioned content, I had the same problem with .DS_Store files and hidden .git folders. Once deleted from assets, problem gone. It might be an issue with hidden files.

Developing for the iPhone outside Xcode

I'd like to develop and run my iPhone applications from the command line and my personal editor instead of having to use Xcode.
So far I've been able to edit all the files in Emacs and run xcodebuild in the project to compile/link/etc.
The next step would be to create a Makefile task to launch the iPhone Simulator with my current application. Any ideas of how can I do that?
Update: I'm not interested in XCode calling my editor, I just want to forget about the IDE as much as I can.
All you need to do is copy the built .app from wherever XCode puts it to ~/Library/Application Support/iPhone Simulator/[some version]/Applications/[somefolder]/.
Then, launch /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iOS Simulator.app. Not sure how to get it to launch a specific application, but that'll take you to the home screen.
Note also that you can set up XCode to use external editors, even for source code. In this setting, you'd open XCode to look at the treeview displaying the files and other items making up your project, but once you double-click a sourcecode file it would open in e.g. Emacs.
There's a screencast over at Mac Developer Network demonstrating this: link
I doubt it. If you jailbreak your phone and install SSH on it you could set up something to >>copy the .app over wifi, but that's a fair bit of work. – Noah Witherspoon Jan 13 '09 at 5:24
I did all of my beginning iphone development work this way. Just ssh'ing over the binary executable and whatever other files you might need (after you locate the App folder on your phone) is actually much faster than installing the application from xCode. Note that I wasn't running the debugger.