<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="fr">
	<id>https://mathux.org/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Android</id>
	<title>Android - Historique des versions</title>
	<link rel="self" type="application/atom+xml" href="https://mathux.org/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Android"/>
	<link rel="alternate" type="text/html" href="https://mathux.org/mediawiki/index.php?title=Android&amp;action=history"/>
	<updated>2026-04-15T10:33:06Z</updated>
	<subtitle>Historique des versions pour cette page sur le wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://mathux.org/mediawiki/index.php?title=Android&amp;diff=3853&amp;oldid=prev</id>
		<title>Admin : /* std{err/out} in logcat */</title>
		<link rel="alternate" type="text/html" href="https://mathux.org/mediawiki/index.php?title=Android&amp;diff=3853&amp;oldid=prev"/>
		<updated>2020-08-31T14:38:08Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;std{err/out} in logcat&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;fr&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Version précédente&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version du 31 août 2020 à 16:38&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l99&quot;&gt;Ligne 99 :&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Ligne 99 :&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;$ adb shell setprop log.redirect-stdio true&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;$ adb shell setprop log.redirect-stdio true&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;$ adb shell start&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;$ adb shell start&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wikimedia:diff:1.41:old-3619:rev-3853:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://mathux.org/mediawiki/index.php?title=Android&amp;diff=3619&amp;oldid=prev</id>
		<title>Admin : /* Print Backtrace | Callstack */</title>
		<link rel="alternate" type="text/html" href="https://mathux.org/mediawiki/index.php?title=Android&amp;diff=3619&amp;oldid=prev"/>
		<updated>2016-07-20T16:01:34Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Print Backtrace | Callstack&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nouvelle page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Récupérer la base de donnée d&amp;#039;une app non debug sans root ==&lt;br /&gt;
&lt;br /&gt;
1/ Récupération d&amp;#039;un backup de l&amp;#039;application&lt;br /&gt;
&lt;br /&gt;
adb backup --apk &amp;lt;package_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2/ Transformer le .ab en .tar&lt;br /&gt;
&lt;br /&gt;
dd if=backup.ab bs=24 skip=1 | openssl zlib -d &amp;gt; backup.tar&lt;br /&gt;
&lt;br /&gt;
3/ untar de backup.tar&lt;br /&gt;
&lt;br /&gt;
tar xfv backup.tar&lt;br /&gt;
&lt;br /&gt;
4/ Déplacement dans le dossier qu va bien&lt;br /&gt;
&lt;br /&gt;
cd apps/&amp;lt;package_name&amp;gt;&lt;br /&gt;
== Print Backtrace | Callstack ==&lt;br /&gt;
&lt;br /&gt;
The [http://www.gnu.org/software/libc/manual/html_node/Backtraces.html the gnu Backtraces] function is not available in bionic.&lt;br /&gt;
&lt;br /&gt;
To be able to print the backtrace, you could use the CallStack class defined in the lib utils :&lt;br /&gt;
 system/core/include/utils/CallStack.h&lt;br /&gt;
&lt;br /&gt;
e.g from http://yongbingchen.github.io/blog/2013/05/09/dump-stack-in-android-native-c-code/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;utils/CallStack.h&amp;gt;&lt;br /&gt;
using namespace android;&lt;br /&gt;
extern &amp;quot;C&amp;quot; void dump_stack_android(void)&lt;br /&gt;
{&lt;br /&gt;
         CallStack stack;&lt;br /&gt;
         stack.update();&lt;br /&gt;
         stack.dump();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;utils/CallStack.h&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
using namespace android;&lt;br /&gt;
...&lt;br /&gt;
//in the function I wanna trace&lt;br /&gt;
CallStack stack(&amp;quot;TAG_LOGCAT_YOU_WANNA_USE&amp;quot;);&lt;br /&gt;
// And voila !&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Callback from C code ===&lt;br /&gt;
Having the ROM sources, you can use the following patch &lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Fichier:C call stack.patch&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And call the ccall_stack function from your C Code.&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;utils/CCallStack.h&amp;gt;&lt;br /&gt;
....&lt;br /&gt;
&lt;br /&gt;
//Dump here&lt;br /&gt;
ccall_stack();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You also need to link to libutils&amp;lt;syntaxhighlight lang=&amp;quot;makefile&amp;quot;&amp;gt;&lt;br /&gt;
LOCAL_SHARED_LIBRARIES += libutils&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;To have the complete stack information, you can push lib with debug symbole on the target&lt;br /&gt;
&lt;br /&gt;
== Just in Time debugger == &lt;br /&gt;
&lt;br /&gt;
Have a look here : https://github.com/keesj/gomo/wiki/AndroidGdbDebugging&lt;br /&gt;
&lt;br /&gt;
 adb shell setprop debug.db.uid 32767&lt;br /&gt;
&lt;br /&gt;
== Modify system properties ==&lt;br /&gt;
&lt;br /&gt;
Add into the manifest    &lt;br /&gt;
 coreApp=&amp;quot;true&amp;quot; android:sharedUserId=&amp;quot;android.uid.system&amp;quot;&lt;br /&gt;
&lt;br /&gt;
permet de modifier les properties system du coup j&amp;#039;ai un apk qui change les settings de debug juste en lui envoyant un broadcast via adb&lt;br /&gt;
&lt;br /&gt;
== Depending on another Package source ==&lt;br /&gt;
From the author:&lt;br /&gt;
 I recently submitted and had merged this change to the AOSP. I was prompted by a question on the android-platform group and also my own  requirement to make use of the zlib headers in a new Android.mk I was creating ....&lt;br /&gt;
&lt;br /&gt;
The patch adds&lt;br /&gt;
 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)&lt;br /&gt;
to the libraries built by external/zlib/Android.mk fragment. Include this variable creates an entry in the export_includes of the libz (in this case ) intermediates output directory. The effect of this means you no longer need to include LOCAL_C_INCLUDES := external/zlib in the Android.mk of a project that depend on libz, just  LOCAL_SHARED_LIBRARIES := libz is sufficient.&lt;br /&gt;
&lt;br /&gt;
Obviously zlib is just the example here and LOCAL_EXPORT_C_INCLUDE_DIRS should be used wherever you have a project interdependencies. It means your makefiles will be more &amp;quot;portable&amp;quot; due to less hardcoded paths as well as reducing the Maintenance should a project you are referencing be moved at any point 9 which from experience is not a uncommon occurrence..&lt;br /&gt;
&lt;br /&gt;
https://android-review.googlesource.com/#/c/116708/﻿&lt;br /&gt;
&lt;br /&gt;
https://plus.google.com/u/0/105455411977452054122/posts/bh7dFttAt5a&lt;br /&gt;
&lt;br /&gt;
== std{err/out} in logcat ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ adb shell stop&lt;br /&gt;
$ adb shell setprop log.redirect-stdio true&lt;br /&gt;
$ adb shell start&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Replace an Android application included by the buildsystem by yours ==&lt;br /&gt;
&lt;br /&gt;
Use&lt;br /&gt;
 LOCAL_PACKAGE_OVERRIDES with BUILD_PHONY_PACKAGE&lt;br /&gt;
&lt;br /&gt;
In latter version it&amp;#039;s&lt;br /&gt;
 LOCAL_OVERRIDES_PACKAGES&lt;br /&gt;
&lt;br /&gt;
eg. form https://github.com/DennisBold/Google_Apps/blob/master/app/Android.mk&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmake&amp;quot;&amp;gt;&lt;br /&gt;
#In a Android.mk&lt;br /&gt;
LOCAL_PATH:= $(call my-dir)&lt;br /&gt;
&lt;br /&gt;
# Calendar Provider&lt;br /&gt;
include $(CLEAR_VARS)&lt;br /&gt;
LOCAL_PACKAGE_OVERRIDES := CalendarProvider&lt;br /&gt;
LOCAL_MODULE := CalendarProvider&lt;br /&gt;
LOCAL_SRC_FILES := $(LOCAL_MODULE).apk&lt;br /&gt;
LOCAL_MODULE_CLASS := APPS&lt;br /&gt;
LOCAL_MODULE_TAGS := optional&lt;br /&gt;
LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)&lt;br /&gt;
LOCAL_CERTIFICATE := PRESIGNED&lt;br /&gt;
include $(BUILD_PREBUILT)&lt;br /&gt;
&lt;br /&gt;
#Repeat for other packages&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or with no existing apk&lt;br /&gt;
&lt;br /&gt;
LOCAL_PATH := $(call my-dir)&lt;br /&gt;
include $(CLEAR_VARS)&lt;br /&gt;
 &lt;br /&gt;
LOCAL_MODULE := CalendarProvider&lt;br /&gt;
LOCAL_MODULE := CalendarProvider&lt;br /&gt;
LOCAL_MODULE_TAGS := optional&lt;br /&gt;
&lt;br /&gt;
include $(BUILD_PHONY_PACKAGE)&lt;br /&gt;
== Kernel debug ==&lt;br /&gt;
In BoardConfig.mk&lt;br /&gt;
 BOARD_KERNEL_CMDLINE +=debug ignore_loglevel log_buf_len=10M LOGLEVEL=8&lt;br /&gt;
more on [https://wiki.archlinux.org/index.php/Boot_debugging Arch wiki]&lt;br /&gt;
&lt;br /&gt;
== Shell in recovery ==&lt;br /&gt;
&lt;br /&gt;
After rebooting in recovery&lt;br /&gt;
 cd $OUT&lt;br /&gt;
 adb push ./system/bin/sh /system/bin/sh&lt;br /&gt;
 adb push ./system/bin/linker /system/bin/linker&lt;br /&gt;
 adb push ./system/lib/libc.so /system/lib/libc.so&lt;br /&gt;
&lt;br /&gt;
Then you can use&lt;br /&gt;
 adb shell&lt;br /&gt;
&lt;br /&gt;
To use toolbox&lt;br /&gt;
&lt;br /&gt;
 adb push ./system/lib/libcrypto.so /system/lib/&lt;br /&gt;
 adb push ./system/lib/libcutils.so /system/lib/&lt;br /&gt;
 adb push ./system/lib/libm.so /system/lib/&lt;br /&gt;
 adb push ./system/lib/libselinux.so /system/lib/&lt;br /&gt;
 adb push ./system/lib/libstdc++.so /system/lib/&lt;br /&gt;
 adb push ./system/lib/liblog.so /system/lib/&lt;br /&gt;
 adb push ./system/lib/libpcre.so /system/lib/&lt;br /&gt;
 adb push ./system/bin/toolbox /system/bin/&lt;br /&gt;
&lt;br /&gt;
 cd system/bin&lt;br /&gt;
 for link in $(find -type l); do adb push $link /system/bin; done&lt;br /&gt;
&lt;br /&gt;
== Button on display ==&lt;br /&gt;
 setprop qemu.hw.mainkeys 0&lt;br /&gt;
&lt;br /&gt;
== Force build property rebuild ==&lt;br /&gt;
 rm -rf out/target/product/TARGET/obj/ETC/system_build_prop_intermediates/&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>