Install Android Studio.
Get Android Studio. Extract to
~/opt/android-studio
. Run Android Studio standard setup
~/opt/android-studio/bin/studio.sh
. Run SDK Manager inside Android Studio
adding:
- SDK 31
- build tools 31
- cmdline tools latest
Install NativeScript.
asdf install nodejs 18.12.1
npm install --save-dev --legacy-peer-deps nativescript dotenv-vault
npx ns doctor
Setup environment variables.
npx dotenv-vault login
npx dotenv-vault pull
Create new app.
npx ns create <app_name> [--js|--svelte] --appid info.phoenixpalace.<app_name>
cd <app_name>/
Turn on WSA developer mode. Take note of the port (58526
?)
ipconfig.exe # take note of vEthernet WSL IP address, such as 172.26.160.1
adb connect 172.26.160.1:58526
npx ns run android
In Powershell.
adb devices
adb tcpip 5555
In WSL2.
adb connect <phone_ip>:5555
npx ns run android