Skip to content

Instantly share code, notes, and snippets.

@joemar-tagpuno
Forked from ThePredators/readme-mde.md
Created August 17, 2021 08:45
Show Gist options
  • Save joemar-tagpuno/67212df695f02410b943a9818921258e to your computer and use it in GitHub Desktop.
Save joemar-tagpuno/67212df695f02410b943a9818921258e to your computer and use it in GitHub Desktop.
Setup Mobile Development Environment

⭐ Setup Mobile Development Environment

Install HomeBrew

## Install xcode utils
xcode-select --install
## Install Brew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
## Check that everything is Ok
brew doctor
## To update HomeBrew
brew update

To update/upgrade a brew package just run :

brew reinstall PACKAGE_NAME

Since macOS BigSure, HomeBrew path now is "/opt/homebrew" Don't forget to add this to replace line "export PATH=..." that was in .zshrc

HBP=/opt/homebrew
export PATH=$HBP/bin:$PATH

Apple M1 Support

Add this alias to .zshrc

alias brew="arch -arm64 brew"

Install ZSH

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Install Git

brew install git
brew install git-lfs

Install Git Flow

brew install git-flow

Install Sublime Text

brew install --cask sublime-text

Configure Aliases in .zshrc

  1. Run this :
open -a Sublime\ Text /Users/$(whoami)/.zshrc
  1. Add Git+Gitflow Aliases
  2. Add CocoaPods/Ruby/Fastlane Aliases
  3. Add Flutter Aliases
  4. Add ADB Aliases

⚠️⚠️ Every Time you edit .zshrc you need to open a new Tab of Terminal/iTerm ⚠️⚠️

brew install --cask fork

Install iTerm

brew install --cask iterm2

Install PowerLvl Template + Zsh Plugins

## Install Power10k :
git clone https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k
### change them in .zshrc  : ZSH_THEME="powerlevel10k/powerlevel10k"

## Install Power9k :
git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k
### change them in .zshrc  : ZSH_THEME="powerlevel9k/powerlevel9k"

## Install Auto-Suggestion :
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
### Edit .zshrc & add in plugins array : plugins=(zsh-autosuggestions)

## Install Syntaxe Hylight :
brew install zsh-syntax-highlighting
## Copy/Paste in .zshrc before rvm Config : source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh >> /Users/$(whoami)/.zshrc

## Install Completion : 
git clone https://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
### Edit .zshrc & add in plugins : plugins=(zsh-autosuggestions)

Install PowerLine Fonts for iTerm :

# clone
git clone https://github.com/powerline/fonts.git --depth=1
# install
cd fonts && ./install.sh
# clean-up a bit
cd .. && rm -rf fonts

Install Ruby (with RVM)

## Install rvm
curl -L https://get.rvm.io | bash -s stable
### Add this somewhere in .zshrc : source /Users/$(whoami)/.rvm/scripts/rvm

## Install Ruby
rvm install ruby-2.6.5

For More Detail check this

Apple M1 Support

if you want to install gems add this to your .zshrc

alias gem="arch -x86_64 gem"

Install CocoaPods :

sudo gem install cocoapods -n /usr/local/bin

M1 Support

Add this to .zshrc

alias pod="arch -x86_64 pod"

Install XCode

Many options to download Xcode you can use the following

Recommended Using : MAS

# Install mas
brew install mas

# Check for Xcode
mas search Xcode

# Install XCode
mas install 497799835

Others :

Install iOS Simulator :

Install xcode-install

sudo gem install xcode-install

Display all simulators By name

xcversion simulators

Install a Simulator

xcversion simulators --install="iOS 14.4 Simulator"

Display all availables devices and simulators ByIds

xcrun simctl list

Open Simualtor/Device ById

/Applications/Xcode.app/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator -CurrentDeviceUDID 7395B23C-9AAE-4CEB-8FCC-82A70FCE0553

To Open latest iOS Simulator

open -a Simulator

Install macOS Plugins

OpenInTerminal

brew install --cask openinterminal

Spectacle

brew install --cask spectacle

Dozer

brew install --cask dozer

Install Android (Android Studio + SDK + Java)

# Java
brew tap adoptopenjdk/openjdk
brew install --cask adoptopenjdk8
echo $"\nexport JAVA_HOME=/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/\n" >> /Users/$(whoami)/.zshrc

# Android Studio
brew install --cask android-studio

# Gradle 
brew install gradle
export GRADLE_HOME=/usr/local/opt/gradle
export PATH=$GRADLE_HOME/bin:$PATH

# Android platform Tools
brew install --cask android-platform-tools

## or Without android-platform-tools

# Install Android SDK
brew install android-sdk

# Export paths
export ANDROID_HOME=/usr/local/opt/android-sdk
export PATH=$ANDROID_HOME/tools:$PATH
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/build-tools/19.1.0:$PATH

# Install Android SDK 29 + Build Tool 28.0.3
sdkmanager "platform-tools" "platforms;android-29" "build-tools;28.0.3"

More Infos :

Install Android Emulator

GenyMotion (Recomended)

brew install --cask genymotion

Usefull ClI :

## Copy this to .zshrc
echo 'GMTOOL_PATH="/Applications/Genymotion.app/Contents/MacOS/"' >> /Users/$(whoami)/.zshrc
echo 'export PATH=$GMTOOL_PATH:$PATH' >> /Users/$(whoami)/.zshrc
## Display devices list
genyshell -c "devices list"

## To Create / run u need licence !
## Create a device
gmtool admin create "Google Pixel - 9.0 - API 28 - 1080x1920" GP_9
## Run a device
gmtool admin run GP_9

Android Emulator - Apple M1

Download this emulator Apple M1

Install Android File Transfer (Optionnal)

brew install --cask android-file-transfer

Install Vysor (Optionnal)

brew install --cask vysor

Install Scrcpy (Recomended) (Vysor + Android File Transfer alternative)

brew install scrcpy

Install Flutter

## Install Flutter
brew install --cask flutter
# Instal dart
brew tap dart-lang/dart
brew install dart
## Migrate to null safety (Only inside a project)
# dart migrate --apply-changes
## Check That everythong is OK
flutter doctor

Apple M1 Support for Flutter & Docker

softwareupdate --install-rosetta
## Flutter
arch -x86_64 sudo gem install ffi

Install VsCode

brew install --cask visual-studio-code

Install DB Browser For SQLite (Optionnal)

brew install --cask db-browser-for-sqlite

Install Google Chrome Plugins :

You're good to go !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment