如何将我的 .app 文件从 xcode 的 builds 文件夹复制/运行到我的 iphone 上的 /Applications 文件夹? (越狱)

发布于 2024-10-26 05:08:57 字数 617 浏览 3 评论 0原文

所以我开发了一个应用程序。现在我手动将 .app 文件放入我的 iPhone(根目录)的 /Applications 文件夹中。比我做的:

听起来该应用程序不是 签署了。从 Cydia 下载 ldid 并 然后像这样使用它:ldid -S /Applications/AccelerometerGraph.app/AccelerometerGraph

还要确保二进制文件已标记 作为可执行文件:chmod +x /Applications/AccelerometerGraph.app/AccelerometerGraph

(via

比我使用 UICache 使应用程序可见。如果我运行它,它会显示黑屏 1/4 秒,然后关闭...(我不是 iphone 开发计划的成员)。

我有什么错吗?

有更好的办法吗?

非常感谢! :)

so I've developed an app. Now I manually placed the .app file into the /Applications folder of my iphone (root). Than I did:

It sounds like the application isn't
signed. Download ldid from Cydia and
then use it like so: ldid -S
/Applications/AccelerometerGraph.app/AccelerometerGraph

Also be sure that the binary is marked
as executable: chmod +x
/Applications/AccelerometerGraph.app/AccelerometerGraph

(via)

Than I used UICache to make the app visible. And if I run it it shows a black screen for a 1/4 second and then it closes...(I'm not a member of the iphone dev program).

Did I something wrong?

Is there a better way?

Thank you very much! :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

萌逼全场 2024-11-02 05:08:57

我刚刚度过了一个完美的周六下午,寻找完全相同问题的解决方案。这是一个代码签名问题。

这是我使用的 Xcode4iOS 4.3 SDK 。我正在构建一个运行 iOS 3.1.2(越狱)的 iphone 3G 的测试设备

注意:ldid 方法对我不起作用,并不断抛出以下错误(关于为什么它不起作用的一些详细信息我尝试通过xcode4使用armv6架构,但ldid仍然给出同样的错误):

codesign_allocate:对象:MyAppName.app/MyAppName 格式错误的对象(未知加载命令 4)
util/ldid.cpp(582): _assert(0:WEXITSTATUS(status) == 0)

这是对我有用的:

第 1 步:创建自签名证书

1-启动Keychain Access.app。在未选择任何项目的情况下,从“钥匙串”菜单中选择“证书助手”,然后选择“创建证书”。

姓名:iPhone 开发人员
证书类型:代码签名
让我覆盖默认值:是

2-点击“继续”

有效期:3650天

3-点击“继续”

4- 空白电子邮件地址字段。

5- 单击“继续”直至完成。

您应该看到“此根证书不受信任”。这是预期的结果。

via (注意:您不需要成为会员即使链接中接受的答案的标题可能表明这一点,iPhone 开发程序的功能也可以实现此目的)

第 2 步:设置 xCode 以允许使用自签名证书

您必须编辑 /Developer/Platforms/iPhoneOS.platform/Info.plist 下的 Info.plist 文件

(我已在不同位置安装了 xcode,因此我的路径是 xcode4/Platforms/iPhoneOS.platform/Info.plist)

1- 您将无法在当前位置编辑该文件,因此只需将其复制到桌面并在文本编辑器中打开即可。

2- 您需要将 XCiPhoneOSCodeSignContext 的所有实例替换为 XCCodeSignContext 并保存文件。

3-然后将编辑后的文件拖放到 iPhoneOS.platform 文件夹并替换旧文件。 (如果 xcode 正在运行,请确保它没有运行,然后重新启动它)

第 3 步:更改项目中的代码签名身份设置

将您的项目和目标的代码签名身份更改为 iPhone Developer

1- 在 xcode4 中,您必须选择您的项目(从左侧导航器面板)->从(项目)-> 中心的中心选择您的项目构建设置 ->代码签名(展开菜单)并将所有选项更改为 iPhone Developer

2- 在 xcode4 中,从屏幕中央的左侧面板中选择您的项目,您将看到项目和目标。现在选择目标并执行相同的操作:目标 ->构建设置 ->代码签名(展开菜单)并将所有选项更改为 iPhone Developer

第 4 步:构建应用程序并部署

1-确保在xcode顶部Scheme下的运行和停止按钮旁边,您选择了iOS设备(您的设备名称)而不是模拟器(这是在xcode4中完成的)

2- 打开“方案”菜单,然后选择“iOS 设备方案”,然后单击“编辑方案”。从左侧菜单中选择“运行”,然后在“信息”选项卡下将“构建配置”设置为“发布”

3-现在确保您已连接 iOS 设备并且已选择其方案并单击“运行”(注意:您会收到一些警告,但只要构建成功就可以了)

如果一切顺利,您应该能够在左侧的 Products 文件夹下看到 YourApp.app,现在选择 YourApp.app 在 Finder 中将其打开。您的应用程序应该位于名为 Release-iphoneos 的文件夹中,将其复制到 iOS 设备上的 /Applications 目录中,然后重新启动或 UICache 使其显示。 (注意:您现在不需要使用 ldid)

希望您的应用程序能够正常启动。我只在 xcode4 上尝试过这个,所以不确定它是否适用于旧版本。

I just spent a perfect Saturday afternoon looking for a solution to the exact same problem. It is a code signing problem.

Here is what I was using Xcode4 and iOS 4.3 SDK . I was building to a test device an iphone 3G running iOS 3.1.2 (jailbroken)

NOTE: ldid method did not work for me and kept on throwing the following error (Some Details on why its not working I tried using armv6 architecture through xcode4 but ldid still gave the same error):

codesign_allocate: object: MyAppName.app/MyAppName malformed object (unknown load command 4)
util/ldid.cpp(582): _assert(0:WEXITSTATUS(status) == 0)

Here is what worked for me:

Step 1. Create a Self Signed Certificate.

1- Launch Keychain Access.app. With no items selected, from the Keychain menu select Certificate Assistant, then Create a Certificate.

Name: iPhone Developer
Certificate Type: Code Signing
Let me override defaults: Yes

2- Click Continue

Validity: 3650 days

3- Click Continue

4- Blank out the Email address field.

5- Click Continue until complete.

You should see "This root certificate is not trusted". This is expected.

via (note: you dont need to be a member of the iphone dev program to make this work even though the title of the accepted answer in the link might suggest that)

Step 2. Set xCode to allow the self-signed certificate to be used

You have to edit the Info.plist file under /Developer/Platforms/iPhoneOS.platform/Info.plist

(I have installed xcode at a different location so that path for me was xcode4/Platforms/iPhoneOS.platform/Info.plist)

1- You will not be able to edit the file in its current location so just copy it to the desktop and open it in a text editor.

2- You need to Replace all instance of XCiPhoneOSCodeSignContext with XCCodeSignContext and save the file.

3- Then drag and drop the edited file back to iPhoneOS.platform folder and replace the old file. (Make sure xcode is not running if it is then restart it)

Step 3. Change the Code Signing Identity setting in your project

Change the code signing identity for your project and your target to iPhone Developer

1- In xcode4 you have to select your project (from the left navigator panel) -> Select you Project from the center under (PROJECTS) -> Build Settings -> Code Signing (expand the menu) and change all options to iPhone Developer

2- In xcode4 with your project selected from the left panel in the center of the screen you will see PROJECT and TARGETS. Now select the targets and do that same: Targets -> Build Settings -> Code Signing (expand the menu) and change all options to iPhone Developer

Step 4. Build the App and Deploy

1- Make Sure at the top of xcode next to the run and stop buttons under Scheme you have iOS Device (your device name) selected and NOT Simulator (this is how its done in xcode4)

2- Open the Scheme menu and with the iOS Device Scheme selected click edit scheme. Select Run from the left menu and under the Info tab set Build Configuration to Release

3- Now make sure you have your iOS device connected and its scheme is selected and hit Run (note: you will get some warnings but as along as the build succeeds you are okay)

if all goes well you should be able to see YourApp.app under the Products folder on the left side now select YourApp.app open it in Finder. Your app should be in a folder called Release-iphoneos Copy it to /Applications dir on your iOS device and respring or UICache to make it appear. (note: you dont need to use ldid now)

Hopefully your app will launch fine. I have only tried this with xcode4 so not sure if it will work for older versions.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文