find android ABI value - android

I'm trying to debug an android application that a user has reported a particular problem with. I have created a virtual device but when it comes to the ABI version I'm lost as how to find out the version the mobile is using (if the mobile even uses this!).
(it doesn't help that I don't really know what this means / is used for)
Is there a way to find if the devices is using (armabi-v7a, x86, x86_64, x86(googleAPIs).
Any help is appreciated.

As stated in Determining Supported Processor Types (ABIs) for an Android Device:
Pre-Lollipop: From terminal type adb shell getprop ro.product.cpu.abi
Lollipop and higher: From terminal type adb shell getprop ro.product.cpu.abilist

Related

How to start more than 16 Android emulators

With 16 emulators running, adb devices shows
List of devices attached
emulator-5584
emulator-5582
emulator-5580
emulator-5578
emulator-5576
emulator-5574
emulator-5572
emulator-5570
emulator-5568
emulator-5566
emulator-5564
emulator-5562
emulator-5560
emulator-5558
emulator-5556
emulator-5554
To start the 17th emulator, I run:
emulator -avd Nexus_4_API_19_17 -ports 5586,5587
but I later get the following warning
emulator: WARNING: Requested adb port (5587) is outside the recommended range [5555,5586]. ADB may not function properly for the emulator. See -help-port for details.
And adb devices doesn't show new emulators. Running emulator -help-port doesn't provide any useful information:
At startup, the emulator tries to bind its control console at a free
port starting from 5554, in increments of two (i.e. 5554, then 5556,
5558, etc..) this allows several emulator instances to run
concurrently on the same machine, each one using a different console
port number. use '-port ' to force an emulator instance to use
a given console port note that must be an even integer
between 5554 and 5584 included. +1 must also be free and will
be reserved for ADB. if any of these ports is already used, the
emulator will fail to start.
Is there a way to make adb work with more than 16 emulators ?
You need to increase ADB_LOCAL_TRANSPORT_MAX in adb/transport_local.cpp to the desired value and recompile the adb binary.
From v41, you can set ADB_LOCAL_TRANSPORT_MAX_PORT as an env-var without needing to recompile. This has the same effect as increasing transport_max count.
Run adb --help: my patch also added documentation for this environment variable at the bottom of the help text.

Simpleperf cpu-cycles not supported in Android devices

I'm trying to make profiling with simpleperf in my Android ndk application but when I type simpleperf record command, the system reports this message:
simpleperf E 02-08 13:34:47 15380 15380 event_selection_set.cpp:68]
Event type 'cpu-cycles' is not supported by the kernel
I read this tutorial: https://android.googlesource.com/platform/system/extras/+/master/simpleperf/README.md
and I followed these steps:
Make android debuggable=true in the manifest.
adb shell setprop security.perf_harden 0
adb shell
shell#mako: run-as com.mysample.test
adb push bin/android/arm/simpleperf /data/local/tmp
shell#mako: cp /data/local/tmp/simpleperf .
shell#mako: ./simpleperf record -p 12083 --duration 30
Is that means that the nexus 4 cpu-cycles are not supported in the hardware or may i have not activated a specific security flag on the kernel?
I am using rooted nexus 4 device.
Ndk version 13b.
Android version: 5.1
Kernel version: 3.4.0-perf-gf75bb4f
pd: I tagged perf tag because of the similarity with perf.
Thanks in advance.
Unai.
Nexus 4 supports cpu-cycles event. I can't find the kernel version f75bb4f in git history, so I didn't test the same kernel. I have tested by flashing 5.1.1 (LMY48T) on nexus 4, using simpleperf in ndk-r13b, and it works. So I suspect the kernel you use disables perf events, and you can fix this by flashing a new image in https://developers.google.com/android/images#occam.

Adb: ignore offline devices?

When multiple android devices are attached, but only one of them is in debug mode, adb install|shell|... will fail with
error: more than one device/emulator
Obviously, that issue can be fixed by specifying the serial of the online device, either via ANDROID_SERIAL or a -s parameter. For fixed build scripts under version control, it would imho be better to just use the only possible device if there is only one.
Why does adb take offline devices into account? Is there a way to change that behavior?
Note: I'm searching for pure adb answers; I'm aware that I can script a call to adb devices extracting the serial of the only device, if any. But it just feels wrong for such a simple issue...

Android 4.4 Nexus 4 — rild.* section is missing in build.prop

On Nexus S (2.3 vanilla):
$ adb shell cat /system/build.prop | grep rild
rild.libpath=/vendor/lib/libsec-ril.so
rild.libargs=-d /dev/ttyS0
On Nexus 4 (4.4 vanilla):
$ adb shell cat /system/build.prop | grep rild
$
This prop present on all my Android phones: Samsung Galaxy Trend (4.1), Alcatel One Touch Pixie (2.3), Motorola Moto G (4.3), but is missing on Nexus 4.
Full build.prop:
# begin build properties
# autogenerated by buildinfo.sh
ro.build.id=KOT49H
ro.build.display.id=KOT49H
ro.build.version.incremental=937116
ro.build.version.sdk=19
ro.build.version.codename=REL
ro.build.version.release=4.4.2
ro.build.date=Wed Dec 4 23:40:01 UTC 2013
ro.build.date.utc=1386200401
ro.build.type=user
ro.build.user=android-build
ro.build.host=kpfj3.cbf.corp.google.com
ro.build.tags=release-keys
ro.product.model=Nexus 4
ro.product.brand=google
ro.product.name=occam
ro.product.device=mako
ro.product.board=MAKO
ro.product.cpu.abi=armeabi-v7a
ro.product.cpu.abi2=armeabi
ro.product.manufacturer=LGE
ro.product.locale.language=en
ro.product.locale.region=US
ro.wifi.channels=
ro.board.platform=msm8960
# ro.build.product is obsolete; use ro.product.device
ro.build.product=mako
# Do not try to parse ro.build.description or .fingerprint
ro.build.description=occam-user 4.4.2 KOT49H 937116 release-keys
ro.build.fingerprint=google/occam/mako:4.4.2/KOT49H/937116:user/release-keys
ro.build.characteristics=nosdcard
# end build properties
#
# ADDITIONAL_BUILD_PROPERTIES
#
ro.config.ringtone=Themos.ogg
ro.config.notification_sound=Tejat.ogg
ro.config.alarm_alert=Oxygen.ogg
ro.com.android.dateformat=MM-dd-yyyy
ro.com.android.dataroaming=false
ro.url.legal=http://www.google.com/intl/%s/mobile/android/basic/phone-legal.html
ro.url.legal.android_privacy=http://www.google.com/intl/%s/mobile/android/basic/privacy.html
ro.com.google.clientidbase=android-google
ro.carrier=unknown
ro.com.android.wifi-watchlist=GoogleGuest
ro.error.receiver.system.apps=com.google.android.gms
ro.setupwizard.enterprise_mode=1
ro.opengles.version=196608
ro.sf.lcd_density=320
persist.audio.handset.mic.type=digital
persist.audio.dualmic.config=endfire
persist.audio.fluence.voicecall=true
persist.audio.handset.mic=dmic
persist.audio.fluence.mode=endfire
persist.audio.lowlatency.rec=false
af.resampler.quality=4
persist.radio.apm_sim_not_pwdn=1
ro.telephony.call_ring.multiple=0
persist.hwc.mdpcomp.enable=true
ro.qualcomm.bt.hci_transport=smd
telephony.lteOnCdmaDevice=0
drm.service.enabled=true
wifi.interface=wlan0
wifi.supplicant_scan_interval=15
media.aac_51_output_enabled=true
debug.egl.recordable.rgba8888=1
ro.qc.sensors.wl_dis=true
ro.qualcomm.sensors.smd=true
dalvik.vm.heapstartsize=8m
dalvik.vm.heapgrowthlimit=192m
dalvik.vm.heapsize=512m
dalvik.vm.heaptargetutilization=0.75
dalvik.vm.heapminfree=512k
dalvik.vm.heapmaxfree=8m
keyguard.no_require_sim=true
ro.facelock.black_timeout=400
ro.facelock.det_timeout=1500
ro.facelock.rec_timeout=2500
ro.facelock.lively_timeout=2500
ro.facelock.est_max_time=600
ro.facelock.use_intro_anim=false
persist.sys.dalvik.vm.lib=libdvm.so
dalvik.vm.dexopt-flags=m=y
net.bt.name=Android
dalvik.vm.stack-trace-file=/data/anr/traces.txt
The first question: is this "feature" of Nexus 4 only or whole Android 4.4?
The second question: how should I determine the radio interface location in this case?
Android Phones regardless of Model or maker all have Build.Prop files. The Build.Prop File is used to determine phone functionality and setting information based on installed hardware and software. Carrier and Phone Build.Prop file will vary from phone to phone and could even further be augmented by the use of Custom Roms.
A Simple way to dump your build.prop file for a android device with ADB(Android Debug Bridge) would be to run the line below assuming you have ADB installed which it looks like you do.
adb shell getprop > "%USERPROFILE%\Desktop\prop.txt"
This run in a command prompt will tell ADB to drop a file name prop.text file with the key/Value pair of the given device to your desktop. I like to use GetProp because it lays out your keys and values in a format that is easier to read.
As for your Question regarding the Radio Interface Location. You will have to be more specific. What Radio are you referring to? Cellular, Bluetooth or Wifi?
The answer in general could be that the maker of that phone did not create the key with a similar name and instead is using another format for identifying it. Also keep in mind that your older phones are running a older Android OS and the key your referring to could be a obsolete.
What key are you specifically looking for currently?

Getting Android SDK version of a device from command line

I'm planning to build an automated system for deploying an Android build to various devices, in order to make development for multiple platforms a bit more comfortable. Is there a way to get the sdk version of a connected device through android shell or adb?
There will be a computer to which several test devices is connected, and I was planning to write a script which will fetch the correct build for each of those from a build-server, install the different apks on their respective devices, launch them and collect log info, to be made available through some other program whose specifications are beside the point.
The point is that I need to know the sdk version each device is running to install the correct apk, and I was hoping I could get this through adb, but I can't seem to find a way to access it short of building a tiny app, compatible with all versions, whose sole purpose would be to output android.os.Build.VERSION.SDK or similar somewhere my script could read it.
you can use this command:
adb shell grep ro.build.version.sdk= system/build.prop
It will output something like this:
ro.build.version.sdk=10
adb shell getprop ro.build.version.sdk
Note #Tim: this works even on phones without grep support on all host OS :-). (i.e. on old phones where toolbox does not support grep you you need to have busybox on your phone).
I also discovered a way to get the exact version of Android e.g. 4.2.2 based on the following web article http://xayon.net/looking-for-android-version-with-adb/ You need to be using a unix-like operating system - Linux and Mac OSX are fine, and windows users can use cygwin or equivalent.
At a command line:
echo version=$(adb shell getprop |awk -F":" '/build.version.release/ { print $2 }')|tr -d '[]'
Here is the result for my Nexus 4:
version= 4.2.2
I think you can by accessing the device with adb shell - change directories to position you at system and do a cat of build.prop. Here you will find for instance, ro.build.description=google_sdk-eng 2.2, ro.build.version.release=2.2 etc

Categories

Resources