Database path not been used by application - Logic issue - iphone

I have created a sqlite database. and dragged it on to my projects resource folder.
In my project i am accessing a sqlite file from
/Users/user12/Library/Application Support/iPhone Simulator/4.3.2/Applications/1F219005-A4ED-4794-81FC-65EEF8D243EF/Documents/db.sqlite
I am not using the sqlite file that was added to the project. and my project is accessing the DB file from the above location.
So, now when i try to launch my application from a different mac i am unable to launch the application because the DB is not found in that path. So how could i solve this ?
note: i used FMDB.
My final objective is to give this application to my client and since he will be running the app on his iPhone, he should be able to access the sqlite file with no issue. So what changes should i make ?

Surely xcode in other machine will have a different path. Try to place the sqlite file at the app path created by xcode on the new machine.
EDIT:
To do what you've said in your comment i suggest to create an ad-hoc certificate. Then use xcode to create your archive.
But the path of your sqlite file should be in your main bundle.
ps: You need the UDIDs of your client iPhones to add the devices to the portal.

Related

Locating .Storedata file in Mac

I have build an iPhone project on my IOS device. I used core data for storing some datas. When i build, it is woking. I just need to locate this .storedata file and when i traced, the location is /var/mobile/Applications/211B3C9E-82B3-4304-90D2-EE5E4337D9F1/Documents/MyProject.storedata. I opened all the hidden files in the machine but i am unable to locate the specified path for the device. I could locate the file when i build it in simulator. Can anyone suggest me some way to locate this file?
If you're running it on the device then you're creating the database on the device. You need an iPhone file explorer (I use iFunBox).

XCode 4.4 "Permission denied" when trying to download Application Data

After updating my XCode to version 4.4 it seems to be impossible to retrieve Application Data from my devices.
In Xcode 4.3 (and all previuos version) I downloaded my Application Data (like SQLite databases and files I created) through the organizer (Organizer -> Devices -> "Device" -> Applications -> "Application" -> Download).
With Xcode 4.4 i get an error ("Permission Denied") when I try to download the Documents from the sandbox.
Is there anything new (maybe a new setting?) I have to change to obtain the Application Data from my device again?
Temporary fix is using itunes to get the files from the document folder.
In your .plist -> Information property list -> add:
UIFileSharingEnabled (YES)
Rebuild and go to itunes and get the files from document folder.
I am having the same problem and will give a little more information:
Even though Xcode gives the "Permission Denied" error, it does export two files into a xcappdata file and does not even export the "Documents" folder.
AppDataInfo.plist
com.apple.PeoplePicker.plist
Then I deleted the app and all data off the device and reinstalled it using Xcode. I exported the data after running the app and generating a log (log saved into the documents folder). This new log file was properly exported inside the "Documents" folder, but Xcode still generated the "Permission Denied" error.
After further running the app and generating logs, attempting to export the new data resulted in identical exports as the the first export after reinstall.
This bug appears to be fixed in Xcode 4.4.1
I have been temporarily mounting Xcode 4.3.3 from a disk image and using Organizer there. Not the best solution, but seems like an "okay" workaround.
UPDATE: seems to be fixed in Xcode 4.4.1
I'm seeing this problem also with Xcode 4.4, used iExplorer to get the files, someone else said PhoneView should should also work.
Sorry for late reply for this question. I thought its worth putting up if anyone comes across this situation. The best way to get hold of the data is by directly accessing application folder by using an Application called "iPhone Explorer" or "iExplorer" both are free and will let you directly access iOS device file structure and you can copy Documents folder from it.
Hope it helps. Thank you :)

Firefox SQLite Manager cannot access Xcode iPhone simulator SQLite DB Directory

I have a question regarding opening SQLite database from SQLite Manager extention of Firefox. I use SQLite database for my iOS app development and always use SQLite Manager to load the database for the app runs on iPhone emulator (The file is under /users/myUserName/Library/Application Support/iPhone Simulator/5.1/MyAppGUID/Documents directory ). It worked fine since last week.
I suddenly found if I choose "Connect Database" from SQLite Manager menu, I couldn't find the /users/myUserName/Library directory anymore. I can still access the directory from Finder, I can still see the database file from Finder, and if I copy the db file to another directory, I can open it with SQLite Manager for no problem. However it is quite annoying that I couldn't open the database directly.
Anybody got the same problem before?
Thanks for any help.
Could this be related to the fact that the library folder is hidden by default on mac os Lion ? not sure if thats what your using but if so check out:
http://hints.macworld.com/article.php?story=20110704093233123
I used this tip to reveal the hidden files in OS X
http://mac.tutsplus.com/tutorials/os-x/quick-tip-revealing-hidden-files-in-os-x/
Then I added the hidden Library directory to my Finder Favorites and when I go into SQLite Manager in Firefox, I can drill down to the app's sqlite file.

Is it possible to get information out of install plist?

I'm trying to find out if it's possible to get any information out of the plist used to install an enterprise app onto a device to then store for the app to use.
What I'm trying to do is pass some information to an app on install so that it can then use that information within the app. I can't make this data static, so it can't be stored in the Info.plist file in the root; it needs to be dynamic and will change on an install by install basis. I also can't pass the information by a web service etc, it needs to happen on install.
Many thanks,
Davoc
Since you're distributing for enterprise (ie not through the App Store), here's a thought: since you can re-codesign an app package after it has been built, and an ipa is simply a renamed zip, why don't you put the app on the server as an unzipped package, and have a server side script insert the settings.plist, zip and codesign the app every time someone downloads the app?
In Summary:
1. Compile the package, but don't code-sign it.
2. Place the app folder (*.app) onto a server.
3. When the user downloads it by requesting a link, have the server generate your desired url into a plist and overwrite the existing settings.plist in the bundle
4. Code-sign the package using apple's codesign tool via command line
5. Zip the whole thing and rename to .ipa
6. Serve the package to the client.

iPhone sqlite sync with sqlite on dekstop/mac

Can I sync the local sqlite database on desktop/mac with sqlite database on iPhone for application by directly connecting the phone to my mac/pc?
You could enable iTunes document sharing with UIFileSharingEnabled in the info.plist and then copy the sqlite database file to the Documents directory in your application, if it isn't there already.
I've been able to do this and was able to read the file just fine with sqlite on the desktop.
unfortunately it isn't automatic. Someone would need to go into iTunes and manually copy the file over each time.