Search code examples
androidadb

Android Studio (3.1.2) problems with ADB-service


I'm using Linux Mint Sylvia on a pretty old laptop that do not support the emulators. Therefore I try to connect my Sony XA2 (pretty new with Oreo, 8.0)

I'm trying to detect my device but I seems to have some problem with Android Studio and the ADB-service.

In the log I get:

9:39 PM Unable to detect adb version, adb output: /home/fredrik/Android/Sdk/platform-tools/adb: 1: /home/fredrik/Android/Sdk/platform-tools/adb: Syntax error: "(" unexpected

If I run the lsusb I can find the device:

Bus 002 Device 011: ID 0fce:51f7 Sony Ericsson Mobile Communications AB

I tried to run the adb devices, but first I got this:

adb devices
The program 'adb' can be found in the following packages:
 * adb
 * android-tools-adb
Try: sudo apt install <selected package>

So I installed the adb with:

sudo apt install android-tools-adb

Then I could run the adb like:

adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached 
CQ3000KKV4  unauthorized

But still I got the error above in Android Studio.

Do you guys got any clue? Best regards Fredrik


Solution

  • Adb after installation seems to run correct.

    Your device is listed as unauthorized so I guess you did not turn on developer tools on your device, or on your device you did not accept debuging with connected computer.

    To turn on developer options on device:

    1. Open Settings on your Android O running device.
    2. Select System » About phone.
    3. Scroll down and tap seven times on the Build number entry.
    4. Now go back to Settings » System » and select Developer options from there.

    In these options you should allow usb debuging if it’s not on by default.

    After connecting usb cable to your device and conputer you should see prompt on your device asking for permissions to allow debuging. If you accept that you should be able to run adb tools, logcat etc on your connected device.


    EDIT

    Looking at the error you described in comments, it looks like it is error specific for 32-bit version systems. So I see there two possible solutions:

    1. reinstall your system for 64-bit version

    or more likely:

    1. downgrade your adb platform tools

    How to downgrade adb platform tools:

    Hope it will be your case. Please keep in mind that updates of Android Studio will probably restore that error again.