Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Add EAS Tutorial #27059

Merged
merged 49 commits into from May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
757089c
Create EAS tutorial section in learn & add first two chapters
amandeepmittal Feb 12, 2024
6115349
Fix chapter URLs
amandeepmittal Feb 12, 2024
9af8dd5
Chapter 1 initial draft
amandeepmittal Feb 12, 2024
53c2737
Chapter 2 initial draft
amandeepmittal Feb 12, 2024
c719430
Chapter 3 initial draft
amandeepmittal Feb 12, 2024
f3865b9
Chapter 3 initial draft
amandeepmittal Feb 12, 2024
f2cb455
Chapter 4 initial draft
amandeepmittal Feb 12, 2024
8cc6d42
Chapter 5 initial draft
amandeepmittal Feb 12, 2024
7dba1d3
Chapter 7 initial draft
amandeepmittal Feb 12, 2024
63cc074
Chapter 8 initial draft
amandeepmittal Feb 12, 2024
fb58ca7
Chapter 9 initial draft
amandeepmittal Feb 12, 2024
be12a42
Chapter 10 initial draft
amandeepmittal Feb 12, 2024
579c6f1
Fix title, slug, and description
amandeepmittal Feb 13, 2024
f4f5ad7
Apply feedback from Jon
amandeepmittal Feb 13, 2024
8fe3aa6
Fix images not rendering for iOS device
amandeepmittal Feb 13, 2024
2106cdf
Fix minor issues
amandeepmittal Feb 13, 2024
3fd363d
Fix minor issues, update verbiage, & github draft
amandeepmittal Feb 13, 2024
4a7121e
Add code highlights
amandeepmittal Feb 13, 2024
2068431
Add internal links
amandeepmittal Feb 13, 2024
95700b5
Add Next steps page
amandeepmittal Feb 13, 2024
7df5b90
Fix vale warnings
amandeepmittal Feb 13, 2024
0c9549f
Apply suggestions from code review
amandeepmittal Feb 14, 2024
275f4ac
Apply feedback from Kadi
amandeepmittal Feb 15, 2024
0529d96
Apply feedback from Kadi
amandeepmittal Feb 16, 2024
721dca4
Apply suggestions from code review
amandeepmittal Feb 18, 2024
156f52b
Apply feedback from Brent's review
amandeepmittal Feb 19, 2024
28dc11a
Apply feedback from code review
amandeepmittal Feb 21, 2024
98de633
Apply feedback from code review
amandeepmittal Feb 21, 2024
91bcff2
Change callout type to a info
amandeepmittal Feb 21, 2024
6a8233e
Apply suggestions from code review
amandeepmittal Mar 6, 2024
e2476db
Change "the app stores" to "app stores"
amandeepmittal Mar 6, 2024
93347eb
Update link to Review > Overview
amandeepmittal Apr 7, 2024
3e118f7
Update screenshot of the new "Preview" button
amandeepmittal Apr 7, 2024
13bab51
Update next-steps.mdx
amandeepmittal Apr 23, 2024
bb34b4e
[docs] Add a progress tracker for EAS Tutorial (#27971)
amandeepmittal May 2, 2024
a502acc
Merge branch 'main' into aman/eng-11036-create-a-pr-for-eas-tutorial
amandeepmittal May 2, 2024
030f641
Fix prettier lint issues
amandeepmittal May 2, 2024
d181fb7
Apply feedback part 1
amandeepmittal May 5, 2024
064b151
Update
amandeepmittal May 6, 2024
e709b5b
Update GitHub guide
amandeepmittal May 6, 2024
9b3a2c7
Apply feedback from review
amandeepmittal May 6, 2024
bc31ccc
Update descriptions
amandeepmittal May 6, 2024
c786851
Add Learn > Overview section
amandeepmittal May 6, 2024
1dc9038
Update overview.mdx
amandeepmittal May 6, 2024
0f67e92
revert some changes
amandeepmittal May 6, 2024
3075ae0
Remove 'Done' and show progress when all chapters completed
amandeepmittal May 6, 2024
bcce7ba
Fix typo
amandeepmittal May 6, 2024
07a3507
Apply feedback from Simek's review
amandeepmittal May 7, 2024
e1aefb9
Minor fixes
amandeepmittal May 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/.vale/writing-styles/expo-docs/HeadingCase.yml
Expand Up @@ -151,6 +151,7 @@ exceptions:
- '.*New Architecture.*'
- '.*Node.*'
- '.*npm.*'
- '.*OTA.*'
- '.*OTF.*'
- '.*Organizations.*'
- '.*Package.*'
Expand Down
2 changes: 1 addition & 1 deletion docs/common/error-utilities.ts
Expand Up @@ -404,7 +404,7 @@ const RENAMED_PAGES: Record<string, string> = {
'/versions/latest/sdk/payments/': '/versions/latest/sdk/stripe/',
'/distribution/app-icons/': '/develop/user-interface/app-icons/',
'/guides/using-libraries/': '/workflow/using-libraries/',
'/tutorial/': '/tutorial/introduction/',
'/tutorial/': '/tutorial/overview/',

// EAS Update
'/eas-update/developing-with-eas-update/': '/eas-update/develop-faster/',
Expand Down
20 changes: 20 additions & 0 deletions docs/constants/navigation.js
Expand Up @@ -450,6 +450,7 @@ const general = [
];

const learn = [
makeSection('', [makePage('tutorial/overview.mdx')]),
makeSection(
'Get started',
[
Expand All @@ -466,6 +467,25 @@ const learn = [
],
{ expanded: true }
),
makeSection(
'EAS tutorial',
[
makePage('tutorial/eas/introduction.mdx'),
makePage('tutorial/eas/configure-development-build.mdx'),
makePage('tutorial/eas/android-development-build.mdx'),
makePage('tutorial/eas/ios-development-build-for-simulators.mdx'),
makePage('tutorial/eas/ios-development-build-for-devices.mdx'),
makePage('tutorial/eas/multiple-app-variants.mdx'),
makePage('tutorial/eas/internal-distribution-builds.mdx'),
makePage('tutorial/eas/manage-app-versions.mdx'),
makePage('tutorial/eas/android-production-build.mdx'),
makePage('tutorial/eas/ios-production-build.mdx'),
makePage('tutorial/eas/team-development.mdx'),
makePage('tutorial/eas/using-github.mdx'),
makePage('tutorial/eas/next-steps.mdx'),
],
{ expanded: true }
),
makeSection(
'UI programming',
[
Expand Down
37 changes: 20 additions & 17 deletions docs/pages/_app.tsx
Expand Up @@ -10,6 +10,7 @@ import { useNProgress } from '~/common/use-nprogress';
import DocumentationElements from '~/components/page-higher-order/DocumentationElements';
import { AnalyticsProvider } from '~/providers/Analytics';
import { CodeBlockSettingsProvider } from '~/providers/CodeBlockSettingsProvider';
import { TutorialChapterCompletionProvider } from '~/providers/TutorialChapterCompletionProvider';
import { markdownComponents } from '~/ui/components/Markdown';
import * as Tooltip from '~/ui/components/Tooltip';

Expand Down Expand Up @@ -58,23 +59,25 @@ export default function App({ Component, pageProps }: AppProps) {
return (
<AnalyticsProvider>
<ThemeProvider>
<CodeBlockSettingsProvider>
<MDXProvider components={rootMarkdownComponents}>
<Tooltip.Provider>
<Global
styles={css({
'html, body, kbd, button, input, select': {
fontFamily: regularFont.style.fontFamily,
},
'code, pre, table.diff': {
fontFamily: monospaceFont.style.fontFamily,
},
})}
/>
<Component {...pageProps} />
</Tooltip.Provider>
</MDXProvider>
</CodeBlockSettingsProvider>
<TutorialChapterCompletionProvider>
<CodeBlockSettingsProvider>
<MDXProvider components={rootMarkdownComponents}>
<Tooltip.Provider>
<Global
styles={css({
'html, body, kbd, button, input, select': {
fontFamily: regularFont.style.fontFamily,
},
'code, pre, table.diff': {
fontFamily: monospaceFont.style.fontFamily,
},
})}
/>
<Component {...pageProps} />
</Tooltip.Provider>
</MDXProvider>
</CodeBlockSettingsProvider>
</TutorialChapterCompletionProvider>
</ThemeProvider>
</AnalyticsProvider>
);
Expand Down
173 changes: 173 additions & 0 deletions docs/pages/tutorial/eas/android-development-build.mdx
@@ -0,0 +1,173 @@
---
title: Create and run a cloud build for Android
sidebar_title: Android development build
description: Learn how to configure a development build for Android devices and emulators using EAS Build.
---

import { Step } from '~/ui/components/Step';
import { Terminal } from '~/ui/components/Snippet';
import ImageSpotlight from '~/components/plugins/ImageSpotlight';
import { Collapsible } from '~/ui/components/Collapsible';
import { ProgressTracker } from '~/ui/components/ProgressTracker';

In this chapter, we'll create a development build that can run on Android with EAS Build.

The process for creating and running a build on Android devices or emulators is identical, with differences only in the installation of the development build.

## Create a build for the development profile

For Android, the development build must be in the **.apk**. While the default Android format is **.aab**, which is ideal for Google Play Store distribution, it cannot be installed on devices or emulators.

To create a **.apk**:

- In **eas.json**, make sure that `developmentClient` is set to `true` under `build.development` profile.
- Then, run the `eas build` command with `android` as the platform and `development` as the build profile:

<Terminal cmd={['$ eas build --platform android --profile development']} />

> **info** **Tip**: Next time you run `eas build` command, you can also use `-p` to specify the platform. It is short for `--platform`.

This command prompts us with the following questions:

- **What would you like your Android application id to be?** Press <kbd>return</kbd> to select the default value provided for this prompt. This will add [`android.package`](/versions/latest/config/app/#package) in **app.json**.
- **Generate a new Android Keystore**? Press <kbd>Y</kbd>.

After responding, the build will queue up, and we can track its progress via a provided link by the EAS CLI in the Expo dashboard:

<ImageSpotlight
alt="Android development build details and progress in Expo dashboard"
src="/static/images/tutorial/eas/android-build-details.png"
style={{ maxWidth: 800 }}
/>

<Collapsible summary="What information does a build details page contain?">

The build details page displays the build type, profile, Expo SDK version, app version, version code, last commit hash, and the identity of the developer or account owner who initiated the build.

In the above image, the current status of the **Build artifact** shows that the build is in progress. Upon completion, this section will offer an option to download the build. The **Logs** outlines every step taken during the Android build process on EAS Build. For the sake of brevity, we won't explore each step in detail here. To learn more, see [Android build process](/build-reference/android-builds/).

</Collapsible>

<Collapsible summary="What is an Android application ID?">

Also known as the package name of our Android app, it stores the value in DNS reverse notation format (`com.owner.appname`). Each component of this notation should start with a lowercase letter.

For example, our example app has `com.owner.stickersmash` where `com.owner` is the domain and `stickermsash` is our app name.

</Collapsible>

## Android device

<Step label="1">

### Install development build

Once the build finishes, the **Build artifact** section gets updated, indicating that the build is complete:

<ImageSpotlight
alt="Build artifact gives the option to download development build for Android devices and emulators"
src="/static/images/tutorial/eas/android-build-artifact.png"
/>

This section provides the methods available for running the development build on an Android device: Expo Orbit and Install button.

[Expo Orbit](https://expo.dev/orbit) allows for seamless installation of the development build on an Android device. To use this method:

- Connect our Android device to our local machine using USB.
- Open the Orbit menu bar app.
- Select the **Device** in the Orbit app.

<ImageSpotlight
alt="Expo Orbit app interface when connected to an Android device"
src="/static/images/tutorial/eas/android-orbit.png"
style={{ maxWidth: 300 }}
/>

- On the Expo dashboard, under **Build artifact**, click the **Open with Orbit**.

After the build is installed, the Orbit app launches the development build on the device.

<Collapsible summary="Alternate: Use the Install button and QR code">

The **Install** button in the **Build artifact** generates a QR code for installation:

- Click **Install** to display a popup with the QR code.

<ImageSpotlight
alt="Install button generates a QR code for easy installation on Android devices and emulators"
src="/static/images/tutorial/eas/android-qr-code.png"
style={{ maxWidth: 480 }}
/>

- Scan the QR code with our Android device's camera to open the build link in the default web browser.
- Tap the **Install** button on the webpage to download the **.apk** file.
- Once downloaded, open the **.apk** to start the installation process.
- If an **Unsafe app blocked message** appears, select **Install anyway**. This warning can safely be ignored as the source of the **.apk** (which we generated) is trusted.

<ImageSpotlight
alt="Unsafe app message dialog on Android device when installing development build"
src="/static/images/tutorial/eas/android-unsafe-dialog.png"
style={{ maxWidth: 300 }}
/>

</Collapsible>

</Step>

<Step label="2">

### Run development build

Start the development server by running `npx expo start` from the project directory. Once the server is running, press <kbd>a</kbd> in the terminal window to open the project:

<Terminal cmd={['$ npx expo start']} />

</Step>

## Android Emulator

<Step label="1">

### Install the development build

In the terminal, once the build finishes, EAS CLI prompts us by asking whether we want to run the build on an Android Emulator. Press <kbd>Y</kbd>.

<ImageSpotlight
alt="EAS CLI automatically gives to run build on Android Emulator"
src="/static/images/tutorial/eas/android-emulator-cli.png"
style={{ maxWidth: 600 }}
/>

<Collapsible summary="Alternate: Use Expo Orbit">

Alternatively, Expo Orbit can be used for installation. From **Build artifact** on the Expo dashboard, click **Open with Expo Orbit** to install the development build on the Android Emulator.

</Collapsible>

</Step>

<Step label="2">

### Run the development build

Start the development server by running `npx expo start` from the project directory. Once the server is running, press <kbd>a</kbd> in the terminal window to open the project:

<Terminal cmd={['$ npx expo start']} />

</Step>

## Summary

<ProgressTracker
currentChapterIndex={1}
name="EAS_TUTORIAL"
summary={
<>
We successfully used EAS Build to create and run development builds on Android devices and
emulators, and learned about <strong>.apk</strong> and <strong>.aab</strong> file formats.
</>
}
nextChapterDescription="In the next chapter, Learn how to configure a development build for iOS Simulators using EAS Build and get it running."
nextChapterTitle="Create and run a cloud build for iOS Simulator"
nextChapterLink="/tutorial/eas/ios-development-build-for-simulators/"
/>