If you know about Compatibility Test Suit for Android. Please send us the information regarding source code downloading of CTS, environment setup, building and execution.
You can find all the info about setting up and running CTS here.
If you are in a hurry,here are the commands you use most often:
Running CTS:
First, add the android-sdk-linux/platform-tools to the PATH using export PATH=$PATH:/your-path-goes-here
1- Navigate to the platform-tools directory and use
./android-cts/tools/startcts to start the CTS shell
2- run cts --plan CTS to initiate CTS
3- (OPTIONAL) ls --plan CTS to list all the individual test packages
4a- In case you want to run the entire test suite/plan:
start --plan CTS
4b- In case you want to run the test for a single package:
start --plan CTS -p package-name-goes-here
Download source code of CTS:
It's now available. You can just repo sync it, or git clone git://android.git.kernel.org/platform/cts.git
Env Setup and build
I also feel problems at building the cts. I build successfully once but other times I can't build it. You can see question here, I also record the step of my building.
Execution
Since I didn't got the cts tool, I can only recommend you read this, this is a 0xlad people's article.
To download the CTS compilable code you follow the instructions out here
repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.3_r1
If you work for some of the OEM's Google will provide special cts branches, if not, you'll have to do with the above branch.
To build and run CTS :
cd /path/to/android/root
./cts/development/ide/eclipse/genclasspath.sh > .classpath
chmod u+w .classpath
cd /path/to/android/root
make cts
cts
This answer obviously applies to 4.0.3 version of Android. Things may or may not change from Jelly Bean onwards.
Download cts source code :
$ mkdir <dir_name>
$ cd <dir_name>
$ repo init -u https://android.googlesource.com/platform/manifest -b <tag_name> ( tag_name :- android-cts-8.0_r2, android-cts-7.1_r10)
$ repo sync -d -c –q
Compile complete cts package:
$ cd <dir_name>
$ . build/envsetup.sh
$ make cts -j TARGET_PRODUCT=aosp_arm64
Compile particular cts :
$ cd <dir_name>
$ . build/envsetup.sh
$ cd <testcase_dir_name>
$ mm
CTS setup includes 3 steps
Step 1 : CTS Dowloads
Step 2 : Desktop Machine Setup
Step 3 : Android Device Configuration
Step1 : Compatibility Test Suite Downloads
i)Download and open the CTS packages matching your device’s Android version and all the Application Binary Interfaces (ABIs) your devices support from following link
https://source.android.com/compatibility/cts/downloads.html
Then Unzip it and paste the android-cts to your workspace directory
ii)Download and open the latest version of the CTS Media Files.Unzip it and paste into your workspace directory
Step 2 : Desktop Machine Setup:
CTS currently supports 64-bit Linux and Mac OS host machines. CTS will not work on Windows OS.
i)Before running the CTS, make sure you have recent versions of both Android Debug Bridge (adb) and Android Asset Packaging Tool (AAPT) installed and those tools' location added to the system path of your machine.Ensure adb and aapt are in your system path
ii)set the path using the following command
$ export PATH=$PATH:/home/ramakrishna/Android/Sdk/build-tools/27.0.3
where 27.0.3 is
iii)Install the proper version of the Java Development Kit (JDK). For Android 7.0—
On Ubuntu, use OpenJDK 8.
On Mac OS, use jdk 8u45 or newer.
For details, see the JDK requirements.
please follow below link for complete details of Android Device configuration and Running CTS
Android CTS : downloading of CTS, environment setup, building and execution
Related
I'm on ubuntu 16.04 and try to install on my lollipop 5.1 tablet, native api webrtc example (AppRtcMobile example).
I successfully installed chromium on my lollipop device. Now after removing the folders used to install chromium on the lollipop device from the ubuntu pc I'm trying to compile an example project about webrtc using the grandle system or adb at the command line. But the compilation always stops at the same point.
Unfortunately, I'm new to git, ninja, fetch and gn, so I do not understand where the error is.
I follow the procedure that I describe below (as I understand that the commands work) and create 3 different installation directories so as to install even on devices other than "arm".
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH=$PATH:/my-path/to/depot_tools
mkdir ~/webrTEST && cd ~/webrtcTEST
fetch --nohooks webrtc_android
gclient sync
./build/install-build-deps.sh
gn gen out/DebugArm --args='target_os="android" target_cpu="arm"'
gn gen out/DebugArm64 --args='target_os="android" target_cpu="arm64"'
gn gen out/DebugX64 --args='target_os="android" target_cpu="x64"'
ninja -C out/DebugArm
ninja -C out/DebugArm64
ninja -C out/DebugX64
. build/android/envsetup.sh
ninja -C out/DebugX64 AppRTCMobile
I try to study more than one "tutorial" and the offial guide too, but ninja retur everytime the same result:
myuser#mymachine:~~/webrtcTEST/src$ ninja -C out/DebugX64 AppRTCMobile
ninja: Entering directory `out/DebugX64'
ninja: no work to do.
Anyone can suggest my where is/sre my error?
regards
bkt
UPDATE:
using ls command not find AppRTCMobile but other app example or other ...
the command:
ninja -C out/DebugX64 :xxxx/xxxx/xxxx
work great ... so at these point the question change into:
where is the old AppRTCMobile example located or which is the new name of the example that allows me to android lollipop to use the server google appr.tc ??
Any how if in my manner of install the webrtc-android git there are some error please help my to find it.
regards
bkt
I did not understand the reason, but by deleting everything and re executing the procedure written in the application I got the desired result and I compiled AppRTCMobile.
This page documents running an old version (1.8.4) of mercurial but says
"(later versions need an unavaliable python module named grp)"
This is the way I did it (but am still interested to hear of alternative ways) using an Ubuntu 16.04 machine and a intel 64bit android emulator running on Windows 7, using mercurial 3.7.3
Using an Ubuntu system, follow these instructions for creating 2.7 version of python capable of running hg.
Copy python onto android device into an app files directory (so it can be executed)
on windows host
adb push python279.x86_64 /sdcard
adb -e shell
on android device
cd /data/user/0/$SOMEAPPDIR/files
cp -Rav /scard/python279.x86_64 .
make python excutable
chmod +x python279.x86_64/bin/python2.7
set some env vars need to make python run on android
export LD_LIBRARY_PATH=/data/user/0/$SOMEAPPDIR/files/python279.x86_64/lib
export LD_PRELOAD=libffi.so:libbz2.so
export PATH=$PATH:/data/user/0/$SOMEAPPDIR/files/python279.x86_64/bin
Python should now be able to be run with python2.7
Build mercurial on Ubuntu host.
download mercurial 3.7.3
uz mercurial-3.7.3.tar.gz
cd mercurial-3.7.3 && make all
HOME=$PWD/dist make install
Make minor modifications
cd dist/mercurial-3.7.3/dist/lib/python/mercurial
rm *.so
cp pure/*.py .
Edit posix.py and delete the "import grp" line.
copy mercurial onto android device
on windows host
adb push dist /sdcard
adb -e shell
on android device
cd /data/user/0/$SOMEAPPDIR/files
cp /sdcard/dist .
alias hg to make it easy to use
alias hg='python2.7 /data/user/0/$SOMEAPPDIR/files/dist/bin/hg'
Hg should now be possible to use on android device.
It's even possible to clone remote repos but I also had to pass the --insecure flag to bypass ssl errors.
The answer made on "Feb 15 '17" works fine however there is one fairly big drawback.
This answer address this drawback and is intended to be used in conjunction with the previous answer.
The problem
This procedure:
rm *.so
cp pure/*.py .
removes the native libraries and uses the python 'pure' implementation of these libraries instead. This causes major performance problem when working with large repositories, especially on slower android devices.
The solution
Cross compiling mercurial with android ndk, produces native libraries that can be used on android.
I've added some helper scripts to a mercurial 4.8.2 fork to make cross compiling easier.
Linux instructions:
Clone the repo
hg clone https://bitbucket.org/hindlemail/hg-stable-android/
update to 331892efe015
hg update -r 331892efe015
Set these for environment variables with appropriate values:
provide location of android NDK
ANDROID_NDK="$HOME/Android/android-ndk-r13b"
specify build arch - (armeabi, x86, x86_64, arm64)
ARCH="armeabi"
specify target android sdk verison
PLATFORM="android-22"
specify output of cross compiled python.
(see answer from Feb 15 '17" for more info )
PYTHONDIR="/usr/local/android/install/python279.arm22"
Run crosscompile.sh
I am running a calabash-android test using docker. When I build the container with my docker file it seems like nothing executing except the first line. When I check whether ruby installed or not it shows the ruby version. Apart from that nothing is working. I am adding the docker file structure here.
############################################################
# Docker file to run Calabash for android automation testing.
############################################################
FROM ruby:2.1-onbuild
# install Android SDK dependencies
RUN apt-get install openjdk-7-jdk
# Install android sdk
RUN wget http://dl.google.com/android/android-sdk_r23-linux.tgz
RUN tar -xvzf android-sdk_r23-linux.tgz
RUN mv android-sdk-linux /usr/local/android-sdk
RUN rm android-sdk_r23-linux.tgz
# Install Android tools
RUN echo y | /usr/local/android-sdk/tools/android update sdk --filter platform,tool,platform-tool,extra,addon-google_apis-google-19,addon-google_apis_x86-google-19,build-tools-19.1.0 --no-ui -a
#install calabash-android
RUN gem install calabash-android
ENV ANDROID_HOME /usr/local/android-sdk
ENV ANDROID_SDK_HOME $ANDROID_HOME
ENV PATH $PATH:$ANDROID_SDK_HOME/tools
ENV PATH $PATH:$ANDROID_SDK_HOME/platform-tools
ENV JAVA_HOME /usr/lib/jvm/java-7-oracle
I have followed this link to implement the Docker file. Since this is for the first time I am setting up docker for android haven't the faintest idea whether it is proper or not. Someone please help to fix the issue. All kinda helps are appreciated.
I get this response for the docker build
Step 0 : FROM ruby:2.1-onbuild
# Executing 4 build triggers
Trigger 0, COPY Gemfile /usr/src/app/
Step 0 : COPY Gemfile /usr/src/app/ Gemfile: no such file or directory
First, as long as the docker build does not execute all the steps, it is perfectly expected to not see anything installed.
Second, the ONBUILD directives from the ruby:2.1-onbuild are made to complete the image when building a new one from said image.
As I mention before, you can try first using
FROM ruby:2.3.0
That does not require extra onbuild trigger.
I am facing a problem. I have to add a PDF reader support to my Android App (now I'm using Mupdf but I need to change it).
I found PDFium project (https://code.google.com/p/pdfium/) and I think it is what I need for my needs.
I haven't too much experience in Android and I've not been able to build it for Android, I've followed the build instructions from here https://code.google.com/p/pdfium/wiki/Build with no good results.
Could you give some hint or advice to achieve build this tool in Android?
Thank you in advance!!!
How to build?
I recommend building on Linux (virtual machine will suffice),
because Windows is officially not supported and there are many problems on newer versions of OS X.
You will need about 60 GB of free space.
install OpenJDK 8
$ mkdir ~/android_src && cd ~/android_src or select any other path
$ repo init -u https://android.googlesource.com/platform/manifest -b android-7.1.1_r28
(detailed description available here)
$ repo sync and wait...
clone this repo (or download zip with its content)
replace makefiles in ~/android_src with corresponding makefiles from this repo
$ cd ~/android_src
$ source build/envsetup.sh
$ cd external/pdfium/fpdfsdk
$ lunch and select architecture
$ mma and wait ~5 minutes
library is available in ~/android_src/out/target/product/generic*/obj/lib/libmod*.so, copy it somewhere
$ rm -r ~/android_src/out before next build
It worked for me, but if doesn't work for you, try installing additional packages listed here.
Source
Build it within the AOSP
https://android.googlesource.com/platform/external/pdfium/
Use mm or mma instructions to build only the pdfium module
I've only successfully built the shared library but haven't take it into practice.
I'm trying to setup a jenkin to build the maven android project on ubantu machine
Android SDK : android-sdk_r23.0.2-linux.tgz
OS : ubantu
Maven home: /usr/share/maven3
Java version: 1.7.0_65, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk-amd64/jre
Installed the android dependency using the android SDK deployer
If i run the "mvn clean install" on command line project build successfully, but if i tried with a jenkin job it's failing because it's not able to find the manually installed jars.
jenkin user anonymous
Tried the following still facing the same issue:
I ran into a problem,
I added a new user by following this link https://www.digitalocean.com/community/tutorials/how-to-add-and-delete-users-on-ubuntu-12-04-and-centos-6
Steps to add a new user as root:
sudo adduser jenkinadmin
sudo /usr/sbin/visudo
Edit the file as below
Adding the user’s name and the same permissions as root under the the user privilege specification will grant them the sudo privileges.
--#User privilege specification
root ALL=(ALL:ALL) ALL
jenkinadmin ALL=(ALL:ALL) ALL
Press ‘cntrl x’ to exit the file and then ‘Y’ to save it
and update the /etc/default/jenkins file JENKINS_USER to new user created above. then issue the
chown -R jenkinadmin /var/log/jenkins
chown -R jenkinadmin /var/lib/jenkins
chown -R jenkinadmin /var/run/jenkins
chown -R jenkinadmin /var/cache/jenkins
Then restarted the Jenkins jenkins and check the user has changed using a ps command
/etc/init.d/jenkins restart
ps -ef | grep jenkins
I can see the jenkin is staring with the same new user, but still im getting the same mave repo error.
also after editing the sudouser with the below command
sudo /usr/sbin/visudo
now I'm alsways prompt with this error
"jenkinadmin is not in the sudoers file. This incident will be reported"
Also I've installed the maven using the sudo apt-get install maven and this install the maven on
root#myBox:/etc# mvn -v
Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T12:37:52-05:00)
Maven home: /usr/share/maven3
Java version: 1.7.0_65, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-32-generic", arch: "amd64", family: "unix"
Since maven is running fine on the command line but has issues when running through Jenkins, it most probably means that it's a PATH issue. Just run Jenkins with the same user with which you're running mvn on command line.
To find out the user with which Jenkins is running, you can run this command:
[tom#jenkins_master ~]$ ps -ef | grep -i jenkins
ec2-user 20040 1 0 Sep15 ? 00:07:59 /etc/alternatives/java -Djava.awt.headless=true -Dhudson.util.ProcessTree.disable=true -DJENKINS_HOME=/var/lib/jenkins -jar /usr/lib/jenkins/jenkins.war --logfile=/var/log/jenkins/jenkins.log --webroot=/var/cache/jenkins/war --httpPort=8080 --ajp13Port=8009 --debug=5 --handlerCountMax=100 --handlerCountMaxIdle=20
tom 23248 23222 0 22:46 pts/0 00:00:00 grep -i jenkins
[tom#jenkins_master ~]$
As you can see from the above output, Jenkins is running as user ec2-user. If you've installed Jenkins without doing any customization, then the startup script will most probably be /etc/init.d/jenkins. If you will open this file, it should have the following entry:
JENKINS_CONFIG=/etc/sysconfig/jenkins
The above file (/etc/sysconfig/jenkins) contains the user name entry with which Jenkins will be running. You should change that but you will also have to make sure that you change the ownership of other files and directories that Jenkins uses. These can be seen from the output i pasted above:
/var/lib/jenkins/
/usr/lib/jenkins/
/var/log/jenkins/
/var/cache/jenkins/
These should do. After you make changes to the ownership and restart Jenkins, make sure to check the logs to ensure there are no permission issues. That's it.
To find the user with which you're running command on the command line, just type the following command:
[tom#jenkins ~]$ id
uid=514(tom) gid=515(tom) groups=515(tom)
uid=514(tom) portion of the above output confirms that you are currently logged in as user 'tom'.