1. Instalare Android Studio

  • instrucțiuni instalare în primul laborator

2. ADB

  • comanda adb se regăsește acolo unde ați instalat SDK-ul, de exemplu la: /opt/Android/SDK/platform-tools/adb
  • trebuie activat modul developer telefon sau emulator
  • avem nevoie de opțiunea "USB debugging"
  • la comanda adb shell pe laptopul de dezvoltare, telefonul va afișa un prompt care cere permisiunea de conectare prin USB
  • adb funcționează peste cablul USB, sau peste WiFi dacă telefonul și laptopul sunt în aceeași rețea WiFi. Se recomandă setyupul inițial folosind cablul USB

2.1 USB setup

  • Dacă laptopul Linux nu vede telefonul la comanda adb devices

  • udev rules

2.2 adb over wifi

using Android Studio menus
  • Din meniul de device-uri, se selectează "Pair Devices Using WiFi"
using wireless only
  1. phone and laptop must be on the same WiFi network, for example UPB-guest
  2. phone: in developer options/Quick settings developer tiles activate Wireless debugging
  3. phone: in Settings/about phone/Device identtifiers find IP address
  4. laptop: adb mdns check should answer mdns daemon version [Openscreen discovery x.y.z]
  5. phone: Hold the tile to enter the menu and choose 'Pair device with pairing code'. IP:port is shown
  6. laptop: adb mdns services should see the IP:port exposed by the phone, for the service _adb-tls-connect._tcp
  7. laptop: adb pair IP:port, enter the code displayed by the phone
  8. laptop: adb devices now shows a device with a long name ending in '..._adb-tls-connect._tcp'
  9. laptop: adb shell should give the prompt on the phone
  • alternatively, for point 7 generate a QR code on the terminal and pair from the tile
using USB cable I
  • adb over wifi

  • Connect the device and the computer to the same Wi-Fi network

  • Plug the device to the computer with a USB cable to configure the connection

  • On the computer command line type: adb tcpip 5555

  • On the computer command line type: adb shell ip addr show wlan0 and copy the IP address after the "inet" until the "/". You can also go inside the Settings of the device to retrieve the IP address in Settings → About → Status.

  • On the computer command line type: adb connect ip-address-of-device:5555

  • You can disconnect the USB cable from the device and check with adb devices that the device is still detected.

3. Imagine AVD cu root și GMS

  • din Tools/SDK Manager/SDK platforms se adauga 'Android 15.0 ("VanillaIceCream")' API 35 Revison 2

  • Unzip lineage-gms-root.zip at location where studio keeps its images, for example
    /opt/Android/SDK/system-images/android-35/lineage/x86_64

  • Create virtual device

Android Studio -> Device Manager -> +(Add New Device, small phone) -> API 35/Services = Show All -> Under System image it shows “LineageOS” but it doesn’t have the download icon ; under API it says ‘35’

  • Give it a unique name, say Lineageos-EIM1

  • Additional settings - choose low specs: 2 CPU, 512M of RAM

  • Start => Setup – use 3 button navigation

  • In Android, go to Settings/About Device/Build number – click it 5 times to become a developer

  • Settings/search for root to find the option for rooted debugging; enable root

  • From developement machine

adb root 
adb shell
  • After first boot and setup, user data and apps are stored in $HOME/.android/avd/EIM_lineageos_1.avd/
  • create a second machine if needed

Rulare laboratoare

Laboratortelefon realemulator AVD
1 DicerollerYY
2 ActivitățiYY
2 GUIYY
2 IntențiiYY
2 ServiciiYY
2 SocketsYY
2 BluetoothYY
2 HTTPYY
2 Descoperire ServiciiYN
2 SIP & VoIPYY
2 LocalizareYY