提交
17
.idea/workspace.xml
generated
@ -7,11 +7,18 @@
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="fec10672-acda-4616-894b-a4b6f93aea6f" name="Default Changelist" comment="">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/.idea.Obsidian笔记.dir/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.Obsidian笔记.dir/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/笔记文件/日记/2025_03_26_星期三.md" beforeDir="false" afterPath="$PROJECT_DIR$/笔记文件/日记/2025_03_26_星期三.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/笔记文件/日记/2025_04_04_星期五.md" beforeDir="false" afterPath="$PROJECT_DIR$/笔记文件/日记/2025_04_04_星期五.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/笔记文件/日记/2025_04_05_星期六.md" beforeDir="false" afterPath="$PROJECT_DIR$/笔记文件/日记/2025_04_05_星期六.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/笔记文件/2.笔记/ios获取内存相关.md" beforeDir="false" afterPath="$PROJECT_DIR$/笔记文件/2.笔记/ios获取内存相关.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/笔记文件/2.笔记/xcode依赖处理 打包后处理通过podfile添加第三方库.md" beforeDir="false" afterPath="$PROJECT_DIR$/笔记文件/2.笔记/xcode依赖处理 打包后处理通过podfile添加第三方库.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/笔记文件/2.笔记/广告变现 临时记录.md" beforeDir="false" afterPath="$PROJECT_DIR$/笔记文件/2.笔记/广告变现 临时记录.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/笔记文件/2.笔记/性能监测平台 临时记录.md" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/笔记文件/2.笔记/性能监测平台.md" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/笔记文件/日记/2025_02_13_星期四.md" beforeDir="false" afterPath="$PROJECT_DIR$/笔记文件/日记/2025_02_13_星期四.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/笔记文件/日记/2025_03_05_星期三.md" beforeDir="false" afterPath="$PROJECT_DIR$/笔记文件/日记/2025_03_05_星期三.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/笔记文件/日记/2025_03_14_星期五.md" beforeDir="false" afterPath="$PROJECT_DIR$/笔记文件/日记/2025_03_14_星期五.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/笔记文件/日记/2025_03_18_星期二.md" beforeDir="false" afterPath="$PROJECT_DIR$/笔记文件/日记/2025_03_18_星期二.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/笔记文件/日记/2025_04_06_星期日.md" beforeDir="false" afterPath="$PROJECT_DIR$/笔记文件/日记/2025_04_06_星期日.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/笔记文件/日记/2025_04_07_星期一.md" beforeDir="false" afterPath="$PROJECT_DIR$/笔记文件/日记/2025_04_07_星期一.md" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
@ -178,7 +185,7 @@
|
||||
<entry key="branch">
|
||||
<value>
|
||||
<list>
|
||||
<option value="main" />
|
||||
<option value="origin/main" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
|
33
笔记文件/2.笔记/adb获取真机内存占用.md
Normal file
@ -0,0 +1,33 @@
|
||||
#安卓
|
||||
#unity/日常积累
|
||||
|
||||
测试包体bundle id为:
|
||||
|
||||
![[Pasted image 20250407144019.png]]
|
||||
|
||||
```
|
||||
测试包名:
|
||||
com.DefaultCompany.LGCollecter
|
||||
```
|
||||
|
||||
真机开启调试模式,然后运行对应的unity应用程序,然后,可以使用相关指令,获取到,内存占用相关信息
|
||||
|
||||
``` shell
|
||||
adb shell dumpsys meminfo com.DefaultCompany.LGCollecter
|
||||
```
|
||||
|
||||
![[Pasted image 20250407144241.png]]
|
||||
|
||||
![[Pasted image 20250407144250.png]]
|
||||
|
||||
![[Pasted image 20250407144320.png]]
|
||||
|
||||
![[Pasted image 20250407144330.png]]
|
||||
|
||||
还可以直接使用,相关指令,通过读取配置文件的形式,拿到特定的内存占用数据
|
||||
|
||||
``` shell
|
||||
adb shell "pid=$(pidof com.DefaultCompany.LGCollecter); grep -E 'VmRSS|VmHWM|VmSize|VmSwap' /proc/$pid/status"
|
||||
```
|
||||
|
||||
可以用来校验[[安卓获取内存相关]]得到的数据,是否准确
|
@ -6,7 +6,7 @@ ios相关逻辑
|
||||
|
||||
## MemoryInfoPlugin.h
|
||||
|
||||
``` c
|
||||
``` objc
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface MemoryInfoPlugin : NSObject
|
||||
@ -21,7 +21,7 @@ ios相关逻辑
|
||||
|
||||
## MemoryInfoPlugin.mm
|
||||
|
||||
``` cpp
|
||||
``` objc
|
||||
#import "MemoryInfoPlugin.h"
|
||||
#import <mach/mach.h>
|
||||
#import <sys/sysctl.h>
|
||||
|
@ -1,4 +1,5 @@
|
||||
#unity/代码缓存
|
||||
#ios
|
||||
|
||||
有一个前提:macos已经正确安装了,pod相关的工具
|
||||
|
||||
@ -45,7 +46,13 @@ static class PostProcessBuildClass {
|
||||
PlistDocument plist = new PlistDocument();
|
||||
plist.ReadFromFile(plistPath);
|
||||
PlistElementDict rootDict = plist.root;
|
||||
rootDict.SetString("NSUserTrackingUsageDescription", "We need your consent to track advertisements to provide better services。");
|
||||
|
||||
// 添加广告追踪权限说明
|
||||
rootDict.SetString("NSUserTrackingUsageDescription", "We need your consent to track advertisements to provide better services.");
|
||||
|
||||
// 添加定位服务权限说明
|
||||
rootDict.SetString("NSLocationWhenInUseUsageDescription", "We need your location to provide personalized services.");
|
||||
|
||||
File.WriteAllText(plistPath, plist.WriteToString());
|
||||
}
|
||||
|
||||
@ -312,7 +319,7 @@ end";
|
||||
process.WaitForExit();
|
||||
|
||||
if (process.ExitCode != 0)
|
||||
{
|
||||
{
|
||||
string error = process.StandardError.ReadToEnd();
|
||||
Debug.LogError($"启动终端失败: {error}");
|
||||
}
|
||||
|
96
笔记文件/2.笔记/安卓获取内存相关.md
Normal file
@ -0,0 +1,96 @@
|
||||
#安卓
|
||||
#unity/日常积累
|
||||
|
||||
移动端,存在几个不同的内存获取方式:USS、PSS、RSS,他们之间的区别:
|
||||
|
||||
对于USS(Unique Set Size),计算了TotalPrivateDirty和TotalPrivateClean的总和,再转换为MB。USS指的是进程独占的物理内存,不包含共享库的部分,这部分是正确的。
|
||||
|
||||
PSS(Proportional Set Size)是共享内存按比例分配后的值,比如三个进程共享一个库,每个进程的PSS会加上该库大小的1/3。这也是正确的实现。
|
||||
|
||||
RSS,实际物理内存占用,通过读取/proc/self/status中的VmRSS来获取,这是更直接且准确的方式,因为系统提供的这个值直接反映了RSS的大小。
|
||||
|
||||
![[Pasted image 20250407142019.png]]
|
||||
|
||||
逻辑参考:
|
||||
``` java
|
||||
//获取USS
|
||||
public static int getUSSMemoryMB()
|
||||
{
|
||||
try {
|
||||
// if (!hasUsageStatsPermission()) {
|
||||
// return -2;
|
||||
// }
|
||||
int pid = android.os.Process.myPid();
|
||||
Activity activity = UnityActivity.getActivity();
|
||||
ActivityManager am = (ActivityManager) activity.getSystemService(Context.ACTIVITY_SERVICE);
|
||||
Debug.MemoryInfo[] memInfoArray = am.getProcessMemoryInfo(new int[]{pid});
|
||||
if (memInfoArray != null && memInfoArray.length > 0)
|
||||
{
|
||||
Debug.MemoryInfo mi = memInfoArray[0];
|
||||
int ussKb = mi.getTotalPrivateDirty() + mi.getTotalPrivateClean();
|
||||
return ussKb / 1024; //转MB
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
// 获取 PSS(MB)
|
||||
public static int getPSSMemoryMB() {
|
||||
try {
|
||||
// if (!hasUsageStatsPermission()) {
|
||||
// return -2;
|
||||
// }
|
||||
int pid = android.os.Process.myPid();
|
||||
Activity activity = UnityActivity.getActivity();
|
||||
ActivityManager am = (ActivityManager) activity.getSystemService(Context.ACTIVITY_SERVICE);
|
||||
Debug.MemoryInfo[] memInfoArray = am.getProcessMemoryInfo(new int[]{pid});
|
||||
if (memInfoArray != null && memInfoArray.length > 0) {
|
||||
return memInfoArray[0].getTotalPss() / 1024; // 转换为MB
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
// 获取 RSS(MB)
|
||||
public static int getRSSMemoryMBProc() {
|
||||
// long startTime = System.nanoTime(); // 记录开始时间
|
||||
try (BufferedReader br = new BufferedReader(new FileReader("/proc/self/status"))) {
|
||||
String line;
|
||||
while ((line = br.readLine()) != null) {
|
||||
if (line.startsWith("VmRSS:")) {
|
||||
String[] parts = line.split("\\s+");
|
||||
int kb = Integer.parseInt(parts[1]);
|
||||
// long duration = (System.nanoTime() - startTime) / 1000; // 微秒耗时
|
||||
// Log.d("PerfMonitor", "getRSSMemoryMBProc took " + duration + "μs");
|
||||
return kb / 1024;
|
||||
}
|
||||
}
|
||||
// 如果没有找到VmRSS行也记录耗时
|
||||
// long duration = (System.nanoTime() - startTime) / 1000;
|
||||
// Log.d("PerfMonitor", "getRSSMemoryMBProc (no data) took " + duration + "μs");
|
||||
} catch (Exception e) {
|
||||
// long duration = (System.nanoTime() - startTime) / 1000;
|
||||
// Log.e("PerfMonitor", "getRSSMemoryMBProc failed after " + duration + "μs", e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
// 获取系统可用内存百分比
|
||||
public float getAvailableMemoryPercent() {
|
||||
ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
|
||||
Activity activity = UnityActivity.getActivity();
|
||||
ActivityManager am = (ActivityManager) activity.getSystemService(Context.ACTIVITY_SERVICE);
|
||||
am.getMemoryInfo(mi);
|
||||
return (float)mi.availMem / mi.totalMem * 100;
|
||||
}
|
||||
```
|
||||
|
||||
安卓相关的Manifest.xml文件,也添加一下,权限申请
|
||||
|
||||
![[Pasted image 20250407143343.png]]
|
@ -106,3 +106,16 @@ slot配置链接:
|
||||
```
|
||||
https://icongamesg.com/app-ads.txt
|
||||
```
|
||||
|
||||
会有邮件提示,需要添加相关权限申请
|
||||
|
||||
![[img_v3_02l0_ad3a491b-0a7b-4423-acf3-7d71ffc2c3hu.jpg]]
|
||||
|
||||
根据提示,添加对应的,定位权限申请即可
|
||||
|
||||
``` cs
|
||||
// 添加定位服务权限说明
|
||||
rootDict.SetString("NSLocationWhenInUseUsageDescription", "We need your location to provide personalized services.");
|
||||
```
|
||||
|
||||
![[Pasted image 20250407091527.png]]
|
53
笔记文件/2.笔记/性能检测平台 临时记录.md
Normal file
@ -0,0 +1,53 @@
|
||||
#灵感
|
||||
|
||||
局域网 服务端地址
|
||||
|
||||
服务器 IP:[[192.168.1.177](http://192.168.1.177)]([http://192.168.1.177/](http://192.168.1.177/)) 用户:root 密码:cZr8YTtp
|
||||
|
||||
参考的上报日志 分析平台 演示:
|
||||
|
||||
[https://creporter.inspiregames.cn:81/](https://creporter.inspiregames.cn:81/) lg753951
|
||||
|
||||
这里是采集到,客户端发过来数据的接口逻辑:
|
||||
|
||||
![[Pasted image 20250314184241.png]]
|
||||
|
||||
安卓端,采集内存占用,统计采集耗时,逻辑参考
|
||||
|
||||
``` java
|
||||
public static int getRSSMemoryMBProc() {
|
||||
long startTime = System.nanoTime(); // 记录开始时间
|
||||
try (BufferedReader br = new BufferedReader(new FileReader("/proc/self/status"))) {
|
||||
String line;
|
||||
while ((line = br.readLine()) != null) {
|
||||
if (line.startsWith("VmRSS:")) {
|
||||
String[] parts = line.split("\\s+");
|
||||
int kb = Integer.parseInt(parts[1]);
|
||||
|
||||
long duration = (System.nanoTime() - startTime) / 1000; // 微秒耗时
|
||||
Log.d("PerfMonitor", "getRSSMemoryMBProc took " + duration + "μs");
|
||||
|
||||
return kb / 1024;
|
||||
}
|
||||
}
|
||||
// 如果没有找到VmRSS行也记录耗时
|
||||
long duration = (System.nanoTime() - startTime) / 1000;
|
||||
Log.d("PerfMonitor", "getRSSMemoryMBProc (no data) took " + duration + "μs");
|
||||
} catch (Exception e) {
|
||||
long duration = (System.nanoTime() - startTime) / 1000;
|
||||
Log.e("PerfMonitor", "getRSSMemoryMBProc failed after " + duration + "μs", e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
```
|
||||
|
||||
耗时统计:
|
||||
|
||||
![[Pasted image 20250407134056.png]]
|
||||
|
||||
微秒和毫秒的换算:
|
||||
|
||||
![[Pasted image 20250407134132.png]]
|
||||
|
||||
![[Pasted image 20250407134143.png]]
|
@ -1,13 +0,0 @@
|
||||
#灵感
|
||||
|
||||
局域网 服务端地址
|
||||
|
||||
服务器 IP:[[192.168.1.177](http://192.168.1.177)]([http://192.168.1.177/](http://192.168.1.177/)) 用户:root 密码:cZr8YTtp
|
||||
|
||||
参考的上报日志 分析平台 演示:
|
||||
|
||||
[https://creporter.inspiregames.cn:81/](https://creporter.inspiregames.cn:81/) lg753951
|
||||
|
||||
这里是采集到,客户端发过来数据的接口逻辑:
|
||||
|
||||
![[Pasted image 20250314184241.png]]
|
@ -23,7 +23,6 @@
|
||||
|
||||
- [x] 记得申请一下,X项目组的,创作中心
|
||||
- [x] 处理一下 三消 谷歌相关的,同步到主干
|
||||
- [ ] 测试一下 是否可以还原 FMod缓存导致XAsset出包,数据异常的问题
|
||||
---
|
||||
3.第三章 亚当和夏娃的一天(Av113978432820994,P3).mp3 00H:38m:10s
|
||||
1.第1(Av485473214,P1).mp3 01H:58m:53s
|
||||
|
@ -27,7 +27,7 @@
|
||||
- [x] 买袜子相关
|
||||
- [x] 续费俩电信卡
|
||||
- [x] 调研 比亚迪 DM-i智驾120km超越型
|
||||
- [ ] 输出一份 PerfSight功能业务 调研报告
|
||||
- [x] 输出一份 性能检测系统 思维导图
|
||||
- [x] IAP支付 集成到中台库
|
||||
- [x] Facebook登录 集成到中台库
|
||||
- [x] 震动 延帧处理
|
||||
|
@ -31,7 +31,7 @@
|
||||
- [x] 明天记得买咖啡
|
||||
- [x] 明天记得买 化毛膏
|
||||
---
|
||||
[[性能监测平台]]
|
||||
[[性能监测平台 临时记录]]
|
||||
[[性能检测平台]]
|
||||
[[性能检测平台 临时记录]]
|
||||
[[灵感 安卓工程路径]]
|
||||
# Journal
|
||||
|
@ -24,7 +24,7 @@
|
||||
- [x] 把 AppLovin的函数,private改成公有的
|
||||
- [x] AppLovin 相关重发逻辑修改 还是对标官方的机制吧
|
||||
- [x] 准备一下 OKR复盘相关
|
||||
- [ ] 性能监测工具 测试一下 BufferReader读取内存文件 耗时
|
||||
- [x] 性能监测工具 测试一下 BufferReader读取内存文件 耗时
|
||||
- [ ] 性能监测工具,测试后台线程读取 机制和功能
|
||||
- [ ] 完善一下 打包机 打包失败的日志推送
|
||||
- [x] 补卡3月12号的
|
||||
|
@ -24,7 +24,7 @@
|
||||
- [x] 记得安排 骨传导 耳机退货
|
||||
- [x] 再过一遍 震动叠加的Seek逻辑是否还需要调整
|
||||
- [x] 试一下 旧版 消息推送 在老机器是否正常
|
||||
- [ ] 把性能监测工具客户端逻辑整理一下,上传到git
|
||||
- [x] 把性能监测工具客户端逻辑整理一下,上传到git
|
||||
---
|
||||
[[Adjust 临时记录]]
|
||||
# Journal
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
# 今日任务
|
||||
|
||||
- [ ] 探索一下 生成unity动画的ai流程
|
||||
- [ ] 探索一下 生成unity 2d动画的ai流程
|
||||
- [x] 记得今天申请一下 银行面签&办理护照 周二请假
|
||||
- [x] 今天也记得拿一下 快递
|
||||
- [x] 记得检查一下 网站服务器 续费 和处理一下 https签名
|
||||
|
@ -24,6 +24,8 @@
|
||||
- [ ] 明天要记得带身份证出门,去办理护照
|
||||
- [ ] 确认一下 xmind 8 双端
|
||||
- [ ] 买一下猫砂
|
||||
- [ ] 完成OKR制定
|
||||
---
|
||||
|
||||
[[安卓获取内存相关]]
|
||||
[[adb获取真机内存占用]]
|
||||
# Journal
|
||||
|
BIN
笔记文件/附件/Pasted image 20250407091527.png
Normal file
After Width: | Height: | Size: 939 KiB |
BIN
笔记文件/附件/Pasted image 20250407134056.png
Normal file
After Width: | Height: | Size: 202 KiB |
BIN
笔记文件/附件/Pasted image 20250407134132.png
Normal file
After Width: | Height: | Size: 35 KiB |
BIN
笔记文件/附件/Pasted image 20250407134143.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
笔记文件/附件/Pasted image 20250407142019.png
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
笔记文件/附件/Pasted image 20250407143343.png
Normal file
After Width: | Height: | Size: 479 KiB |
BIN
笔记文件/附件/Pasted image 20250407144019.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
笔记文件/附件/Pasted image 20250407144241.png
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
笔记文件/附件/Pasted image 20250407144250.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
笔记文件/附件/Pasted image 20250407144320.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
笔记文件/附件/Pasted image 20250407144330.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
笔记文件/附件/img_v3_02l0_ad3a491b-0a7b-4423-acf3-7d71ffc2c3hu.jpg
Normal file
After Width: | Height: | Size: 222 KiB |