XPeria for development on Linux

This small article gathers some useful tips for using a XPeria as the main test phone for android app developement, using a freshly installed Linux desktop.

adb

First thing first, install the Android developer tools with android studio.
Then add adb to the PATH.

1
2
3
4
5
sudo gedit ~/.bashrc

#Add these lines to the file with gedit
PATH=$PATH:/home/benoit/Android/Sdk/platform-tools/
export PATH

Devices steps

To develop, the device need to be reached by adb.
These steps concern the XPeria devices (tested at least on the M4 Aqua and the Z2).

  1. Go to Settings > About Phone > Click many times on “Build Number”
  2. Go to Settings > Developer options > Put “On” and USB debugging “on” too
  3. Go To Settings > XPeria Connectivity > USB Connectivity > Choose MTP as the USB Connection type

Linux steps

Adb will lack the required permissions to access the device. The steps to solve the problem are cpmmon.

1
2
cd /etc/udev/rules.d
sudo gedit 70-android.rules

Add this line to the file 70-android.rules:
SUBSYSTEM==”usb”, ATTR{idVendor}==”0fce″, MODE=”0666″

1
2
3
sudo service udev restart
adb kill-server
adb devices

Some websites proposes a useful list of idVendor to add the permissions to many devices:
https://github.com/faux123/ubuntu_udev_rules_4_android