Advertisement
Intelligent-Job-3520

Install Android Emulator(Arrch64) for Jetson Nano

Sep 13th, 2024 (edited)
75
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.73 KB | Software | 0 0
  1. * Tips
  2. - if you want start the all over, delete /opt/android-sdk/
  3. - To update the emulator version(other pre-build number), delete the /emulator and start procedure over from the middle.
  4.  
  5. * Step 1
  6. sudo apt update && sudo apt upgrade
  7. sudo apt install default-jdk python3-pip repo python-is-python3 unzip libpcre2-dev adb
  8. ## i did not include repo because i was told there was no repo
  9.  
  10. * Step 2
  11. wget https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip
  12. ## i'll use the latest version "commandlinetools-linux"
  13. unzip commandlinetools-linux-11076708_latest.zip -d android-sdk
  14. sudo mv android-sdk /opt/
  15. mkdir /opt/android-sdk/cmdline-tools/latest
  16. mv /opt/android-sdk/cmdline-tools/* /opt/android-sdk/cmdline-tools/latest
  17. echo "export ANDROID_SDK_ROOT=/opt/android-sdk" >> ~/.bashrc
  18. echo "export ANDROID_HOME=/opt/android-sdk" >> ~/.bashrc
  19. echo "export ANDROID_EMULATOR_WAIT_TIME_BEFORE_KILL=60" >> ~/.bashrc
  20. echo "export PATH=$PATH:/opt/android-sdk/cmdline-tools/latest/bin" >> ~/.bashrc
  21. source ~/.bashrc
  22. sdkmanager --update
  23. sdkmanager --licenses
  24. ## Appect All licenses
  25.  
  26. * Step 3
  27. cd /opt/android-sdk/
  28. ## download https://ci.android.com/builds/submitted/11435509/emulator-linux_aarch64/latest/sdk-repo-linux_aarch64-emulator-11435509.zip and rename "emulator.zip" and copy here
  29. ## i'll use 11435509 build
  30. unzip emulator.zip
  31. cd  emulator
  32. cat source.properties
  33. ## memo the Pkg.Revision = 34.2.8
  34. vi /opt/android-sdk/emulator/package.xml
  35. ## copy and paste this text and edit version: <major>, <minor>, <micro> and save   text => https://chromium.googlesource.com/android_tools/+/refs/heads/master/sdk/emulator/package.xml
  36.  
  37. * Step 4
  38. sdkmanager "system-images;android-28;google_apis;arm64-v8a"
  39. ## i'll use API28(Android9.0)
  40. avdmanager -v create avd -f -n MyAVD -k "system-images;android-28;google_apis;arm64-v8a" -p "/opt/android-sdk/avd"
  41. ## [no]
  42.  
  43. * Step 5
  44. mkdir /opt/android-sdk/platforms
  45. mkdir /opt/android-sdk/platform-tools
  46. echo "Vulkan = on" >> ~/.android/advancedFeatures.ini
  47. ## Turn on ShaderTranslator in case it is used. (Swiftshader cases an error, but it's only turned auto off, so it's not a problem)
  48. echo "GLDirectMem = on" >> ~/.android/advancedFeatures.ini
  49.  
  50. * Step 6
  51. sudo gpasswd -a $USER kvm
  52. ##logout and re-login
  53. /opt/android-sdk/emulator/emulator -accel-check
  54.  
  55. * Step 7
  56. /opt/android-sdk/emulator/emulator @MyAVD -cores 4 -lowram -memory 2048 -gpu swiftshader -ports 5554,5555 -skip-adb-auth -no-boot-anim -no-snapshot -no-metrics -qemu -machine gic-version=2
  57. ## INFO    | Boot completed in 126014 ms
  58. ## The emulator crash message appears, but if the optional log is left blank and [Don't Send] is pressed, the emulator will continue to run.
  59. ## The error message also appears when the emulator is deleted.
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement