如何以编程方式在越狱的iPhone上安装.deb文件? [英] How to install a .deb file on a jailbroken iphone programmatically?

查看:153
本文介绍了如何以编程方式在越狱的iPhone上安装.deb文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用Xcode为iPhone开发一个应用程序(越狱).现在,我想以编程方式安装.deb文件.我怎样才能做到这一点?我可以执行命令来安装它,但是如何?如果我在越狱的iPhone上通过Xcode安装应用程序就足够了吗? (.ipa)还是我需要创建一个.deb?如果是,怎么办?

I'm developing an app with Xcode for the iPhone (jailbroken). Now I want to install a .deb file programmatically. How can I do this? I could execute a command to install it, but how? Is it enough if I install my app via Xcode on my jailbroken iPhone? (.ipa) or do I need to create a .deb? If yes, how?

非常感谢!

祝你有美好的一天.

我制作了一个应用.在这个应用程序中,我有一个文件浏览器(仅适用于文档目录).在此目录中有.deb文件.现在,如果用户点击一个,我想以编程方式安装这些.deb文件.我该怎么办?

edit: I made a app. In this app I have a file browser (only for documents directory). In this directory there are .deb files. Now, I want to install these .deb files programmatically if the user taps on one. How do I go about this?

推荐答案

许多选项.

  1. 您可以学习Cydia的源代码.(官方网站提供源代码)
  2. 从Icy Github中学习源代码. https://github.com/ripdev/Icy

简单的方法,只需使用系统函数来调用dpkg命令.

The simple way, just use system function to invoke dpkg command.

NSString *appsyncDebPath=@"/var/root/appsync.deb";
    NSString *cmdString=[NSString stringWithFormat:@"/usr/bin/dpkg  -i %@ >/tmp/dpkg.log;",appsyncDebPath];
    const char  *cmdChar=[cmdString UTF8String];
    system(cmdChar);

您可能会显示/tmp/dpkg.log的结果

You may show result from /tmp/dpkg.log

这篇关于如何以编程方式在越狱的iPhone上安装.deb文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆