one-click_deploy.rst 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. .. _doc_one-click_deploy:
  2. One-click deploy
  3. ================
  4. What is one-click deploy?
  5. -------------------------
  6. One-click deploy is a feature that is available once a platform is properly
  7. configured and a supported device is connected to the computer. Since things can
  8. go wrong at many levels (platform may not be configured correctly, SDK may be
  9. incorrectly installed, device may be improperly configured, etc.), it's good to
  10. let the user know that it exists.
  11. After adding an Android export preset marked as Runnable, Godot can detect when
  12. a USB device is connected to the computer and offer the user to automatically
  13. export, install and run the project (in debug mode) on the device. This feature
  14. is called *one-click deploy*.
  15. .. note::
  16. One-click deploy is only available once you've added an export template
  17. marked as **Runnable** in the Export dialog. You can mark several export
  18. presets as runnable, but only one preset per platform may be marked as
  19. runnable. If you mark a second preset in a given platform as runnable, the
  20. other preset will no longer be marked as runnable.
  21. Supported platforms
  22. -------------------
  23. - **Android:** Exports the project with debugging enabled and runs it on the
  24. connected device.
  25. - Make sure to follow the steps described in :ref:`doc_exporting_for_android`.
  26. Otherwise, the one-click deploy button won't appear.
  27. - If you have more than one device connected, Godot will ask you which device
  28. the project should be exported to.
  29. - **iOS:** Exports the project with debugging enabled and runs it on the
  30. connected device or simulator.
  31. - Make sure to follow the steps described in :ref:`doc_exporting_for_ios`.
  32. Otherwise, the one-click deploy button won't appear.
  33. - For each new bundle identifier, export the project, open it in the
  34. Xcode, and build at least once to create new provisioning profile or
  35. create a provisioning profile in the Apple Developer account dashboard.
  36. - If you have more than one device connected, Godot will ask you which device
  37. the project should be exported to.
  38. - **Desktop platforms:** Exports the project with debugging enabled and runs it
  39. on the remote computer via SSH.
  40. - **Web:** Starts a local web server and runs the exported project by opening
  41. the default web browser. This is only accessible on ``localhost`` by default.
  42. See :ref:`Troubleshooting <doc_one-click_deploy_troubleshooting_web>`
  43. for making the exported project accessible on remote devices.
  44. Using one-click deploy
  45. ----------------------
  46. - **Android:**
  47. - Enable developer mode on your mobile device
  48. then enable USB debugging in the device's settings.
  49. - After enabling USB debugging, connect the device to your PC using a USB
  50. cable.
  51. - For advanced users, it should also be possible to use wireless ADB.
  52. - **iOS:**
  53. - Install Xcode, accept Xcode license and login with your Apple Developer
  54. account.
  55. - If you are using Xcode 14 or earlier, install `ios-deploy <https://github.com/ios-control/ios-deploy>`__
  56. and set path to `ios-deploy` in the Editor Settings (see `Export ⇾ iOS ⇾ iOS Deploy`).
  57. - For running on device:
  58. - Pair your mobile device with a Mac.
  59. - Enable developer mode on your device.
  60. - Device can be connected via USB or local network.
  61. - Make sure the device is on the same local network and a correct network
  62. interface is selected in the editor settings (see `Network ⇾ Debug ⇾ Remote Host`).
  63. By default, the editor is listening for `localhost` connections only.
  64. - For running in simulator:
  65. - Install and start simulator from the Xcode.
  66. - Device screen should be unlocked.
  67. - **Desktop platforms:**
  68. - Enable `SSH Remote Deploy` and configure connection settings in the project
  69. export setting.
  70. - Make sure there is an export preset marked as **Runnable** for the target
  71. platform (Android, iOS or Web).
  72. - If everything is configured correctly and with no errors, platform-specific
  73. icons will appear in the top-right corner of the editor.
  74. - Click the button to export to the desired platform in one click.
  75. .. image:: img/remote_debug.webp
  76. .. _doc_one-click_deploy_troubleshooting:
  77. Troubleshooting
  78. ---------------
  79. Android
  80. ^^^^^^^
  81. If you can't see the device in the list of devices when running the
  82. ``adb devices`` command in a terminal, it will not be visible by Godot either.
  83. To resolve this:
  84. - Check if USB debugging is enabled *and authorized on the device*.
  85. Try unlocking your device and accepting the authorization prompt if you see any.
  86. If you can't see this prompt, running ``adb devices`` on your PC should make
  87. the authorization prompt appear on the device.
  88. - Try `revoking the debugging authorization <https://stackoverflow.com/questions/23081263/adb-android-device-unauthorized>`__
  89. in the device's developer settings, then follow the steps again.
  90. - Try using USB debugging instead of wireless debugging or vice versa.
  91. Sometimes, one of those can work better than the other.
  92. - On Linux, you may be missing the required
  93. `udev rules <https://github.com/M0Rf30/android-udev-rules>`__
  94. for your device to be recognized.
  95. .. _doc_one-click_deploy_troubleshooting_web:
  96. Web
  97. ^^^
  98. By default, the web server started by the editor is only accessible from
  99. ``localhost``. This means the web server can't be reached by other devices on
  100. the local network or the Internet (if port forwarding is set up on the router).
  101. This is done for security reasons, as you may not want other devices to be able
  102. to access the exported project while you're testing it. Binding to ``localhost``
  103. also prevents a firewall popup from appearing when you use one-click deploy for
  104. the web platform.
  105. To make the local web server accessible over the local network, you'll need to
  106. change the **Export > Web > HTTP Host** editor setting to ``0.0.0.0``. You will
  107. also need to enable **Export > Web > Use TLS** as SharedArrayBuffer requires the
  108. use of a secure connection to work, *unless* connecting to ``localhost``.
  109. However, since other clients will be connecting to a remote device, the use of
  110. TLS is absolutely required here.
  111. To make the local web server accessible over the Internet, you'll also need to
  112. forward the **Export > Web > HTTP Port** port specified in the Editor Settings
  113. (``8060`` by default) in TCP on your router. This is usually done by accessing
  114. your router's web interface then adding a NAT rule for the port in question. For
  115. IPv6 connections, you should allow the port in the router's IPv6 firewall
  116. instead. Like for local network devices, you will also need to enable **Export >
  117. Web > Use TLS**.
  118. .. note::
  119. When **Use TLS** is enabled, you will get a warning from your web browser as
  120. Godot will use a temporary self-signed certificate. You can safely ignore it
  121. and bypass the warning by clicking **Advanced** and then **Proceed to
  122. (address)**.
  123. If you have an SSL/TLS certificate that is trusted by browsers, you can specify
  124. the paths to the key and certificate files in the **Export > Web > TLS Key**
  125. and **Export > Web > TLS Certificate**. This will only work if the project
  126. is accessed through a domain name that is part of the TLS certificate.