I am trying to use the PLDatabase framework in my iPhone app. I've added the framework to my Xcode project. However, when I run my app, it crashes with the following error:
dyld: Library not loaded: #loader_path/../Frameworks/PlausibleDatabase.framework/Versions/A/PlausibleDatabase
Referenced from: /Users/todd/Library/Application Support/iPhone Simulator/User/Applications/BB3C66B2-A5BB-4329-B163-AB0072411AF1/Congress.app/Congress
Reason: image not found
I'm not sure exactly where the Framework needs to reside on disk to be found.
Thanks
iPhone does not support dynamic linking of embedded frameworks. While you might be able to finagle the simulator to work, it will not work on the device. If you want to use the code you must build the static library for the framework (libpldatabase.a), and then link them to the app.
The Xcode GUI does not provide a nice interface for static linking, you will need to add appropriate flags in your build prefs (-lpldatabase -L/whatever/dir/it/is/in).
It's not actually strictly true that the iPhone doesn't support dynamic linking. What is true is that applications installed by the App Store are unable to dynamically link.
The app store / ituned installs programs into the /private/var/mobile/... directory. Any program opened that lives in that subdirectory is chrooted and has certain rights stripped away when opened. The chrooted processes can't fork, they can't run in the background, they can't load dynamic libraries and they can't save files outside of their little protected areas of the disk (with the exception of photos to the photo directory).
That said, the iPhone runs a modern operating system that supports dynamic linking just fine. The act of 'jailbreaking' is actually installing a program outside the chroot jail that can then do things like fork and save files to other places on the disk and load dynamic code.
Apple (and the open iPhone community) has plenty of programs running on the phone (such as the MobilePhone, Mobile Safari and SpringBoard applications) that can run in the background and load libraries. They are placed in a different place on the disk (/private/var/stash/Applications often).
So... if you want to sell your app in the app store, you can't load a dynamic library. Which for most people means you can't load it at all. But if you want to distribute your app through cydia (a common jailbroken phone app installer), then you can get away with jailbreaking the phone and loading your dynaamic library. In fact, due to the itunes install process being the culprit, as you've learned, you cant even load a dylib from your own app that you write to you own phone... unless you jailbreak.
RE #mipadi: ZeroLink was removed in Xcode 3.1 and does not exist for the iPhone SDK. The correct answer is Louis'; the iPhone does not support dynamically-loaded frameworks in developer-created applications.
Xcode does have a good user interface for static libraries; just drag them into the project and they're added to the link phase. No need to fuss with linker flags. The problem comes when you need to use the headers supplied with those static libs (then you need to add the header search paths manually) or when a static lib conflicts with an available dylib (that's when you have to add the -l flag manually).
Related
Is it possible to make an iOS application for enterprise distribution that updates itself transparently? Saying 'updates' I mean completely updating its logic.
A possible usage of this approach is a self-service kiosk (iPad) that is maintained remotelly.
It's not possible to update application binaries directly, but I see some possibilities:
Application that have a single UIWebView and the logic is implemented in HTML5. But we can't use most of hardware specific features that can be used in native applications.
Some multi-platform framework (possibly HTML5-based) that allows to use native application features and that is compiled or interpreted dynamically.
Jailbreak?
What are really working approaches of these?
Consider getting a mobile device management service. Those are pricey.
OR:
First, enable over-the-air distribution. It will take $300/year enterprise agreement with Apple. Set up a website with the app's IPA archive and descriptive PLIST.
Then code a call-home HTTP request on app startup. You may pull/parse the same PLIST that describes the latest version; it has a bundle version in it. Compare that to the version of the currently running bundle.
When a new version is detected, the app shuts down, opens the browser on the download page. In a softer manner, just notifies the user that an upgrade is available.
I've never tried linking directly to the app's download package, but give it a try. In a perfect world, Safari would open up and ask "Do you want do download MyApp?" right away. In a not so perfect world, the user would have to click a link and then agree to download.
I think what you are looking for these days is the "Apple Deployment Program".
You volume purchase iPads which get sent to people, but that you can manage remotely - which also means management including remote updates of applications.
The only thing I'm not sure of is if you can launch an app remotely, so that you could update and re-launch an application.
Here's a guide to enrolling devices for remote management:
https://www.apple.com/business/docs/DEP_Guide.pdf
An old but good summary of the program:
http://www.speirs.org/blog/2014/2/27/understanding-apples-new-deployment-programs
Also watch the WWDC video on Managing Apple Devices for the Enterprise:
https://developer.apple.com/videos/wwdc/2015/?id=301
I want to know how to deploy test app on iPhone 4.3.2. with XCode 4.3 but without buying a licence.
I have jailbreak on it and installed AppSync4.0+
The reason why I ask this is because I am porting an app from Qt and I want to see it how it behaves under iOS.
I have been using Qt4iOS and got everything build when using simulator.
Now I want to see it on my device.
When I try it I got some key chain error.
Provide me with some links or ideas.
... everything is possible. It's about the effort needed. And the effort for this can be very low. Especially because your device is are already jailbroken.
You'll need to change Xcode's code signing for building for an device. Instructions can be found here: http://iphonedevwiki.net/index.php/Xcode#Developing_without_Provisioning_Profile
(better save copies of the original files). Since Xcode 4.3 doesn't use the /Developer folder any more you'll have to edit the files inside the Xcode.app (./Xcode.app/Contents/Developer/...)
Build your app for the device. Make sure the target isn't a fat binary (instead just build an ARMv6 executable) or it won't work on your device if pseudo-signed with ldid.
Find the .app bundle for your app
Copy the .app bundle to /Applications/ (not /var/mobile/Applications!!!) (for example via ssh). Make sure the permissions of your executable are set to 755. Reboot or respring and if you did everything correctly you'll be able to launch and test your app.
Have fun!
I have had the same issue.
No matter how hard we try to apply any trick in order to test the app on real device without license, the bottom line is that you can't do it.
You must register with apple by paying $99 and thereafter you can set the device to your real device within XCode before running the app.
Note that it's quite a task to create *.api file even after you are registered with Apple.
Simple: Spend $99 for the iOS developer program.
I'm sure it is much more expensive to waste your time trying to find another way around.
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.
The keyword here is possible. I know of a few resources that talk about this and how to create static frameworks - here: https://github.com/kstenerud/iOS-Universal-Framework and here: http://db-in.com/blog/2011/07/universal-framework-iphone-ios-2-0/
I'm interested to see if it's possible to create a dynamically linked framework in an app that will not be submitted to the app store. I know it's impossible to write to the application bundle on a device without jailbreaking it. Is it possible to say, download a compiled framework file, put it in the documents directory and then access it via the application (think plug-in architecture). I know that if it is, you would be turned away from the app store for submitting it, but let's say this was an enterprise app, or an ad-hoc distributed app where Apple would not have to approve.
In my initial research I haven't found anything supporting that it is possible, but I feel like this may be such a fringe case that no one has published anything about it. Looking for a guru to give me a definite "no" before I give up.
not sure if this is what you are after but according to Apple there dynamically linked libraries even usable in iOS - for example the system libraries... XCode contains copies of them and references them via symbolic links...
see near the end of this http://developer.apple.com/library/ios/#documentation/Miscellaneous/Conceptual/iPhoneOSTechOverview/iPhoneOSFrameworks/iPhoneOSFrameworks.html#//apple_ref/doc/uid/TP40007898-CH6-SW3
just an idea:
put the .dylib + include files you want to use into the respective folders where XCode expects the system libraries... use themn and then put symlinks into your bundle on deployment... let the symlinks point where ou copy the .dylib
I believe the answer is no. Apps on the iPhone are sandboxed. That is, aside from Apple supplied frameworks, an app cannot access anything outside of its own build.
This is possible now with IOS 8 Xcode 6.
I want to use the ffmpeg library (and maybe others) in my iPhone App.
But I have absolutly no idea how I can use the files that are in the downloaded zip, and get them to work in my XCode project.
I read something about .a files and frameworks. Maybe you can give me a description how to implement it?
1st, you're not allowed to do anything with open-source on apple market : basically, any open-source library tainting your code (thus GPL, but also LGPL as dynamic linking is forbidden) will have your application removed if spotted. The VLC case (removed from app store) proved that GPL is not compatible for app store license (look for app store and gpl and google and you'll find hundreds of links)
Second, you have to transform the code you received (say source code) into a static library (a .a file). To do that, you need to compile it, here you have basically 3 solutions:
put all the files into your xcode project and tweak until it works (thus not creating static library, directly merging the code with yours) : this seems the easiest, but will be a nightmare in terms of maintenance (each time you'll want to upgrade the statuc lib)
compile externally, by hacking the makefile to use the correct compiler (the one in for ios, in iphone platform folder)
add a subproject in your xcode project to compile the library
My advice goes for 2 (that's what I do with boost) but it's not a straight path
EDIT : don't forget that software video decoding will drain your battery and you might have poor performance