เนื่องจาก i858 เจอปัญหา เครื่องดับ เครื่องแฮงค์บ่าย ก็เลยอยากได้ app ที่สามารถเก็บ log เพื่อดูว่าก่อนที่เครื่องจะแฮงค์ หรือ ดับแล้วไม่ยอมตื่น ว่า run โปรแกรม หรือ app อะไรอยู่ถึงทำให้เครื่อง มีปัญหา
ท่านเทพทั้งหลาย โปรดประทานด้วยครับ
เราใช้คุกกี้เพื่อพัฒนาประสิทธิภาพ และประสบการณ์ที่ดีในการใช้เว็บไซต์ของคุณ คุณสามารถศึกษารายละเอียดได้ที่ นโยบายความเป็นส่วนตัว และสามารถจัดการความเป็นส่วนตัวเองได้ของคุณได้เองโดยคลิกที่ ตั้งค่า
โอ้วว ท่านเป็น support หรือ programmer แน่เลย ถามหา log ด้วย
ใช้วิธี ddms แบบข้างบนก็ได้ครับ แต่ต้องเสียบสายทิ้งไว้ตลอดเวลาด้วยครับ
ถ้าไม่อยากเสียบสายก็ใช้ alogcat ครับ สั่ง save ลง sd แล้วปล่อยให้มันรันทิ้งไว้ครับ ผมก็ใช้วิธีนี้ครับตอนหาบั๊ก cm6 โปรแกรมนี้หาจากใน market ได้เลยครับ
ขอบคุณครับสำหรับทุกคำแนะนำ
คือเราไม่รู้ว่าเหตุการณ์แฮงค์หรือดับจะเกิดขึ้นเมื่อไหร่ ส่วนผมเองก็ไม่ค่อยมีเวลากับการ monitor มันเท่าไหร่
ถ้าต่อสายทิ้งไว้ก็คงลำบาก
และถ้ามาคอยกดปุ่ม save บ่อยๆ ก็ไม่รู้ว่าจะทันเหตุการณ์นั้นหรือเปล่า
คือแบบ ตั้ง automatic save ลง ad card ไหมครับ
ขอบคุณล่วงหน้าครับ
แบบนี้ต้องใช้พวกโปรแกรมที่เข้า shell ของโทรศัพท์ได้ครับ
พวก terminal emulator, connectbot แล้วก็ไป logcat > file ทิ้งไว้ครับ
แล้วเราสามารถออกมาเล่าโปรแกรมอย่างอื่นได้ไกมครับ ขณะที่มันเก็บ log อยู่
แล้วมันไปเก็บที่ไหน
ได้ครับ พวก terminal emulator, connectbot มันรันเป็น background อยู่แล้ว
วิธีก็เข้า terminal แล้วสั่ง
$ su
# logcat > /sdcard/log.txt
ไฟล์จะเก็บไว้ใน sdcard/log.txt ครับ
ลองแล้วครับ work มากวิธีนี้ แต่ขอถามอะไรนิดว่า command. catlog สามารถใส่ option ได้ไหมครับ
พอดีรู้สึกว่ามันจะเก็บทุกอย่างเลยครับ แป๊บเดียวไฟล์ใหญ่มาก
ตามนี้ครับ ดูแล้วใช้ -f ร่วมกับ -r น่าจะเวิร์คครับ
Usage: logcat [options] [filterspecs]
options include:
-s Set default filter to silent.
Like specifying filterspec ‘*:s’
-f Log to file. Default to stdout
-r [] Rotate log every kbytes. (16 if unspecified). Requires -f
-n Sets max number of rotated logs to , default 4
-v Sets the log print format, where is one of:
brief process tag thread raw time threadtime long
-c clear (flush) the entire log and exit
-d dump the log and then exit (don’t block)
-t print only the most recent lines (implies -d)
-g get the size of the log’s ring buffer and exit
-b request alternate ring buffer
(‘main’ (default), ‘radio’, ‘events’)
-B output the log in binary
filterspecs are a series of
[:priority]
where is a log component tag (or * for all) and priority is:
V Verbose
D Debug
I Info
W Warn
E Error
F Fatal
S Silent (supress all output)
‘*’ means ‘*:d’ and by itself means :v
If not specified on the commandline, filterspec is set from ANDROID_LOG_TAGS.
If no filterspec is found, filter defaults to ‘*:I’
If not specified with -v, format is set from ANDROID_PRINTF_LOG
or defaults to “brief”
ขอบคุณมากครับ ผมขออนุญาติถามต่ออีกนิดนึงครับ
ผมจะหา command list และ usage ได้ยังงัยครับ
ผมใช้ man หรือ help ก็หาไม่เจอ
ช่วยชี้แนะอีกทีครับ
http://ss64.com/bash/
ลองศึกษาจาก link ข้างบนก็ช่วยได้ครับ แต่ Android มักจะมีคำสั่งไม่ค่อยครบ
ส่วนที่นอกเหนือจากข้างบน หาได้โดยไป ls ดูใน /system/bin กับ /system/xbin ครับ (คำเตือน: คำสั่งอันตรายๆ ก็มีเยอะครับ ถ้าไม่แน่ใจอย่ารันเด็ดขาด)
# cd /system/xbin
# ls
# cd /system/bin
# ls
ส่วน usage ของแต่ละคำสั่ง ปกติก็ใส่ –help หรือ -h เอาครับ ส่วนใหญ่จะมีคำอธิบายแบบข้างบนให้ แต่ถ้าคำสั่งไหนไม่มีก็ซวยไปครับ ฮ่าๆๆ