如何将iPhone应用程序从Xcode部署到真正的iPhone设备上?

时间:2020-11-28 20:51:44

How can I deploy an iPhone application from Xcode to real iPhone device without having a US$99 Apple certificate?

如何在没有99美元的苹果证书的情况下将iPhone应用程序从Xcode部署到真正的iPhone设备?

12 个解决方案

#1


56  

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

听起来应用程序没有签名。从Cydia下载ldid,然后像这样使用:ldid -S / application /AccelerometerGraph.app/AccelerometerGraph

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

还要确保二进制代码被标记为可执行的:chmod +x /Applications/AccelerometerGraph.app/AccelerometerGraph

#2


91  

I've used a mix of two howtos: Jason's and alex's. With the second we have the advantage of being able to debug. I'll mostly just copy both below (and simplify alex's):

我用了两种方法:詹森和亚历克斯的。有了第二个,我们就有了能够调试的优势。我将主要复制以下两种(并简化alex的):

Update Jan 2012: this still works on SDK 4.2.1 and iOS 5.0.1 - I've just tested it all on a new computer and device!

2012年1月更新:这仍然适用于SDK 4.2.1和iOS 5.0.1——我刚刚在一台新的电脑和设备上测试了它!


1. Create Self-Signed Certificate

Patch your iPhone SDK to allow the use of this certificate:

为您的iPhone SDK安装补丁,以允许使用此证书:

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

    密钥链Access.app发射。在没有选择项的情况下,从Keychain菜单中选择Certificate Assistant,然后创建一个证书。

    • Name: iPhone Developer
    • 名称:iPhone开发者
    • Certificate Type: Code Signing
    • 证书类型:代码签名
    • Let me override defaults: Yes
    • 让我重写默认值:是的
  2. Click Continue

    点击继续

    • Validity: 3650 days
    • 有效期:3650天
  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.

    您应该看到“这个根证书不受信任”。这是预期。

  6. Set the iPhone SDK to allow the self-signed certificate to be used:

    设置iPhone SDK,允许使用自签名证书:

    sudo /usr/bin/sed -i .bak 's/XCiPhoneOSCodeSignContext/XCCodeSignContext/' /Developer/Platforms/iPhoneOS.platform/Info.plist
    

    If you have Xcode open, restart it for this change to take effect.

    如果您打开了Xcode,那么重新启动它,使此更改生效。

And if you're on iOS 5, that's it! Try it now! It may not allow debugging, but the app will be there!

如果你用的是iOS 5,那就对了!现在就试一试!它可能不允许调试,但是应用程序会在那里!

I was very surprised by this because, as you should know, I've got no idea on what all those hackings are all about! All I did was improving a little bit what I found elsewhere, as I pointed.

我对此感到非常惊讶,因为,你应该知道,我不知道这些废话到底是怎么回事!我所做的只是改善了我在别处发现的一些东西。

So yeah, the whole method doesn't work the same way anymore and I couldn't bother to find a new one... Except for this, which uses a tool called Theos but I couldn't go through the whole process.

所以,是的,整个方法不再像以前那样工作了,我也找不到新的方法了……除了这个,它使用了一个叫做Theos的工具但是我无法完成整个过程。

Finally, if you need to uninstall it for whatever reason, check the end of this post. In my case, I had to because I couldn't figure out why all of the blue this whole method stopped working, and I couldn't care anymore since we've already got the long waited license. (Freaking DUNS number takes so long...)

最后,如果出于某种原因需要卸载,请查看本文的末尾。在我的例子中,我不得不这样做,因为我无法弄清楚为什么所有的蓝色部分都停止工作,我也不能再关心了,因为我们已经有了长时间等待的许可证。(该死的DUNS数太长了……)

.

.


.

.

.

2. Enable Xcode's to Build on Jailbroken Device

  1. On your jailbroken iPhone, install the app AppSync by adding source http://cydia.hackulo.us

    在破解后的iPhone上,通过添加源代码http://cydia.hackulo.us安装应用程序AppSync

  2. Remove SDK requirements for code sign and entitlements (I'm loving sed!):

    移除SDK要求的代码签名和权利(我爱sed!)

    sudo /usr/bin/sed -i .bak '/_REQUIRED/N;s/YES/NO/' /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/SDKSettings.plist
    
  3. Pay attention to the iPhoneOS5.0.sdk part. If you're, for instance, using iOS 4.2 SDK, just replace it accordingly:

    注意iPhoneOS5.0。sdk的部分。例如,如果你正在使用ios4.2 SDK,只需相应地替换它:

    sudo /usr/bin/sed -i .bak '/_REQUIRED/N;s/YES/NO/' /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/SDKSettings.plist
    
  4. Conclude the requirement removal through patching Xcode. This means binary editing:

    通过Xcode补丁来完成需求的去除。这意味着二进制编辑:

    cd /Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Plug-ins/iPhoneOS\ Build\ System\ Support.xcplugin/Contents/MacOS/
    dd if=iPhoneOS\ Build\ System\ Support of=working bs=500 count=255
    printf "\xc3\x26\x00\x00" >> working
    /bin/mv -n iPhoneOS\ Build\ System\ Support iPhoneOS\ Build\ System\ Support.original
    /bin/mv working iPhoneOS\ Build\ System\ Support
    chmod a+x iPhoneOS\ Build\ System\ Support
    

    If you have Xcode open, restart it for this change (and last one) to take effect.

    如果您打开了Xcode,那么重新启动它,使这个更改(以及最后一个更改)生效。

  5. Open "Project>Edit Project Settings" (from the menu). Click on the "Build" tab. Find "Code Signing Identity" and its child "Any iPhoneOS Device" in the list, and set both to the entry "Don't Code Sign":

    打开“项目>编辑项目设置”(从菜单中)。单击“构建”选项卡。在列表中找到“代码签名标识”及其子“任何iPhoneOS设备”,并将其设置为“不要代码签名”:

    如何将iPhone应用程序从Xcode部署到真正的iPhone设备上?

    After this feel free to undo step 3. At least in my case it went just fine.

    在此之后,请随意撤消第3步。至少在我的情况下,这是很正常的。

  6. Setting Xcode to code sign with our custom made self-signed certificate (the first how-to). This step can probably be skipped if you don't want to be able to debug:

    将Xcode设置为使用自签名证书(第一个操作)的代码签名。如果您不想要调试,可以跳过这个步骤:

    mkdir /Developer/iphoneentitlements401
    cd /Developer/iphoneentitlements401
    curl -O http://www.alexwhittemore.com/iphone/gen_entitlements.txt
    mv gen_entitlements.txt gen_entitlements.py
    chmod 777 gen_entitlements.py
    

    Plug your iPhone in and open Xcode. Open Window>Organizer. Select the device from the list on the left hand side, and click "Use for development." You'll be prompted for a provisioning website login, click cancel. It's there to make legitimate provisioning easier, but doesn't make illegitimate not-provisioning more difficult.

    插上iPhone,打开Xcode。敞开的窗户>组织者。从左边的列表中选择设备,点击“用于开发”。您将被提示设置网站登录,单击“取消”。这样做是为了让合理的供应变得更容易,但不会让不合法的非供应变得更困难。

    Now You have to do this last part for every new project you make. Go to the menu Project > New Build Phase > New Run Script Build Phase. In the window, copy/paste this:

    现在你必须为每一个新项目做最后一部分。转到菜单项目>新构建阶段>新运行脚本构建阶段。在窗口中,复制/粘贴以下内容:

    export CODESIGN_ALLOCATE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate
    if [ "${PLATFORM_NAME}" == "iphoneos" ]; then
    /Developer/iphoneentitlements401/gen_entitlements.py "my.company.${PROJECT_NAME}" "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${PROJECT_NAME}.xcent";
    codesign -f -s "iPhone Developer" --entitlements "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${PROJECT_NAME}.xcent" "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/"
    fi
    

.

.


.

.

Uninstalling

For the 1st part:

第1部分:

sudo mv -f /Developer/Platforms/iPhoneOS.platform/Info.plist.bak /Developer/Platforms/iPhoneOS.platform/Info.plist

For the 2nd part:

第二部分:

sudo mv -f /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/SDKSettings.plist.bak /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/SDKSettings.plist
sudo mv -f iPhoneOS\ Build\ System\ Support.original iPhoneOS\ Build\ System\ Support

in case you did do the step 3 instead of 2, simply modify it accordingly as well:

如果你做的是步骤3而不是2,你也可以相应地修改它:

sudo mv -f /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/SDKSettings.plist.bak /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/SDKSettings.plist

for the rest, is just reverting what you did on XCode and deleting /Developer/iphoneentitlements401/gen_entitlements.py if you want:

剩下的部分,就是恢复您在XCode上所做的,删除/开发人员/iphone的权利。py如果你想:

sudo rm -f /Developer/iphoneentitlements401/gen_entitlements.py

#3


41  

Free Provisioning after Xcode 7

In order to test your app on a real device rather than pay the Apple Developer fee (or jailbreak your device), you can use the new free provisioning that Xcode 7 and iOS 9 supports.

为了在真正的设备上测试你的应用程序,而不是支付Apple Developer fee(或者越狱你的设备),你可以使用Xcode 7和ios9支持的新的免费配置。

Here are the steps taken more or less from the documentation (which is pretty good, so give it a read):

以下是一些从文档中获取或多或少的步骤(这很好,所以请阅读):

1. Add your Apple ID in Xcode

1。在Xcode中添加苹果ID。

Go to XCode > Preferences > Accounts tab > Add button (+) > Add Apple ID. See the docs for more help.

进入XCode >偏好>帐户选项卡> Add按钮(+)>添加Apple ID,更多帮助见文档。

如何将iPhone应用程序从Xcode部署到真正的iPhone设备上?

2. Click the General tab in the Project Navigator

2。单击Project Navigator中的General选项卡

如何将iPhone应用程序从Xcode部署到真正的iPhone设备上?

3. Choose your Apple ID from the Team popup menu.

3所示。从团队弹出菜单中选择您的苹果ID。

如何将iPhone应用程序从Xcode部署到真正的iPhone设备上?

4. Connect your device and choose it in the scheme menu.

4所示。连接您的设备并在scheme菜单中选择它。

如何将iPhone应用程序从Xcode部署到真正的iPhone设备上?

5. Click the Fix Issues button

5。单击Fix Issues按钮

如何将iPhone应用程序从Xcode部署到真正的iPhone设备上?

If you get an error about the bundle name being invalid, change it to something unique.

如果您在包名称上有错误,请将其更改为唯一的。

6. Run your app

6。运行您的应用程序

In Xcode, click the Build and run button.

在Xcode中,单击Build和run按钮。

如何将iPhone应用程序从Xcode部署到真正的iPhone设备上?

7. Trust the app developer in the device settings

7所示。在设备设置中信任应用程序开发人员

After running your app, you will get a security error because the app you want to run is not from the App Store.

运行你的应用程序后,你会得到一个安全错误,因为你想运行的应用程序不是来自应用程序商店。

如何将iPhone应用程序从Xcode部署到真正的iPhone设备上?

On your device, go to Settings > General > Profile > your-Apple-ID-name > Trust your-Apple-ID-name > Trust.

在你的设备上,进入设置>一般>配置>你的-苹果- id -name >信任你的-苹果- id -name >信任。

8. Run your app on your device again.

8。再次在你的设备上运行你的应用程序。

That's it. You can now run your own (or any other apps that you have the source code for) without having to dish out the $99 dollars. Thank you, Apple, for finally allowing this.

就是这样。你现在可以运行自己的(或任何其他你有源代码的应用程序),而不必花费99美元。谢谢你,苹果,终于允许了。

#4


9  

You'll have to jailbreak your device.

你得把你的设备越狱。

#5


9  

You can't, not if you are talking about applications built with the official SDK and deploying straight from xcode.

如果您正在讨论使用官方SDK构建并直接从xcode部署的应用程序,则不能这样做。

#6


6  

There is a way to deploy iPhone apps without paying to apple You'll have to jailbreak your device and follow the instructions in http://www.alexwhittemore.com/?p=398

有一种方法可以在不向苹果付费的情况下部署iPhone应用程序,你必须破解你的设备,并遵循http://www.alexwhittemore.com/?

#7


5  

Nothing I've seen anywhere indicates you can ad-hoc deploy to a real iPhone without a (paid for) certificate.

我在任何地方都没有看到任何东西表明,您可以在没有(付费)证书的情况下,临时部署到真正的iPhone上。

#8


4  

I was going through the Apple Developer last night and there in the Provisioning Certificate I found something like - "Signing Team Members". I think there is a way to add team members to the paid profile. You can just ask to the App Id Owner(paid one) to add you as a team member. I am not sure. Still searching on that.

昨晚我浏览了一下苹果的开发人员,在配置证书中我发现了一些东西——“签名团队成员”。我认为有一种方法可以将团队成员添加到付费配置文件中。你可以要求应用Id所有者(付费用户)将你添加为团队成员。我不确定。仍然搜索。

#9


3  

No, its easy to do this. In Xcode, set the Active Configuration to Release. Change the device from Simulator to Device - whatever SDK. If you want to directly export to your iPhone, connect it to your computer. Press Build and Go. If your iPhone is not connected to your computer, a message will come up saying that your iPhone is not connected.

不,这样做很容易。在Xcode中,将活动配置设置为Release。将设备从模拟器更改为设备——无论SDK是什么。如果你想直接导出到你的iPhone,把它连接到你的电脑。媒体构建和走。如果你的iPhone没有连接到你的电脑上,会出现一条消息说你的iPhone没有连接。

If this applies to you: (iPhone was not connected)

如果这适用于你:(iPhone没有连接)

Go to your projects folder and then to the build folder inside. Go to the Release-iphoneos folder and take the app inside, drag and drop on iTunes icon. When you sync your iTouch device, it will copy it to your device. It will also show up in iTunes as a application for the iPhone.

转到projects文件夹,然后转到build文件夹。进入发布-iphoneos文件夹,将应用程序放在里面,拖拽iTunes图标。当你同步你的iTouch设备时,它会把它拷贝到你的设备上。它也会出现在iTunes上,作为iPhone的应用程序。

Hope this helps!

希望这可以帮助!

P.S.: If it says something about a certificate not being valid, just click on the project in Xcode, the little project icon in the file stack to the left, and press Apple+I, or do Get Info from the menu bar. Click on Build at the top. Under Code Signing, change Code Signing Identity - Any iPhone OS Device to be Don't Sign.

注::如果它说某个证书不有效,只需点击Xcode中的项目,左边文件栈中的小项目图标,然后按Apple+I,或者从菜单栏中获取信息。单击顶部的Build。在代码签名下,更改代码签名标识——任何iPhone OS设备都不能签名。

#10


2  

This really all depends on what version of Xcode you are using as different versions use different methods to deploy to your iPhone without a provisioning profile.

这完全取决于您使用的Xcode的版本,因为不同的版本使用不同的方法部署到您的iPhone上,而无需配置配置文件。

Xcode 3.2.1 is a good version and is easy to sort out, but we need to know what version you are using.

Xcode 3.2.1是一个很好的版本,很容易分类,但是我们需要知道您使用的是什么版本。

#11


2  

Solution posted by Cawas works perfectly with XCode4, too. However, there are some changes to IDE's UI, so you need to make some research to find Run Script :)

Cawas发布的解决方案在XCode4中也非常有效。但是,IDE的UI有一些变化,所以您需要做一些研究来找到Run脚本:)

In the Project Navigator view click the root item of the project, then in the middle window select Target, then click Build Phases tab and at the bottom you'll see Add Build Phase button, click and select Add Run Script, then paste "codesign" script posted by Cawas.

在Project Navigator视图中单击项目的根项目,然后在中间窗口select Target,然后单击Build Phase选项卡,在底部您将看到Add Build Phase按钮,单击并选择Add Run Script,然后粘贴Cawas发布的“codesign”脚本。

#12


1  

There is no workaround. You can only ad hoc deploy apps if they are registered with your device. This prevents you from building your own app store..

没有解决方法。只有在你的设备上注册了应用程序,你才能临时部署应用程序。这阻止你建立自己的应用程序商店。

#1


56  

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

听起来应用程序没有签名。从Cydia下载ldid,然后像这样使用:ldid -S / application /AccelerometerGraph.app/AccelerometerGraph

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

还要确保二进制代码被标记为可执行的:chmod +x /Applications/AccelerometerGraph.app/AccelerometerGraph

#2


91  

I've used a mix of two howtos: Jason's and alex's. With the second we have the advantage of being able to debug. I'll mostly just copy both below (and simplify alex's):

我用了两种方法:詹森和亚历克斯的。有了第二个,我们就有了能够调试的优势。我将主要复制以下两种(并简化alex的):

Update Jan 2012: this still works on SDK 4.2.1 and iOS 5.0.1 - I've just tested it all on a new computer and device!

2012年1月更新:这仍然适用于SDK 4.2.1和iOS 5.0.1——我刚刚在一台新的电脑和设备上测试了它!


1. Create Self-Signed Certificate

Patch your iPhone SDK to allow the use of this certificate:

为您的iPhone SDK安装补丁,以允许使用此证书:

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

    密钥链Access.app发射。在没有选择项的情况下,从Keychain菜单中选择Certificate Assistant,然后创建一个证书。

    • Name: iPhone Developer
    • 名称:iPhone开发者
    • Certificate Type: Code Signing
    • 证书类型:代码签名
    • Let me override defaults: Yes
    • 让我重写默认值:是的
  2. Click Continue

    点击继续

    • Validity: 3650 days
    • 有效期:3650天
  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.

    您应该看到“这个根证书不受信任”。这是预期。

  6. Set the iPhone SDK to allow the self-signed certificate to be used:

    设置iPhone SDK,允许使用自签名证书:

    sudo /usr/bin/sed -i .bak 's/XCiPhoneOSCodeSignContext/XCCodeSignContext/' /Developer/Platforms/iPhoneOS.platform/Info.plist
    

    If you have Xcode open, restart it for this change to take effect.

    如果您打开了Xcode,那么重新启动它,使此更改生效。

And if you're on iOS 5, that's it! Try it now! It may not allow debugging, but the app will be there!

如果你用的是iOS 5,那就对了!现在就试一试!它可能不允许调试,但是应用程序会在那里!

I was very surprised by this because, as you should know, I've got no idea on what all those hackings are all about! All I did was improving a little bit what I found elsewhere, as I pointed.

我对此感到非常惊讶,因为,你应该知道,我不知道这些废话到底是怎么回事!我所做的只是改善了我在别处发现的一些东西。

So yeah, the whole method doesn't work the same way anymore and I couldn't bother to find a new one... Except for this, which uses a tool called Theos but I couldn't go through the whole process.

所以,是的,整个方法不再像以前那样工作了,我也找不到新的方法了……除了这个,它使用了一个叫做Theos的工具但是我无法完成整个过程。

Finally, if you need to uninstall it for whatever reason, check the end of this post. In my case, I had to because I couldn't figure out why all of the blue this whole method stopped working, and I couldn't care anymore since we've already got the long waited license. (Freaking DUNS number takes so long...)

最后,如果出于某种原因需要卸载,请查看本文的末尾。在我的例子中,我不得不这样做,因为我无法弄清楚为什么所有的蓝色部分都停止工作,我也不能再关心了,因为我们已经有了长时间等待的许可证。(该死的DUNS数太长了……)

.

.


.

.

.

2. Enable Xcode's to Build on Jailbroken Device

  1. On your jailbroken iPhone, install the app AppSync by adding source http://cydia.hackulo.us

    在破解后的iPhone上,通过添加源代码http://cydia.hackulo.us安装应用程序AppSync

  2. Remove SDK requirements for code sign and entitlements (I'm loving sed!):

    移除SDK要求的代码签名和权利(我爱sed!)

    sudo /usr/bin/sed -i .bak '/_REQUIRED/N;s/YES/NO/' /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/SDKSettings.plist
    
  3. Pay attention to the iPhoneOS5.0.sdk part. If you're, for instance, using iOS 4.2 SDK, just replace it accordingly:

    注意iPhoneOS5.0。sdk的部分。例如,如果你正在使用ios4.2 SDK,只需相应地替换它:

    sudo /usr/bin/sed -i .bak '/_REQUIRED/N;s/YES/NO/' /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/SDKSettings.plist
    
  4. Conclude the requirement removal through patching Xcode. This means binary editing:

    通过Xcode补丁来完成需求的去除。这意味着二进制编辑:

    cd /Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Plug-ins/iPhoneOS\ Build\ System\ Support.xcplugin/Contents/MacOS/
    dd if=iPhoneOS\ Build\ System\ Support of=working bs=500 count=255
    printf "\xc3\x26\x00\x00" >> working
    /bin/mv -n iPhoneOS\ Build\ System\ Support iPhoneOS\ Build\ System\ Support.original
    /bin/mv working iPhoneOS\ Build\ System\ Support
    chmod a+x iPhoneOS\ Build\ System\ Support
    

    If you have Xcode open, restart it for this change (and last one) to take effect.

    如果您打开了Xcode,那么重新启动它,使这个更改(以及最后一个更改)生效。

  5. Open "Project>Edit Project Settings" (from the menu). Click on the "Build" tab. Find "Code Signing Identity" and its child "Any iPhoneOS Device" in the list, and set both to the entry "Don't Code Sign":

    打开“项目>编辑项目设置”(从菜单中)。单击“构建”选项卡。在列表中找到“代码签名标识”及其子“任何iPhoneOS设备”,并将其设置为“不要代码签名”:

    如何将iPhone应用程序从Xcode部署到真正的iPhone设备上?

    After this feel free to undo step 3. At least in my case it went just fine.

    在此之后,请随意撤消第3步。至少在我的情况下,这是很正常的。

  6. Setting Xcode to code sign with our custom made self-signed certificate (the first how-to). This step can probably be skipped if you don't want to be able to debug:

    将Xcode设置为使用自签名证书(第一个操作)的代码签名。如果您不想要调试,可以跳过这个步骤:

    mkdir /Developer/iphoneentitlements401
    cd /Developer/iphoneentitlements401
    curl -O http://www.alexwhittemore.com/iphone/gen_entitlements.txt
    mv gen_entitlements.txt gen_entitlements.py
    chmod 777 gen_entitlements.py
    

    Plug your iPhone in and open Xcode. Open Window>Organizer. Select the device from the list on the left hand side, and click "Use for development." You'll be prompted for a provisioning website login, click cancel. It's there to make legitimate provisioning easier, but doesn't make illegitimate not-provisioning more difficult.

    插上iPhone,打开Xcode。敞开的窗户>组织者。从左边的列表中选择设备,点击“用于开发”。您将被提示设置网站登录,单击“取消”。这样做是为了让合理的供应变得更容易,但不会让不合法的非供应变得更困难。

    Now You have to do this last part for every new project you make. Go to the menu Project > New Build Phase > New Run Script Build Phase. In the window, copy/paste this:

    现在你必须为每一个新项目做最后一部分。转到菜单项目>新构建阶段>新运行脚本构建阶段。在窗口中,复制/粘贴以下内容:

    export CODESIGN_ALLOCATE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate
    if [ "${PLATFORM_NAME}" == "iphoneos" ]; then
    /Developer/iphoneentitlements401/gen_entitlements.py "my.company.${PROJECT_NAME}" "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${PROJECT_NAME}.xcent";
    codesign -f -s "iPhone Developer" --entitlements "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${PROJECT_NAME}.xcent" "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/"
    fi
    

.

.


.

.

Uninstalling

For the 1st part:

第1部分:

sudo mv -f /Developer/Platforms/iPhoneOS.platform/Info.plist.bak /Developer/Platforms/iPhoneOS.platform/Info.plist

For the 2nd part:

第二部分:

sudo mv -f /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/SDKSettings.plist.bak /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/SDKSettings.plist
sudo mv -f iPhoneOS\ Build\ System\ Support.original iPhoneOS\ Build\ System\ Support

in case you did do the step 3 instead of 2, simply modify it accordingly as well:

如果你做的是步骤3而不是2,你也可以相应地修改它:

sudo mv -f /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/SDKSettings.plist.bak /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/SDKSettings.plist

for the rest, is just reverting what you did on XCode and deleting /Developer/iphoneentitlements401/gen_entitlements.py if you want:

剩下的部分,就是恢复您在XCode上所做的,删除/开发人员/iphone的权利。py如果你想:

sudo rm -f /Developer/iphoneentitlements401/gen_entitlements.py

#3


41  

Free Provisioning after Xcode 7

In order to test your app on a real device rather than pay the Apple Developer fee (or jailbreak your device), you can use the new free provisioning that Xcode 7 and iOS 9 supports.

为了在真正的设备上测试你的应用程序,而不是支付Apple Developer fee(或者越狱你的设备),你可以使用Xcode 7和ios9支持的新的免费配置。

Here are the steps taken more or less from the documentation (which is pretty good, so give it a read):

以下是一些从文档中获取或多或少的步骤(这很好,所以请阅读):

1. Add your Apple ID in Xcode

1。在Xcode中添加苹果ID。

Go to XCode > Preferences > Accounts tab > Add button (+) > Add Apple ID. See the docs for more help.

进入XCode >偏好>帐户选项卡> Add按钮(+)>添加Apple ID,更多帮助见文档。

如何将iPhone应用程序从Xcode部署到真正的iPhone设备上?

2. Click the General tab in the Project Navigator

2。单击Project Navigator中的General选项卡

如何将iPhone应用程序从Xcode部署到真正的iPhone设备上?

3. Choose your Apple ID from the Team popup menu.

3所示。从团队弹出菜单中选择您的苹果ID。

如何将iPhone应用程序从Xcode部署到真正的iPhone设备上?

4. Connect your device and choose it in the scheme menu.

4所示。连接您的设备并在scheme菜单中选择它。

如何将iPhone应用程序从Xcode部署到真正的iPhone设备上?

5. Click the Fix Issues button

5。单击Fix Issues按钮

如何将iPhone应用程序从Xcode部署到真正的iPhone设备上?

If you get an error about the bundle name being invalid, change it to something unique.

如果您在包名称上有错误,请将其更改为唯一的。

6. Run your app

6。运行您的应用程序

In Xcode, click the Build and run button.

在Xcode中,单击Build和run按钮。

如何将iPhone应用程序从Xcode部署到真正的iPhone设备上?

7. Trust the app developer in the device settings

7所示。在设备设置中信任应用程序开发人员

After running your app, you will get a security error because the app you want to run is not from the App Store.

运行你的应用程序后,你会得到一个安全错误,因为你想运行的应用程序不是来自应用程序商店。

如何将iPhone应用程序从Xcode部署到真正的iPhone设备上?

On your device, go to Settings > General > Profile > your-Apple-ID-name > Trust your-Apple-ID-name > Trust.

在你的设备上,进入设置>一般>配置>你的-苹果- id -name >信任你的-苹果- id -name >信任。

8. Run your app on your device again.

8。再次在你的设备上运行你的应用程序。

That's it. You can now run your own (or any other apps that you have the source code for) without having to dish out the $99 dollars. Thank you, Apple, for finally allowing this.

就是这样。你现在可以运行自己的(或任何其他你有源代码的应用程序),而不必花费99美元。谢谢你,苹果,终于允许了。

#4


9  

You'll have to jailbreak your device.

你得把你的设备越狱。

#5


9  

You can't, not if you are talking about applications built with the official SDK and deploying straight from xcode.

如果您正在讨论使用官方SDK构建并直接从xcode部署的应用程序,则不能这样做。

#6


6  

There is a way to deploy iPhone apps without paying to apple You'll have to jailbreak your device and follow the instructions in http://www.alexwhittemore.com/?p=398

有一种方法可以在不向苹果付费的情况下部署iPhone应用程序,你必须破解你的设备,并遵循http://www.alexwhittemore.com/?

#7


5  

Nothing I've seen anywhere indicates you can ad-hoc deploy to a real iPhone without a (paid for) certificate.

我在任何地方都没有看到任何东西表明,您可以在没有(付费)证书的情况下,临时部署到真正的iPhone上。

#8


4  

I was going through the Apple Developer last night and there in the Provisioning Certificate I found something like - "Signing Team Members". I think there is a way to add team members to the paid profile. You can just ask to the App Id Owner(paid one) to add you as a team member. I am not sure. Still searching on that.

昨晚我浏览了一下苹果的开发人员,在配置证书中我发现了一些东西——“签名团队成员”。我认为有一种方法可以将团队成员添加到付费配置文件中。你可以要求应用Id所有者(付费用户)将你添加为团队成员。我不确定。仍然搜索。

#9


3  

No, its easy to do this. In Xcode, set the Active Configuration to Release. Change the device from Simulator to Device - whatever SDK. If you want to directly export to your iPhone, connect it to your computer. Press Build and Go. If your iPhone is not connected to your computer, a message will come up saying that your iPhone is not connected.

不,这样做很容易。在Xcode中,将活动配置设置为Release。将设备从模拟器更改为设备——无论SDK是什么。如果你想直接导出到你的iPhone,把它连接到你的电脑。媒体构建和走。如果你的iPhone没有连接到你的电脑上,会出现一条消息说你的iPhone没有连接。

If this applies to you: (iPhone was not connected)

如果这适用于你:(iPhone没有连接)

Go to your projects folder and then to the build folder inside. Go to the Release-iphoneos folder and take the app inside, drag and drop on iTunes icon. When you sync your iTouch device, it will copy it to your device. It will also show up in iTunes as a application for the iPhone.

转到projects文件夹,然后转到build文件夹。进入发布-iphoneos文件夹,将应用程序放在里面,拖拽iTunes图标。当你同步你的iTouch设备时,它会把它拷贝到你的设备上。它也会出现在iTunes上,作为iPhone的应用程序。

Hope this helps!

希望这可以帮助!

P.S.: If it says something about a certificate not being valid, just click on the project in Xcode, the little project icon in the file stack to the left, and press Apple+I, or do Get Info from the menu bar. Click on Build at the top. Under Code Signing, change Code Signing Identity - Any iPhone OS Device to be Don't Sign.

注::如果它说某个证书不有效,只需点击Xcode中的项目,左边文件栈中的小项目图标,然后按Apple+I,或者从菜单栏中获取信息。单击顶部的Build。在代码签名下,更改代码签名标识——任何iPhone OS设备都不能签名。

#10


2  

This really all depends on what version of Xcode you are using as different versions use different methods to deploy to your iPhone without a provisioning profile.

这完全取决于您使用的Xcode的版本,因为不同的版本使用不同的方法部署到您的iPhone上,而无需配置配置文件。

Xcode 3.2.1 is a good version and is easy to sort out, but we need to know what version you are using.

Xcode 3.2.1是一个很好的版本,很容易分类,但是我们需要知道您使用的是什么版本。

#11


2  

Solution posted by Cawas works perfectly with XCode4, too. However, there are some changes to IDE's UI, so you need to make some research to find Run Script :)

Cawas发布的解决方案在XCode4中也非常有效。但是,IDE的UI有一些变化,所以您需要做一些研究来找到Run脚本:)

In the Project Navigator view click the root item of the project, then in the middle window select Target, then click Build Phases tab and at the bottom you'll see Add Build Phase button, click and select Add Run Script, then paste "codesign" script posted by Cawas.

在Project Navigator视图中单击项目的根项目,然后在中间窗口select Target,然后单击Build Phase选项卡,在底部您将看到Add Build Phase按钮,单击并选择Add Run Script,然后粘贴Cawas发布的“codesign”脚本。

#12


1  

There is no workaround. You can only ad hoc deploy apps if they are registered with your device. This prevents you from building your own app store..

没有解决方法。只有在你的设备上注册了应用程序,你才能临时部署应用程序。这阻止你建立自己的应用程序商店。