Trying Android Development On My Mac Ubuntu With My Lg G8 Physical Phone

My Mac air 2017 is not very fast when running android emulators developing, I have Ubuntu OS on it which I use to develop normally, so I wired my android LG G8 to the android studio, seems android 11 plus supports wifi pairing, but my phone has trouble upgrading to 11, I'm using wired connection.

1. connecting android phone on Ubuntu

connection phone via USB cable, on Ubuntu, sudo apt install adb, adb ldevices, lsusb,

2. configuring phone to enable USB debugging

on phone, open developer mode, my phone is, by tapping android internal version under system several times, developer mode option appears on the main list

3. launching app to debug on physical phone

in andoird studio, create app, launch option choose to use physical phone device

4. android development

create a multi-tab view, in the layout-home fragement, drag a button into the view, then in the homeFragement code, in onCreate, there is binding to the layout, access the button by binding.buttonId, then addOnClickEventListener(view->{}), this should add event listener to the button, key point: access controls by binding.

留下你的评论