.. _previous_step:

.. _chapter_7:

========================================
7. How to create an App ID using Appollo
========================================

What is an App ID (aka identifier) ?
------------------------------------

It is the combination of your **Team ID** and the **bundle ID**. The Team ID is the one you can find in your membership
information and is supplied by Apple. 

The bundle ID is the one you define and is a **unique identifier** for your app on
the App Store. The App ID is required to publish an app on the App Store.

.. note::
    The bundle id should look like this : **com.company.appname**

In Appollo, you can directly **manage your App IDs**. Thanks to the ``appollo app`` subcommands.

.. image:: /img/appollo-app.jpg
  :alt: Appollo app
  :align: center

|

.. _create_app_id:

Make a new App ID
-----------------

You can **create a new one** using:

.. code-block:: none

  appollo app mk --name APP_NAME --bundle-id COM.YOURCOMPANY.YOURAPP

The **name** is simply the one you want to give to the identifier. Choose an app name to make your life easier.

The **bundle ID** (e.g.: com.yourcompany.yourapp)

.. image:: /img/appollo-app-mk.jpg
  :alt: Appollo app mk
  :align: center

|

.. note::
  If you have more than one developper account configured in Appollo you will be asked which one you want to use
  when running the command.

Let's check if your App ID was created properly on Apple Developer.

For that, go over to your |apple_developer_account|, then to the **"Certificates, Identifiers & Profile"** menu.

There, you will find the **"Identifiers menu"** that contains the list with the possibility to create new ones.

..
    TODO:change the image with one of the apple indentifiers.

.. image:: /img/apple-certificates.jpg
  :alt: Apple certificates
  :align: center

|

Modify your Bundle ID on the Appollo-Remote
-------------------------------------------

To modify your Bundle ID on Appollo remote, **you have to connect to a configuration build** just like we did in the :ref:`step 1 <start_configuration_build>` of our tutorial.

So, use the ``appollo build start`` command.

Select the configuration type.

.. note::
  Remember that your virtual machine will be up for an hour, so make sure you finish everything you need in that time.

.. image:: /img/rustdesk-xcode.jpg
  :alt: Appollo remote xcode
  :align: center

|

We will **configure the Bundle Identifier in XCode for our app** to be the same as the one we created with Appollo otherwise
Apple will not accept our submission later on in the tutorial. In the left menu of XCode select **Runner** and in the
**Signing & Capacities** tab under Bundle Identifier you can find the field to change it.

.. image:: /img/rustdesk-bundle.jpg
   :alt: XCode bundle identifier
   :align: center

|

.. |apple_developer_account| raw:: html

  <a href="https://developer.apple.com/account" target="_blank">Apple Developer account</a>
