ARFoundation (ARCore) series-3.App debugging

      App debugging is commonly divided into two types, wired connection to computer debugging and wireless connection to computer debugging. AR application testing usually requires movement. If we want to see the log, we need a wireless connection. So you can focus on learning wireless debugging.

Wired connection

  1. Turn on USB debugging on your phone
  2. Connect your phone and computer using a data cable
  3. At this time, we can see our mobile device in Unity's Build Settings, or we can see our mobile device in Android Studio, and then use Android Studio's Logcat to view the log.

Wireless connections

  1. Turn on USB debugging on your phone
  2. Use a data cable to connect your phone and computer, select file transfer, and allow debugging on the current computer
  3. In the case of wired debugging connection, we open cmd and run to adb tcpip 5555open the collected adb wireless debugging port
  4. Run adb connect 手机当前ip(可在当前WiFi信息里面看到):5555and you should seeconnected to 手机当前ip(可在当前WiFi信息里面看到):5555
  5. If it is not connected, then try again a few times. If it is connected, we will unplug the data cable and then execute it again adb connect 手机当前ip(可在当前WiFi信息里面看到):5555so that the wireless connection is debugged.
  6. Then we saw the phone in Unity and AndroidStudio.

      There are two ways to view logs: using AndroidStudio’s Logcat, and using the Unity Android Logcat plug-in

Android Studio

  1. Install Android Studio 4.1.2
  2. Create a new Android application, and then we wait for AndroidStudio to download and initialize things (it may take a long time to download a lot), and we can see something called Logcat appear below.
  3. Then select our mobile phone to see the logs
    Insert image description here

Unity Android Logcat

  1. Open Window > Package Management, search Android Logcat in Unity Register, and install it.
  2. Open Window > Analysis > Android Logcat and then we can see
    Insert image description here
    the convenience of Logcat pop-up window Unity, because our development is in Unity, we don't need to open a large Android Studio and just use it to view Logcat.

Guess you like

Origin blog.csdn.net/qq_45955580/article/details/131364809
Recommended