Skip to content

Instantly share code, notes, and snippets.

@bazuzu931
Last active August 9, 2023 19:11
Show Gist options
  • Save bazuzu931/ba13e87f84893c3facd6a438301ff17e to your computer and use it in GitHub Desktop.
Save bazuzu931/ba13e87f84893c3facd6a438301ff17e to your computer and use it in GitHub Desktop.
Install Android SDK Linux
cd ~/android/sdk
sudo wget https://dl.google.com/android/repository/commandlinetools-linux-9123335_latest.zip
sudo unzip commandlinetools-linux-9123335_latest.zip
cd cmdline-tools
mkdir tools
mv -i * tools
nano ~/.bashrc
export ANDROID_HOME=$HOME/android/sdk
export PATH=$ANDROID_HOME/cmdline-tools/tools/bin/:$PATH
export PATH=$ANDROID_HOME/emulator/:$PATH
export PATH=$ANDROID_HOME/platform-tools/:$PATH
sdkmanager --list
sdkmanager --install "platform-tools" "build-tools;30.0.1" "emulator" "platforms:android-33"
or
sdkmanager --install "build-tools;required_version"
sdkmanager --update
# Appium
nvm alias default 16.13.0
nvm use 16.13.0
npm i -g appium
appium driver install uiautomator2
npm i -g appium-doctor
appium-doctor
# Run Emulator
sdkmanager --install "system-images;android-33;google_apis_playstore;x86_64"
avdmanager create avd --name android33 --package "system-images;android-33;google_apis_playstore;x86_64"
avdmanager list
emulator -list-avds
emulator -avd android33
$ appium
# get package na activity name
adb shell dumpsys window displays | grep -E 'mCurrentFocus'
# get android device id
adb shell content query --uri content://settings/secure --where "name=\'android_id\'"
# fet platform vaersion
adb shell getprop ro.build.version.release
{
"platformName": "Android",
"appium:automationName": "UIAutomator2",
"appium:deviceName": "android33",
"appium:packageName": "com.instagram.android",
"appium:appActivity": "com.instagram.mainactivity.MainActivity"
}
-------
run appium inspector
-------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment