Command handbook

Every command,
one click away.

Terminal, Git, packages, Android, iOS, builds and debugging. Search, filter by category, and copy with one click.

06Terminal

Change directory

cd <folder>

Move into another folder. Use .. to go up one level.

Examples

cd my-first-app
cd ..

Up one folder

Common mistakes

  • Folder names with spaces need quotes, e.g. cd "Mobile Development"

List files

ls

Show the files and folders in the current directory.

Examples

ls -la

Include hidden files like .gitignore (macOS / Linux / Git Bash)

dir

Windows Command Prompt equivalent

Print working directory

pwd

Show the full path of the folder you are currently in.

Create a folder

mkdir <folder-name>

Make a new directory.

Examples

mkdir -p mobile-dev/labs

Create nested folders at once

Open folder in editor

code .

Open the current folder in VS Code.

Common mistakes

  • "code" is not recognised → in VS Code run: Shell Command: Install "code" command in PATH

Install a VS Code extension

code --install-extension <extension-id>

Install an editor extension from the terminal.

Examples

code --install-extension dbaeumer.vscode-eslint
code --install-extension usernamehw.errorlens
Relatedcode .

16Git

Clone a repository

git clone <repository-url>

Download a copy of a remote repository, including its full history.

Examples

git clone https://github.com/<username>/mobile-dev-labs.git
git clone <repository-url> my-folder

Clone into a folder with a different name

Common mistakes

  • Cloning inside another Git repository by accident
  • Using the page URL instead of the .git URL for private repos

Check repository status

git status

See which files changed, which are staged and which branch you are on.

Start a repository

git init

Turn the current folder into a Git repository. Only needed if git status says "not a git repository".

Common mistakes

  • Running it in your home folder instead of the project folder

Set your Git identity

git config --global user.name "<Your Name>"

Tell Git who you are. Every commit is labelled with this name and email.

Examples

git config --global user.email "<you@bue.edu.eg>"

Use the email of your GitHub account

Stage changes

git add <file>

Choose which changes go into the next commit.

Examples

git add .

Stage everything in the current folder

git add App.tsx components/

Common mistakes

  • Staging node_modules — make sure it is in .gitignore

Commit changes

git commit -m "<message>"

Save a snapshot of staged changes with a message.

Examples

git commit -m "Add task list screen"

Push to remote

git push

Upload your local commits to GitHub.

Examples

git push -u origin main

First push of a new branch

Common mistakes

  • Rejected push: pull first with git pull --rebase

Link to a GitHub repo

git remote add origin <repository-url>

Connect your local repository to the empty repo you created on GitHub.

Examples

git remote -v

Check which URL origin points to

git remote set-url origin <repository-url>

Fix a wrong URL

Common mistakes

  • "remote origin already exists" → use set-url instead of add

Pull latest changes

git pull

Download and merge commits from the remote branch.

Examples

git pull --rebase origin main

Create and switch branch

git switch -c <branch-name>

Start a new branch for a feature or lab without touching main.

Examples

git switch main

Go back to main

git branch

List branches

Relatedgit status

Switch branch

git switch <branch-name>

Move to an existing branch.

Examples

git switch main

Common mistakes

  • Switching with uncommitted changes — commit or stash first

Merge a branch

git merge <branch-name>

Bring the commits from another branch into the branch you're on (usually main).

Examples

git switch main && git pull && git merge ali

Common mistakes

  • Merging while on the wrong branch — check git branch first

View history

git log --oneline --graph --all

Compact, visual list of commits on every branch — see who merged what.

Discard local changes

git restore <file>

Throw away uncommitted changes to a file and return it to the last commit.

Common mistakes

  • This cannot be undone — changes that were never committed are lost.
Relatedgit status

03GitHub

Create a GitHub repo from a folder

gh repo create <name> --public --source=. --push

Using the GitHub CLI, create a remote repository and push your current project in one step.

Open a Pull Request

gh pr create --fill

Open a Pull Request from your current branch to main. On the website, use the Compare & pull request button instead.

05Package Management

Install dependencies

npm install

Install every package listed in package.json into node_modules.

Examples

npm install <package-name>
npm ci

Clean install exactly from package-lock.json

Common mistakes

  • Committing node_modules to Git
  • Mixing npm and yarn in the same project

Install a dev dependency

npm install -D <package-name>

Install a tool the project needs only during development (linters, test tools).

Run a package (npx)

npx <package>

npx = Node Package eXecute. It runs a package's command without installing it globally. npm installs, npx runs.

Examples

npx -v

Check npx is available

npx create-expo-app@latest my-app

Run a package script

npm run <script>

Run a script defined in the "scripts" section of package.json.

Examples

npm run android

Check Node.js version

node -v

Print the installed Node.js version — the first thing to check when tooling misbehaves.

Examples

npm -v

08Mobile Development

Create a new app

npx create-expo-app@latest <app-name>

Scaffold a new mobile project from the official template.

Examples

npx create-expo-app@latest my-first-app

Reset the starter project

npm run reset-project

Clear the demo screens from a new Expo app and leave a blank app/index.tsx. Answer Y to keep the old files in app-example/.

Common mistakes

  • Typing npx run reset-project — it is npm run (npm runs scripts from package.json)
  • Running it outside the project folder → "Missing script"

Start the dev server

npx expo start

Start Metro and show a QR code to open the app on a device.

Examples

npx expo start --tunnel

Use when phone and laptop are on different networks

npx expo start -c

Clear the bundler cache

Common mistakes

  • Running the command outside the project folder

Install a compatible package

npx expo install <package>

Install a library at the version that matches your SDK.

Diagnose project problems

npx expo-doctor

Check the project for version mismatches and common configuration issues.

Fix package versions

npx expo install --fix

Update installed packages to the versions your Expo SDK expects. Run it after expo-doctor reports a mismatch.

Check Expo version

npx expo --version

Print the Expo CLI version. Useful when Expo Go says the project is incompatible.

Add NativeWind

npx expo install nativewind

Install NativeWind (Tailwind classes for React Native). Then follow the official setup guide for the version installed.

03Android

List connected Android devices

adb devices

Show emulators and USB devices visible to the Android Debug Bridge.

Common mistakes

  • "unauthorized" → accept the USB debugging prompt on the phone

Show Android error logs

adb logcat *:E

Stream device logs, filtered to errors only.

List virtual devices

emulator -list-avds

Print the names of every Android Virtual Device you created.

Examples

emulator -avd <avd-name>

Boot one from the terminal

01iOS

List iOS simulators

macOS
xcrun simctl list devices

Show available iOS simulators and their state (macOS only).

02Build

Build an installable app

eas build --platform android --profile preview

Create an APK/AAB in the cloud that you can install or share.

Clean Android build

macOS / Linux
cd android && ./gradlew clean

Remove cached native build output when builds fail for no clear reason.

Examples

cd android && gradlew.bat clean

Windows

02Debugging

Free a busy port

npx kill-port 8081

Stop whatever process is holding the Metro bundler port.

02Networking

Test an API endpoint

curl -i <api-url>

Send a GET request and print the status, headers and body.

Examples

curl -i https://jsonplaceholder.typicode.com/todos/1
Relatedipconfig

Find your local IP address

Windows
ipconfig

Show your computer's network addresses — needed when a phone must reach a local server.

Examples

ifconfig | grep inet

macOS / Linux

05Shortcuts

Stop a running process

Ctrl + C

Stop the dev server or any command running in the terminal.

Command history

↑ / ↓

Cycle through previously typed commands in the terminal.

Open VS Code terminal

Ctrl + `

Toggle the integrated terminal in VS Code (Cmd + ` on macOS).

Expo dev server keys

Ctrl + C · a · r · j

While npx expo start is running — a opens Android, r reloads, j opens the debugger, Ctrl + C stops.

Editor command palette

Ctrl + Shift + P

Open VS Code's command palette (Cmd + Shift + P on macOS).