Get path to iOS application based on name or bundle identifier

前端 未结 3 636
猫巷女王i
猫巷女王i 2021-01-02 22:42

Is there an easier way to get the path to an iOS application, than searching /var/mobile/Applications?

I know both the name and the bundle identifier, h

3条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-02 22:49

    Or you can use the library AppList and then it's:

    ALApplicationList *al = [ALApplicationList sharedApplicationList];
    NSString *appPath = [al valueForKey:@"path" forDisplayIdentifier:bundleID];
    

    In this case it's doing what Andrew R. mentions in his answer for you. (I assume the same requirements are necessary, i.e. must be running from Springboard.)

    Update: This no longer seems to be working on iOS 11.

提交回复
热议问题