Nina
Nina

Reputation: 1679

Path of the ios application on device

Well, I would just like to know is it possible to know the path of the app? I used the following code

[NSBundle mainBundle] executablePath];

It retrieved the below value. That is correct.

/var/mobile/Applications/FBE187F1-256D-495D-852B-53AECD4F4C23/Test_Data_Fetch.app

And I would like to know, is it possible to check the existence of other app? The problem is FBE187F1-256D-495D-852B-53AECD4F4C23 this particular directory value changes for every app. I would really like to know if it is possible!!

Upvotes: 1

Views: 166

Answers (2)

Nina
Nina

Reputation: 1679

Finally, using the Mac program iExplorer we can look at any App’s data. This is not related to my question, though it is quiet useful!! Was able to achieve my goal!! :]

Upvotes: 0

Vladimir
Vladimir

Reputation: 170839

Your application cannot access anything outside sandbox so you can't search file system directly for a given application.

One possible solution is if application you are interested in handles custom url scheme, then you can check if that url scheme can be opened:

NSURL *url = [NSURL URLWithString:customScheme];
BOOL appProbablyExists = [[UIApplication sharedApplication] canOpenURL:url];

Update: This article describes several possible approaches, but it seems there's no definite way to get list of installed applications using public API

Upvotes: 1

Related Questions