{"id":429,"date":"2009-02-17T22:53:48","date_gmt":"2009-02-17T22:53:48","guid":{"rendered":""},"modified":"2013-02-27T12:22:31","modified_gmt":"2013-02-27T04:22:31","slug":"429","status":"publish","type":"post","link":"https:\/\/1vr.cn\/?p=429","title":{"rendered":"Unity3D for iPhone\u4f7f\u7528\u5165\u95e8\u4e0eUnityRemote"},"content":{"rendered":"<p>\u6ce8:Google\u9875\u9762\u7ffb\u8bd1,\u975e\u4eba\u5de5.\u539f\u6587\u94fe\u63a5:<a href=\"http:\/\/www.unifycommunity.com\/wiki\/index.php?title=IPhone_Getting_Started_with_the_UnityRemote\" target=\"_blank\" rel=\"external\">http:\/\/www.unifycommunity.com\/wiki\/index.php?title=IPhone_Getting_Started_with_the_UnityRemote<\/a><\/p>\n<p>Unity3D for iPhone\u4f7f\u7528\u5165\u95e8\u4e0eUnityRemote<br \/>From Unify Community Wiki\u4ece\u7edf\u4e00\u793e\u533a\u7ef4\u57fa <br \/>Jump to: navigation , search\u8df3\u8f6c\u5230\uff1a \u5bfc\u822a \uff0c \u641c\u7d22 <br \/>This tutorial is still VERY rough but hopefully they will still be helpful in its current form.\u672c\u6559\u7a0b\u4ecd\u7136\u5341\u5206\u7c97\u7cd9\uff0c\u4f46\u5e0c\u671b\u4ed6\u4eec\u4ecd\u7136\u662f\u6709\u5e2e\u52a9\u7684\u73b0\u6709\u5f62\u5f0f\u3002 <\/p>\n<p>If you have a minute and know your way around wiki formatting, please feel free to beautify this page.\u5982\u679c\u4f60\u6709\u4e00\u5206\u949f\uff0c\u5e76\u4e14\u8ba4\u8bc6\u81ea\u5df1\u7684\u65b9\u5f0f\u89e3\u51b3\u7684wiki\u683c\u5f0f\uff0c\u8bf7\u968f\u65f6\u7f8e\u5316\u8fd9\u4e00\u9875\u3002 <\/p>\n<p>NOTE: I didn&#8217;t think to start writing this until after I was done registering, so if you are following this tutorial and you notice something that I missed, PLEASE help out by extending this tutorial with whatever you figure out. \u6ce8\u610f\uff1a\u6211\u6ca1\u60f3\u5230\uff0c\u5f00\u59cb\u5199\u8fd9\u672c\u4e4b\u540e\uff0c\u6211\u505a\u767b\u8bb0\uff0c\u56e0\u6b64\uff0c\u5982\u679c\u60a8\u662f\u672c\u6559\u7a0b\u4e4b\u540e\uff0c\u60a8\u7684\u901a\u77e5\uff0c\u6211\u9519\u8fc7\u4e86\uff0c \u8bf7\u4f38\u51fa\u4f60\u7684\u63f4\u624b\uff0c\u6269\u5927\u672c\u6559\u7a0b\u4e0e\u4f60\u641e\u6e05\u695a\u3002 At the moment, almost everyone is having problems getting things configured the first time. \u76ee\u524d\uff0c\u51e0\u4e4e\u6bcf\u4e2a\u4eba\u90fd\u4e0a\u6709\u95ee\u9898\u7684\u4e1c\u897f\u7b2c\u4e00\u6b21\u914d\u7f6e\u3002 <\/p>\n<p>Contents\u76ee\u5f55&nbsp;&nbsp;[hide]<br \/>1 Register &#038; Download 1 \u6ce8\u518c\u548c\u4e0b\u8f7d <br \/>2 Register your Device &#038; Fetch App ID 2 \u6ce8\u518c\u60a8\u7684\u8bbe\u5907\u53ca\u64b7\u53d6\u5e94\u7528\u7a0b\u5e8f\u7f16\u53f7 <br \/>3 Setup Unity iPhone 3 \u5b89\u88c5\u7edf\u4e00iPhone\u624b\u673a <br \/>4 Establish Network Connection 4 \u5efa\u7acb\u7f51\u7edc\u8fde\u63a5 <br \/>5 Run UnityRemote 5 \u8fd0\u884cUnityRemote <\/p>\n<p>[ edit ] Register &#038; Download [ \u7f16\u8f91 ] \u6ce8\u518c\u548c\u4e0b\u8f7d <br \/>Register as an iPhone Developer , if you have not done so already.\u6ce8\u518c\u6210\u4e3aiPhone\u624b\u673a\u7684\u5f00\u53d1 \uff0c\u5982\u679c\u4f60\u8fd8\u6ca1\u6709\u8fd9\u6837\u505a\u3002 This part does not cost anything, and will allow you to download the iPhone SDK and view all the developer documentation for the iPhone.\u8fd9\u90e8\u5206\u6ca1\u6709\u4efb\u4f55\u8d39\u7528\uff0c\u5e76\u5141\u8bb8\u60a8\u4e0b\u8f7d\u7684iPhone SDK\u548c\u67e5\u770b\u6240\u6709\u7684\u5f00\u53d1\u8005\u6587\u6863\u4e3aiPhone \u3002 You will find the link on the right side of the page.\u4f60\u4f1a\u53d1\u73b0\u4e0a\u7684\u94fe\u63a5\u9875\u9762\u53f3\u4fa7\u3002 <br \/>Download the iPhone SDK (~1.6GB) from the Apple iPhone Dev Center .\u4e0b\u8f7d\u7684iPhone\u7684SDK \uff08 \u301c 1.6GB \uff09\u7531\u82f9\u679ciPhone\u5f00\u53d1\u4e2d\u5fc3 \u3002 The SDK includes the latest XCode toolset, so there is no need to install it separately.\u8be5SDK\u5305\u62ec\u6700\u65b0\u7684XCode\u5de5\u5177\uff0c\u6240\u4ee5\u6ca1\u6709\u5fc5\u8981\u5355\u72ec\u5b89\u88c5\u5b83\u3002 <br \/>Enroll in the iPhone Developer Program .\u52a0\u5165iPhone \u7684\u5f00\u53d1\u4eba\u5458\u8ba1\u5212 \u3002 There are two options here: $99 for the Standard Program, and $299 for the Enterprise Program.\u6709\u4e24\u79cd\u9009\u62e9\u6d4f\u89c8\uff1a 99\u7f8e\u5143\u7684\u6807\u51c6\u7a0b\u5e8f\uff0c\u4ee5\u53ca299\u7f8e\u5143\u7684\u4f01\u4e1a\u8ba1\u5212\u3002 The only real difference is that you can use the Apple Apps Store with the Standard Program, while Enterprise is only for in-house distribution.\u552f\u4e00\u771f\u6b63\u7684\u533a\u522b\u662f\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u82f9\u679c\u5e94\u7528\u670d\u52a1\u5e97\u7684\u6807\u51c6\u7a0b\u5e8f\uff0c\u800c\u53ea\u662f\u4e3a\u4e86\u4f01\u4e1a\u7684\u5185\u90e8\u5206\u914d\u3002 Most will want to choose the Standard program.\u6700\u5e0c\u671b\u9009\u62e9\u7684\u6807\u51c6\u7a0b\u5e8f\u3002 <br \/> VERY IMPORTANT: When applying, you will be presented a choice for registering as a company or as an individual.\u975e\u5e38\u91cd\u8981\uff1a\u5f53\u7533\u8bf7\uff0c\u60a8\u5c06\u9009\u62e9\u6ce8\u518c\u7684\u516c\u53f8\u6216\u4e2a\u4eba\u3002 Choose carefully here, because you will not be able to switch easily.\u8c28\u614e\u9009\u62e9\uff0c\u56e0\u4e3a\u4f60\u5c06\u4e0d\u80fd\u8f7b\u6613\u8f6c\u3002 If you already have your own business setup, you will most likely want to choose company.\u5982\u679c\u60a8\u5df2\u7ecf\u62e5\u6709\u81ea\u5df1\u7684\u4f01\u4e1a\u5b89\u88c5\uff0c\u60a8\u5c06\u6700\u6709\u53ef\u80fd\u8981\u9009\u62e9\u7684\u516c\u53f8\u3002 <br \/>Wait until you get an email from Apple that lets you activate your iPhone program portal.\u7b49\u7740\uff0c\u76f4\u5230\u4f60\u6536\u5230\u4e00\u5c01\u7535\u5b50\u90ae\u4ef6\u4ece\u82f9\u679c\uff0c\u8ba9\u4f60\u6fc0\u6d3b\u4f60\u7684iPhone\u8ba1\u5212\u95e8\u6237\u3002 It can take a day to a week for Apple to authorize individuals and last report was that companies can take as long as three months to be registered.\u5b83\u53ef\u4ee5\u5728\u4e00\u5929\u81f3\u4e00\u5468\u7684\u82f9\u679c\u6388\u6743\u4e2a\u4eba\u548c\u6700\u540e\u4e00\u4efd\u62a5\u544a\u8ba4\u4e3a\uff0c\u516c\u53f8\u53ef\u80fd\u9700\u8981\u957f\u8fbe3\u4e2a\u6708\u5185\u8fdb\u884c\u767b\u8bb0\u3002 (I actually had to call the apple store at 1-800-MyApple and get transferred to the small business people who transferred me to the iPhone dev people who fixed the email for me when I still couldn&#8217;t get in after a week). \uff08\u4e8b\u5b9e\u4e0a\uff0c\u6211\u5df2\u7ecf\u6253\u7535\u8bdd\u7ed9\u82f9\u679c\u5546\u5e97\u57281 &#8211; 800 &#8211; MyApple\u5e76\u79fb\u4ea4\u7ed9\u5c0f\u4f01\u4e1a\u7684\u4eba\u8c01\u8f6c\u6211\u5bf9iPhone\u5f00\u53d1\u8c01\u56fa\u5b9a\u4eba\u6c11\u5bf9\u6211\u7684\u7535\u5b50\u90ae\u4ef6\u65f6\uff0c\u6211\u4ecd\u7136\u65e0\u6cd5\u5728\u4e00\u5468\u540e\uff09 \u3002 <br \/>Send an email to Unity and request a Unity iPhone evaluation.\u53d1\u9001\u7535\u5b50\u90ae\u4ef6\u81f3\u7edf\u4e00 \uff0c\u5e76\u8981\u6c42\u7edf\u4e00iPhone\u624b\u673a\u7684\u8bc4\u4ef7\u3002 A real person has to read your email so again this may take a few days.\u4e00\u4e2a\u771f\u5b9e\u7684\u4eba\u5df2\u7ecf\u9605\u8bfb\u60a8\u7684\u7535\u5b50\u90ae\u4ef6\uff0c\u4ee5\u4fbf\u518d\u6b21\u8fd9\u53ef\u80fd\u9700\u8981\u51e0\u5929\u65f6\u95f4\u3002 <br \/>[ edit ] Register your Device &#038; Fetch App ID [ \u7f16\u8f91 ] \u6ce8\u518c\u60a8\u7684\u8bbe\u5907\u53ca\u64b7\u53d6\u5e94\u7528\u7a0b\u5e8f\u7f16\u53f7 <br \/>Sign in to the iPhone program portal (this is what can take a week to get access to, it will show up as a button on the right side of your iPhone Dev Center page).\u767b\u5f55\u5230iPhone\u7684\u7a0b\u5e8f\u95e8\u6237\u7f51\u7ad9\uff08\u8fd9\u662f\u53ef\u4ee5\u91c7\u53d6\u4e00\u4e2a\u661f\u671f\u7684\u83b7\u5f97\uff0c\u5b83\u4f1a\u663e\u793a\u4e3a\u4e00\u4e2a\u6309\u94ae\u7684\u53f3\u8fb9\u4f60\u7684iPhone \u5f00\u53d1\u4e2d\u5fc3\u9875\uff09 \u3002 <br \/>Find the device ID of your iPhone or iPod Touch.\u627e\u5230\u7684\u8bbe\u5907ID\u4f60\u7684iPhone\u6216iPod\u63a5\u89e6\u3002 You can find out your device&#8217;s UDID using iTunes 7.7.\u60a8\u53ef\u4ee5\u627e\u5230\u60a8\u7684\u8bbe\u5907\u7684UDID\u4f7f\u7528iTunes 7.7 \u3002 or later.\u6216\u66f4\u9ad8\u7248\u672c\u3002 To do this, connect your device to your Mac and launch iTunes.\u8981\u505a\u5230\u8fd9\u4e00\u70b9\uff0c\u60a8\u7684\u8bbe\u5907\u8fde\u63a5\u5230\u60a8\u7684Mac\u548c\u63a8\u51fa\u7684iTunes \u3002 In iTunes, select your device in the &#8216;Devices&#8217; section and navigate to the Summary tab.\u5728iTunes\u4e2d\uff0c\u9009\u62e9\u60a8\u7684\u8bbe\u5907\u4e2d\u7684&#8217;\u88c5\u7f6e&#8217;\u8282\u548c\u6d4f\u89c8\u7684\u7b80\u8981\u6807\u7b7e\u3002 Click on the Serial Number label to reveal the Identifier field and the 40 character UDID.\u5355\u51fb\u7684\u5e8f\u5217\u53f7\u6807\u7b7e\uff0c\u4ee5\u663e\u793a\u6807\u8bc6\u7b26\u573a\u548c40\u4e2a\u5b57\u7b26UDID \u3002 Press Command+C to copy the UDID to your clipboard.\u6309Command + C\u590d\u5236UDID\u5230\u60a8\u7684\u526a\u8d34\u677f\u4e0a\u3002 <br \/>In the program portal, click on &#8220;Team&#8221; and register yourself (here and elsewhere in the program portal there is a &#8220;How To&#8221; tab that holds context-sensitive help information for the current task)\u8be5\u8ba1\u5212\u7684\u95e8\u6237\u7f51\u7ad9\uff0c\u70b9\u51fb\u201c\u56e2\u961f\u201d\u548c\u767b\u8bb0\u81ea\u5df1\uff08\u5728\u8fd9\u91cc\u548c\u5176\u4ed6\u5730\u65b9\u7684\u95e8\u6237\u7f51\u7ad9\u7a0b\u5e8f\u6709\u4e00\u4e2a\u201c\u5982\u4f55\u201d\u6807\u7b7e\u6301\u6709\u4e0a\u4e0b\u6587\u76f8\u5173\u7684\u5e2e\u52a9\u4fe1\u606f\uff0c\u76ee\u524d\u7684\u4efb\u52a1\uff09 <br \/>Click on &#8220;Certificates&#8221; and create a certificate that will be used to sign your application.\u70b9\u51fb\u201c\u8bc1\u4e66\u201d \uff0c\u5e76\u521b\u5efa\u4e00\u4e2a\u8bc1\u4e66\uff0c\u5c06\u7528\u4e8e\u767b\u5f55\u60a8\u7684\u7533\u8bf7\u3002 I found the instructions on the &#8220;How To&#8221; tab were enough to get me going.\u6211\u53d1\u73b0\u4e0a\u7684\u6307\u793a\uff0c \u201c\u5982\u4f55\u201d\u6807\u7b7e\u5df2\u8db3\u4ee5\u8ba9\u6211\u53bb\u3002 <br \/> VERY IMPORTANT: later on, you need to download this certificate to your Mac so that xcode can use it to sign your projects.\u975e\u5e38\u91cd\u8981\uff1a\u540e\u6765\uff0c\u4f60\u9700\u8981\u4e0b\u8f7d\u8be5\u8bc1\u4e66\u5230Mac \uff0c\u4ee5\u4fbfxcode\u53ef\u4ee5\u4f7f\u7528\u5b83\u6765\u767b\u5165\u60a8\u7684\u9879\u76ee\u3002 No code can go onto an iPhone until it is signed.\u6ca1\u6709\u4ee3\u7801\u53ef\u4ee5\u5230iPhone\u624b\u673a\uff0c\u76f4\u5230\u7b7e\u7f72\u3002 After you create a certificate you will see a button on the Certificates tab that lets you download it to your machine.\u5728\u60a8\u5efa\u7acb\u60a8\u4f1a\u770b\u5230\u8bc1\u4e66\u4e0a\u7684\u4e00\u4e2a\u6309\u94ae\u8bc1\u4e66\u6807\u7b7e\uff0c\u60a8\u53ef\u4ee5\u5c06\u5b83\u4e0b\u8f7d\u5230\u4f60\u7684\u673a\u5668\u3002 Click on the &#8220;Download&#8221; button and install the downloaded certificate by double-clicking on it.\u70b9\u51fb\u201c\u4e0b\u8f7d\u201d\u6309\u94ae\u4e0b\u8f7d\u5e76\u5b89\u88c5\u8bc1\u4e66\u901a\u8fc7\u53cc\u51fb\u5b83\u3002 This will launch the Keychain Access application.\u8fd9\u5c06\u542f\u52a8\u94a5\u5319\u6263Access\u5e94\u7528\u7a0b\u5e8f\u3002 Make sure you install to the login chain which should be selected by default.\u8bf7\u786e\u5b9a\u60a8\u5b89\u88c5\u4e86\u767b\u5f55\u94fe\u5e94\u8be5\u662f\u9ed8\u8ba4\u9009\u4e2d\u7684\u3002 <br \/>Click on &#8220;Devices&#8221; and add your device using the code that you copied out of iTunes above.\u70b9\u51fb\u201c\u8bbe\u5907\u201d \uff0c\u52a0\u4e0a\u60a8\u7684\u8bbe\u5907\u4f7f\u7528\u7684\u4ee3\u7801\uff0c\u590d\u5236\u51fa\u7684iTunes\u4ee5\u4e0a\u3002 <br \/>Click on &#8220;App IDs&#8221; and add an ID.\u70b9\u51fb\u201c\u5e94\u7528\u7a0b\u5e8f\u540d\u201d \uff0c\u5e76\u6dfb\u52a0\u4e00\u4e2a\u7f16\u53f7\u3002 This is one of the steps that people commonly get wrong.\u8fd9\u662f\u4e00\u4e2a\u6b65\u9aa4\uff0c\u4eba\u6c11\u666e\u904d\u5f97\u5230\u9519\u8bef\u7684\u3002 First, App IDs need to be based on domain names (but backwards) and second they need to end in &#8220;.*&#8221; so if you have the domain waffles.com you want to list your App ID as com.waffles.* .\u9996\u5148\uff0c\u5e94\u7528\u7a0b\u5e8f\u7684ID\u5fc5\u987b\u662f\u57fa\u4e8e\u57df\u540d\uff08\u4f46\u5411\u540e\uff09\u548c\u7b2c\u4e8c\uff0c\u4ed6\u4eec\u5fc5\u987b\u7ed3\u675f\u5728\u201c .* \u201d\u56e0\u6b64\uff0c\u5982\u679c\u60a8\u6709\u7f51\u57dfwaffles.com\u8981\u5217\u51fa\u60a8\u7684\u5e94\u7528\u7a0b\u5e8fID\u4f5c\u4e3acom.waffles .* \u3002 When you are done and the App ID shows up in the list on the main page, Apple will have added a random identifier to the front of your text so that it will look like 8dbg88ga98gf89g.com.waffles.* .\u5f53\u60a8\u5b8c\u6210\u548c\u5e94\u7528\u7a0b\u5e8f\u7f16\u53f7\u663e\u793a\u5728\u5217\u8868\u4e2d\u7684\u4e3b\u7f51\u9875\uff0c\u82f9\u679c\u7535\u8111\u5c06\u589e\u52a0\u4e00\u4e2a\u968f\u673a\u6807\u8bc6\u7b26\u524d\u7ebf\u7684\u6587\u5b57\uff0c\u4f7f\u5b83\u770b\u8d77\u6765\u5c31\u50cf8dbg88ga98gf89g.com.waffles .* \u3002 <br \/>Click on &#8220;Provisioning&#8221; and create a provisioning profile.\u70b9\u51fb\u201c\u914d\u7f6e\u201d \uff0c\u5e76\u521b\u5efa\u4e00\u4e2a\u914d\u7f6e\u7684\u4e2a\u4eba\u8d44\u6599\u3002 Again, I used the &#8220;How To&#8221; tab.\u540c\u6837\uff0c\u6211\u4f7f\u7528\u7684\u201c\u5982\u4f55\u201d\u6807\u7b7e\u3002 <br \/> VERY IMPORTANT: you will need to add the provisioning information to your xcode project.\u975e\u5e38\u91cd\u8981\uff1a\u60a8\u5c06\u9700\u8981\u6dfb\u52a0\u5230\u60a8\u7684\u4f9b\u5e94\u4fe1\u606fxcode\u9879\u76ee\u3002 Download the provisioning information using the &#8220;Download&#8221; button.\u4e0b\u8f7d\u914d\u7f6e\u4fe1\u606f\u4f7f\u7528\u201c\u4e0b\u8f7d\u201d\u6309\u94ae\u3002 <br \/>Don&#8217;t worry about the &#8220;Distribution&#8221; tab yet.\u4e0d\u5fc5\u62c5\u5fc3\u201c\u5206\u914d\u201d\u6807\u7b7e\u5c1a\u672a\u3002 <\/p>\n<p>[ edit ] Setup Unity iPhone [ \u7f16\u8f91 ] \u5b89\u88c5\u7edf\u4e00iPhone\u624b\u673a <br \/>Launch the Unity iPhone app and see the sample project\u63a8\u51faiPhone\u624b\u673a\u5e94\u7528\u8f6f\u4ef6\u7684\u7edf\u4e00\u548c\u89c1\u793a\u4f8b\u9879\u76ee <br \/>In the upper right hand corner of the view you will see the Player Prefs (you can find these later via Edit-&gt;Project Settings-&gt;Player).\u5728\u53f3\u4e0a\u89d2\u7684\u770b\u6cd5\uff0c\u60a8\u4f1a\u770b\u5230\u64ad\u653e\u5668\u504f\u597d\u8bbe\u5b9a\uff08\u60a8\u53ef\u4ee5\u627e\u5230\u8fd9\u4e9b\u7a0d\u540e\u901a\u8fc7\u7f16\u8f91\u201c\u9879\u76ee\u8bbe\u7f6e\uff0c \u201d\u64ad\u653e\u5668\uff09 \u3002 You need to change the iPhone Bundle Identifier to get it to match both your App ID and to match the identifier in the xcode project (which we&#8217;ll be modifying shortly).\u4f60\u9700\u8981\u6539\u53d8\u7684iPhone\u675f\u6807\u8bc6\u7b26\u4f7f\u5176\u7b26\u5408\u60a8\u7684\u5e94\u7528\u7a0b\u5e8fID\u548c\u76f8\u5339\u914d\u7684\u6807\u8bc6\u7b26\u5728xcode\u9879\u76ee\uff08\u5176\u4e2d\u6211\u4eec\u5c06\u4fee\u6539\u4e0d\u4e45\uff09 \u3002 Assuming your App ID was 8dbg88ga98gf89g.com.waffles.* you want to change the iPhone Bundle Identifier to com.waffles.UnityRemote\u5047\u8bbe\u60a8\u7684\u5e94\u7528\u7a0b\u5e8fID\u4e3a8dbg88ga98gf89g.com.waffles .*\u8981\u66f4\u6539iPhone\u7684\u675f\u6807\u8bc6\u7b26com.waffles.UnityRemote <br \/>In the finder, double-click on Applications\/Unity iPhone\/Unity Remote\/UnityRemote.xcodeproj\u5728Finder\u4e2d\uff0c\u53cc\u51fb\u5e94\u7528\/\u7edf\u4e00iPhone\u624b\u673a\/\u7edf\u4e00\u8fdc\u7a0b\/ UnityRemote.xcodeproj <br \/>With your iPhone connected to your Mac, you should see the device listed in the xcode organizer window.\u4e0e\u4f60\u7684iPhone\u8fde\u63a5\u5230\u4f60\u7684Mac \uff0c\u60a8\u5e94\u8be5\u53ef\u4ee5\u770b\u5230\u8be5\u8bbe\u5907\u4e2d\u6240\u5217xcode\u4e3b\u529e\u7a97\u53e3\u3002 <br \/>Select the device in the xcode organizer and click + to add a new provisioning to the device.\u9009\u62e9\u4e2d\u7684\u88c5\u7f6excode\u7ec4\u7ec7\u8005\u548c\u70b9\u51fb+\u6dfb\u52a0\u65b0\u7684\u914d\u7f6e\u5230\u8bbe\u5907\u4e0a\u3002 Browse to the provisioning file you downloaded earlier.\u6d4f\u89c8\u5230\u60a8\u7684\u914d\u7f6e\u6587\u4ef6\u4e0b\u8f7d\u8f83\u65e9\u3002 <br \/>At this point, I was getting certificate not found warnings and had to power-cycle my iPhone to get it to register (hold the button at the top of the phone down for 5 seconds to power off, then repeat to power on) and I may have had to close and re-launch xcode but after that everything was fine.\u5728\u8fd9\u4e00\u70b9\u4e0a\uff0c\u6211\u83b7\u5f97\u7684\u8bc1\u4e66\u627e\u4e0d\u5230\u4e86\u8b66\u544a\u548c\u6743\u529b\u5468\u671f\u6211\u7684iPhone\u624b\u673a\uff0c\u4ee5\u83b7\u5f97\u6ce8\u518c\uff08\u6309\u4f4f\u6309\u94ae\u4e0a\u65b9\u7684\u7535\u8bdd\u4e0b\u964d\u4e3a5\u79d2\uff0c\u5207\u65ad\u7535\u6e90\uff0c\u7136\u540e\u91cd\u590d\u6743\u529b\u7684\uff09 \uff0c\u6211\u53ef\u80fd\u4e0d\u5f97\u4e0d\u5173\u95ed\u5e76\u91cd\u65b0\u542f\u52a8\u540e\uff0c xcode \uff0c\u4f46\u4e00\u5207\u90fd\u88ab\u7f5a\u6b3e\u3002 <br \/>From the xcode Window menu, select UnityRemote.xcodeproj (or if you had to close and restart xcode open it from the recent projects menu item)\u4ecexcode\u7a97\u53e3\u83dc\u5355\u4e2d\uff0c\u9009\u62e9UnityRemote.xcodeproj \uff08\u6216\u8005\u5982\u679c\u60a8\u5df2\u5173\u95ed\u5e76\u91cd\u65b0\u542f\u52a8xcode\u6253\u5f00\u5b83\u4ece\u6700\u8fd1\u7684\u9879\u76ee\u83dc\u5355\u9879\uff09 <br \/>Select Device (rather than Simulator ) as the build target in the popup at the top left of the Xcode window.\u9009\u62e9\u8bbe\u5907 \uff08\u800c\u4e0d\u662f\u6a21\u62df\u5668 \uff09 \uff0c\u4f5c\u4e3a\u5efa\u8bbe\u76ee\u6807\u5728\u5f39\u51fa\u5728\u5de6\u4e0a\u65b9\u7684Xcode\u7a97\u53e3\u3002 <br \/>In the treeview, open Targets and select UnityRemote, then right-mouse-click and select Get Info.\u5728TreeView\u4e2d\uff0c\u6253\u5f00\u76ee\u6807\uff0c\u5e76\u9009\u62e9UnityRemote \uff0c\u7136\u540e\u53f3\u952e\u5355\u51fb\u9f20\u6807\uff0c\u9009\u62e9\u83b7\u53d6\u4fe1\u606f\u3002 Go to the Properties tab and change the Identifier (NOTE: this is another one of the steps that people frequently get wrong).\u8fdb\u5165\u5c5e\u6027\u9009\u9879\u5361\u4e0a\uff0c\u5e76\u6539\u53d8\u6807\u8bc6\u7b26\uff08\u6ce8\uff1a\u8fd9\u662f\u53e6\u4e00\u79cd\u7684\u6b65\u9aa4\u4e4b\u4e00\uff0c\u4eba\u4eec\u7ecf\u5e38\u5f97\u5230\u9519\u8bef\u7684\uff09 \u3002 This identifier needs to match whatever you put in the iPhone Unity Player Settings iPhone Bundle Identifier field, which is this example is com.waffles.UnityRemote\u8fd9\u6807\u8bc6\u7b26\u5fc5\u987b\u7b26\u5408\u4f60\u7684iPhone\u5c06\u5728\u7edf\u4e00Player\u8bbe\u5b9aiPhone\u624b\u673a\u675f\u6807\u8bc6\u7b26\u9886\u57df\uff0c\u8fd9\u662f\u8fd9\u4e2a\u4f8b\u5b50\u662fcom.waffles.UnityRemote <br \/>[ edit ] Establish Network Connection [ \u7f16\u8f91 ] \u5efa\u7acb\u7f51\u7edc\u8fde\u63a5 <br \/>Click on the Air Port icon in your main menu bar and &#8220;Create Network&#8230;&#8221;\u70b9\u51fb\u56fe\u6807\uff0c\u822a\u7a7a\u6e2f\u7684\u4e3b\u83dc\u5355\u680f\u548c\u201c\u521b\u5efa\u7f51\u7edc&#8230; \u201d to set up a wifi network (with a password) that you iPhone can connect to.\u8bbe\u7acb\u4e00\u4e2aWiFi\u7f51\u7edc\uff08\u5bc6\u7801\uff09 \uff0c\u60a8\u53ef\u4ee5\u8fde\u63a5\u5230iPhone\u624b\u673a\u3002 You can only send apps to the iPhone over wifi (you can&#8217;t do it over a USB cable).\u60a8\u53ea\u80fd\u53d1\u9001\u7ed9iPhone\u7684\u5e94\u7528\u670d\u52a1\u7684\u65e0\u7ebf\uff08\u4f60\u4e0d\u80fd\u505a\u5230\u8fd9\u4e00\u70b9\u4e86\u4e00\u4e2aUSB\u7ebf\uff09 \u3002 <br \/>on the iPhone, click on Settings and join the new wireless network.\u5728iPhone\u4e0a\uff0c\u5355\u51fb\u8bbe\u7f6e\uff0c\u5e76\u52a0\u5165\u65b0\u7684\u65e0\u7ebf\u7f51\u7edc\u3002 <br \/>[ edit ] Run UnityRemote [ \u7f16\u8f91 ] \u8fd0\u884cUnityRemote <br \/>Go back to xcode, find the UnityRemote.xcodeproj window, and click the &#8220;Build and Go&#8221; button.\u8fd4\u56dexcode \uff0c\u627e\u5230UnityRemote.xcodeproj\u7a97\u53e3\uff0c\u5e76\u5355\u51fb\u201c\u751f\u6210\u5e76\u8fd4\u56de\u201d\u6309\u94ae\u3002 xcode should build and sign your app and then you will see a notice on your phone that it is waiting for you to hit play in the editor. xcode\u5e94\u5efa\u7acb\u5e76\u7b7e\u7f72\u60a8\u7684\u5e94\u7528\u7a0b\u5e8f\uff0c\u7136\u540e\u60a8\u4f1a\u770b\u5230\u4e00\u4e2a\u901a\u77e5\u5728\u60a8\u7684\u624b\u673a\u4e0a\uff0c\u5b83\u6b63\u7b49\u7740\u4f60\u51fb\u4e2d\u53d1\u6325\u7684\u7f16\u8f91\u5668\u3002 <br \/>Switch to the Unity editor window and hit the play button in the lower-left-hand corner of the window.\u5207\u6362\u5230\u7edf\u4e00\u7f16\u8f91\u5668\u7a97\u53e3\uff0c\u7136\u540e\u6309\u4e0b\u64ad\u653e\u6309\u94ae\u5728\u8f83\u4f4e\u5de6\u4e0a\u89d2\u7684\u7a97\u53e3\u3002 <br \/>If you&#8217;ve done everything correctly, you should now be flying a ship around on your phone.\u5982\u679c\u60a8\u5df2\u7ecf\u5c3d\u4e86\u4e00\u5207\u6b63\u786e\u7684\u8bdd\uff0c\u60a8\u73b0\u5728\u5e94\u8be5\u8239\u8236\u5468\u56f4\u60ac\u6302\u5728\u60a8\u7684\u624b\u673a\u4e0a\u3002 Note that what you see on the iPhone\/iPod may be blurry.\u8bf7\u6ce8\u610f\uff0c\u60a8\u6240\u770b\u5230\u7684\u5728iPhone \/ iPod\u53ef\u80fd\u662f\u6a21\u7cca\u7684\u3002 This is because Unity Remote is streaming images rendered by Unity Editor to the device.\u8fd9\u662f\u56e0\u4e3a\u7edf\u4e00\u662f\u6d41\u8fdc\u7a0b\u56fe\u50cf\u7f16\u8f91\u5668\u6240\u63d0\u4f9b\u7684\u7edf\u4e00\u7684\u8bbe\u5907\u3002 The blurriness is a result of compression artifacts.\u8be5blurriness\u662f\u7531\u4e8e\u538b\u7f29\u6587\u7269\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6ce8:Google\u9875\u9762\u7ffb\u8bd1,\u975e\u4eba\u5de5.\u539f\u6587\u94fe\u63a5:http:\/\/www.unifycommunity.com\/wik &hellip; <a href=\"https:\/\/1vr.cn\/?p=429\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Unity3D for iPhone\u4f7f\u7528\u5165\u95e8\u4e0eUnityRemote<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-429","post","type-post","status-publish","format-standard","hentry","without-featured-image"],"_links":{"self":[{"href":"https:\/\/1vr.cn\/index.php?rest_route=\/wp\/v2\/posts\/429","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/1vr.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/1vr.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/1vr.cn\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/1vr.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=429"}],"version-history":[{"count":1,"href":"https:\/\/1vr.cn\/index.php?rest_route=\/wp\/v2\/posts\/429\/revisions"}],"predecessor-version":[{"id":909,"href":"https:\/\/1vr.cn\/index.php?rest_route=\/wp\/v2\/posts\/429\/revisions\/909"}],"wp:attachment":[{"href":"https:\/\/1vr.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=429"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/1vr.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=429"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/1vr.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=429"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}