Android常用脚本
Published in:2023-05-01 |
Words: 1.2k | Reading time: 6min | reading:

1. logcat 日志采集脚本

1
adb logcat -v time > D:\log1.txt

2. bugly 符号表上传脚本

1
2
3
cd  C:\Windows\System32\cmd.exe
java -jar C:\Users\root\Desktop\buglyqq-upload-symbol.jar -appid 4107a98858 -appkey 3bd03b8a-7c32-447c-ae4f-cb636561bae5 -bundleid com.example.apanewtuozhuai_MKZD531110DZDML1223_u3d -version 1.0.0 -platform Android -inputSymbol D:\u3d_host_app_drm\unityLibrary\symbols\armeabi-v7a\libil2cpp.so

mapping 映射文件 -inputMapping

1
%~dp0\D:\Program Files\Java\jdk1.8.0_181\jre\bin\java

result

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
Microsoft Windows [版本 10.0.25252.1010]
(c) Microsoft Corporation。保留所有权利。

D:\Program Files\Java\jdk1.8.0_181\bin>java -jar C:\Users\root\Desktop\buglyqq-upload-symbol.jar -appid 4107a98858 -appkey 3bd03b8a-7c32-447c-ae4f-cb636561bae5 -bundleid com.example.apanewtuozhuai_MKZD531110DZDML1223_u3d -version 1.0.0 -platform Android -inputSymbol D:\u3d_host_app_drm\unityLibrary\symbols\armeabi-v7a\libil2cpp.so
##[info]bugly tools android params: -appid 4107a98858 -appkey 3bd03b8a-7c32-447c-ae4f-cb636561bae5 -bundleid com.example.apanewtuozhuai_MKZD531110DZDML1223_u3d -version 1.0.0 -platform Android -inputSymbol D:\u3d_host_app_drm\unityLibrary\symbols\armeabi-v7a\libil2cpp.so

Bugly(bugly.qq.com)符号表工具上传工具包 V1.0.48

用法 -- Usage
java -jar buglyqq-upload-symbol.jar -appid <APP ID> -appkey <APP KEY> -bundleid <App BundleID> -version <App Version> -platform <App Platform> -inputSymbol <Original Symbol File Path> -inputMapping <Original mapping File Path>

参数说明 -- Introduction for arguments
-appid APP ID of Bugly
-appkey APP Key of Bugly
-bundleid Android平台对应的是package name/iOS平台是Bundle Id
-version APP版本,需要和bugly平台上面看到的crash版本号保持对齐
-platform 平台类型包含三个选项 Android、IOS两个选项,注意大小写要正确
-inputSymbol 原始符号表[ios是dsym/android平台是debug so]所在文件夹目录地址
-inputMapping mapping所在文件夹目录地址[Android平台特有,ios忽略]

##[info]args is ArgsParser{appId='4107a98858'appKey='3bd03b8a-7c32-447c-ae4f-cb636561bae5', appPackage='com.example.apanewtuozhuai_MKZD531110DZDML1223_u3d', appVersion='1.0.0', appBuildNo='null', platformId=Android', enviroment=null', symbolPathName='D:\u3d_host_app_drm\unityLibrary\symbols\armeabi-v7a\libil2cpp.so', mappingPathName='null', appPathName='null'}
##[info]deleteDirFiles file path is D:\Program Files\Java\jdk1.8.0_181\bin\buglybin
##[info]packSymbolFile file
##[warning]mapping path is null
##[info]mapping is exist ?: false
##[info]so is exist ?: true
##[info]bugly tools android params: -i D:\u3d_host_app_drm\unityLibrary\symbols\armeabi-v7a\libil2cpp.so -o D:\Program Files\Java\jdk1.8.0_181\bin\buglybin\symbolResult\BuglySoStifListZip.zip
D:\u3d_host_app_drm\unityLibrary\symbols\armeabi-v7a\libil2cpp.so [armeabi-v7a] 611f94d5ee0bbee371346d6abe550c7b

[SymtabTool-I] Extracting symtab file: libil2cpp.so
[SymtabTool-I] Processing file: D:\u3d_host_app_drm\unityLibrary\symbols\armeabi-v7a\libil2cpp.so
[SymtabTool-I] Begin to parse file: D:\u3d_host_app_drm\unityLibrary\symbols\armeabi-v7a\libil2cpp.so
[SymtabTool-W] No .bugly_version section in the elf file
[SymtabTool-I] Successfully parsed the file!
[SymtabTool-I] Begin to extract symbol table.................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
[SymtabTool-I] Successfully extracted symbol table!
[SymtabTool-I] UUID: 611f94d5ee0bbee371346d6abe550c7b
[SymtabTool-I] Begin to create symtab file: D:\u3d_host_app_drm\unityLibrary\symbols\armeabi-v7a\buglySymbol&armeabi-v7a&libil2cpp&611f94d5ee0bbee371346d6abe550c7b.symbol
[SymtabTool-I] Successfully created symtab file!
[SymtabTool-I] Begin to parse the file:D:\u3d_host_app_drm\unityLibrary\symbols\armeabi-v7a\buglySymbol&armeabi-v7a&libil2cpp&611f94d5ee0bbee371346d6abe550c7b.symbol
[SymtabTool-I] Successfully parsed the file
[SymtabTool-I] Begin to construct stif file: D:\u3d_host_app_drm\unityLibrary\symbols\armeabi-v7a\buglySymbol&armeabi-v7a&libil2cpp&611f94d5ee0bbee371346d6abe550c7b.stif
[SymtabTool-I] getSymtabEntryNum: 9563453
[SymtabTool-I] getIndexEntryLength: 24
[SymtabTool-I] Successfully constructed stif file
[SymtabTool-I] Add stif to symtab zip file: D:\u3d_host_app_drm\unityLibrary\symbols\armeabi-v7a\buglySymbol&armeabi-v7a&libil2cpp&611f94d5ee0bbee371346d6abe550c7b.stif
[SymtabTool-I] Begin to zip stif file: D:\u3d_host_app_drm\unityLibrary\symbols\armeabi-v7a\buglySymbol&armeabi-v7a&libil2cpp&611f94d5ee0bbee371346d6abe550c7b
[SymtabTool-I] Successfully zipped stif file!
[SymtabTool-I] Begin to zip symtab file: D:\Program Files\Java\jdk1.8.0_181\bin\buglybin\symbolResult\BuglySoStifListZip.zip
[SymtabTool-I] Successfully zipped symtab file!
##[info]destFile :D:\Program Files\Java\jdk1.8.0_181\bin\buglybin\symbolResult\BuglySoStifListZip.zipdir :.\buglybin\symbolResult
##[info]visit file name is : buglySymbol&armeabi-v7a&libil2cpp&611f94d5ee0bbee371346d6abe550c7b.zip
##[info]parseStifFileName prefix : buglySymbol arg1 : armeabi-v7a
##[info]parseStifFileName arg2 : libil2cpp uuid : 611f94d5ee0bbee371346d6abe550c7b
##[info]parseStifFileName endfix : zip
##[info]so file detail :SymbolFileDetail{name='buglySymbol&armeabi-v7a&libil2cpp&611f94d5ee0bbee371346d6abe550c7b.zip, uuid='611f94d5ee0bbee371346d6abe550c7b, arch='armeabi-v7a, type=101, moduleName='libil2cpp}
##[info]mix symbol file detail :SymbolFileDetail{name='buglySymbol&armeabi-v7a&libil2cpp&611f94d5ee0bbee371346d6abe550c7b.zip, uuid='611f94d5ee0bbee371346d6abe550c7b, arch='armeabi-v7a, type=101, moduleName='libil2cpp}
##[info]androidSymbolFileDetailList size is :1
##[info]uploadSymbolFile file :D:\Program Files\Java\jdk1.8.0_181\bin\buglybin\symbolResult\BuglySoStifListZip.zip
##[info]postRqdFile fileName: BuglySoStifListZip.zip
##[info]now begin to uploadFile
##[info]buildName :null&null
##[info]buildID :null
##[info]appID :4107a98858
##[info]bundle :com.example.apanewtuozhuai_MKZD531110DZDML1223_u3d
##[info]appVersion :1.0.0
##[info]platformId :1
##[info]appBuildNumber :null
##[info]fileType :201
##[info]fileMD5 :f09855ee3011c9a39b59d601374ea61f
##[info]fileSize :81016813
##[info]symbolFileDetail is [{"name":"buglySymbol&armeabi-v7a&libil2cpp&611f94d5ee0bbee371346d6abe550c7b.zip","uuid":"611f94d5ee0bbee371346d6abe550c7b","arch":"armeabi-v7a","type":101,"moduleName":"libil2cpp"}]
##[info]request json is {"appID":"4107a98858","authSign":"3bd03b8a-7c32-447c-ae4f-cb636561bae5","appVersion":"1.0.0","appBundleID":"com.example.apanewtuozhuai_MKZD531110DZDML1223_u3d","appPlatform":1,"appBuildNumber":null,"fileType":201,"fileSize":81016813,"fileMD5":"f09855ee3011c9a39b59d601374ea61f","clientType":7,"clientVersion":"1.0.48","buildPlatform":1,"buildID":null,"buildName":"null&null","fileInfoList":[{"name":"buglySymbol&armeabi-v7a&libil2cpp&611f94d5ee0bbee371346d6abe550c7b.zip","uuid":"611f94d5ee0bbee371346d6abe550c7b","arch":"armeabi-v7a","type":101,"moduleName":"libil2cpp"}],"buildRepo":null,"buildBranch":null,"buildCommitID":null}
##[info]request upload Info Url is https://symbol-v2.bugly.qq.com/trpc.eff_tool.symbol_upload_gateway.SymbolUploadGateway/uploadInfo
##[info]request gitRepoUrl is null
##[info]request gitRepoBranch is null
##[info]request gitRepoHeadCommitId is null
##[info]envtype is null
##[info]getAppModuleList is null
##[info]retCode: 200 response message: {"statusCode":0,"msg":"success","uploadReqID":"4107a98858-2015378e-233f-4d3a-84de-798a78374d51"}
##[info]now begin to uploadFileContent
##[info]request uploadFileurl is https://symbol-v2.bugly.qq.com/trpc.eff_tool.symbol_upload_gateway.SymbolUploadGateway/uploadFile

成功后结果如图

Prev:
使用 django-rest-framework 框架编写接口与页面
Next:
基于 Vue+Spring Cloud 前后端服务的云部署