温故而知新-0327-0331

1.git修改强制覆盖本地 #git

git fetch --all    //只是下载代码到本地,不进行合并操作
git reset --hard origin/分支名如master    //把HEAD指向最新下载的版本

2.Objective-C 获取当前线程调用栈 #objc

NSArray *callStackSymbols = [NSThread callStackSymbols];
NSLog(@"%@", callStackSymbols);

输出示例:

(
    "0   MyApp                       0x000000010b339d08 -[MyViewController viewDidLoad] + 136",
    "1   UIKitCore                      0x00007fff2e035038 -[UIViewController loadViewIfRequired] + 1184",
    "2   UIKitCore                      0x00007fff2e03548e -[UIViewController view] + 27",
    "3   UIKitCore                      0x00007fff2dc65ccd -[UIWindow addRootViewControllerViewIfPossible] + 150",
    "4   UIKitCore                      0x00007fff2dc65337 -[UIWindow _setHidden:forced:] + 302",
    "5   UIKitCore                      0x00007fff2dc76b28 -[UIWindow makeKeyAndVisible] + 42",
    "6   MyApp                       0x000000010b3385c5 -[AppDelegate application:didFinishLaunchingWithOptions:] + 165",
    "7   UIKitCore                      0x00007fff2d9bbbf9 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 281",
    "8   UIKitCore                      0x00007fff2d9bdd2c -[UIApplication _callInitializationDelegatesWithActions:forCanvas:payload:fromOriginatingProcess:] + 4524",
    "9   UIKitCore                      0x00007fff2d9c320c -[UIApplication _runWithMainScene:transitionContext:completion:] + 5980",
    "10  UIKitCore                      0x00007fff2c2c8d1e __111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 828",
    "11  UIKitCore                      0x00007fff2c2d503c +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 153",
    "12  UIKitCore                      0x00007fff2c2c897d -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 236",
    "13  UIKitCore                      0x00007fff2c2c9229 -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 1091",
    "14  UIKitCore                      0x00007fff2ccc3d32 __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 782",
    "15  UIKitCore                      0x00007fff2ccc3970 -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 433",
    "16  UIKitCore                      0x00007fff2d9f0c3e __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 576",
    "17  UIKitCore                      0x00007fff2d9f10fb _performActionsWithDelayForTransitionContext + 100",
    "18  UIKitCore                      0x00007fff2d9f0a7b -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 221",
    "19  UIKitCore                      0x00007fff2c2d41cf -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 392",
    "20  UIKitCore                      0x00007fff2d9c1dc2 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 514",
    "21  UIKitCore                      0x00007fff2c1d7c8a -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 361",
    "22  FrontBoardServices             0x00007fff365ccf5a -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 448",
    "23  FrontBoardServices             0x00007fff365d79e5 __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_3 + 225",
    "24  libdispatch.dylib               0x000000010c7cf77a _dispatch_client_callout + 8",
    "25  libdispatch.dylib               0x000000010c7d3033 _dispatch_block_invoke_direct + 301",
    "26  FrontBoardServices             0x00007fff366012a8 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 30",
    "27  FrontBoardServices             0x00007fff36600f67 -[FBSSerialQueue _performNext] + 457",
    "28  FrontBoardServices             0x00007fff3660143d -[FBSSerialQueue _performNextFromRunLoopSource] + 42",
    "29  CoreFoundation                 0x00007fff23a0a7be __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17",
    "30  CoreFoundation                 0x00007fff23a0a724 __CFRunLoopDoSource0 + 108",
    "31  CoreFoundation                 0x00007fff23a0a1b4 __CFRunLoopDoSources0 + 195",
    "32  CoreFoundation                 0x00007fff239fe79e __CFRunLoopRun + 1183",
    "33  CoreFoundation                 0x00007fff239fe0d2 CFRunLoopRunSpecific + 626",
    "34  GraphicsServices               0x00007fff38b2c2fe GSEventRunModal + 65",
    "35  UIKitCore                      0x00007fff2d9c47fc UIApplicationMain + 1621",
    "36  MyApp                       0x000000010b337bfc main + 76",
    "37  libdyld.dylib                  0x00007fff5228cb85 start + 1"
)

3.RSS

RSS 的全称是 Really Simple Syndication(简易信息聚合),它是一种消息来源的格式规范,网站可以按照这种格式规范提供文章的标题、摘要、全文等信息给订阅用户,用户可以通过订阅不同网站 RSS 链接的方式将不同的信息源进行聚合,在一个工具里阅读这些内容。 https://sspai.com/post/56391

  • MacOS RSS阅读:fluent reader
  • Android RSS阅读:Feedly
  • 一个MacOS小工具:utools(效率平台非RSS相关)

4.LangChain学习

持续学习中…


5.python 项目结构 #python

大部分人及Kenneth Reitz推荐的:https://github.com/navdeep-G/samplemod 目录结构:

.
├── LICENSE     # 许可证  
├── MANIFEST.in
├── Makefile    
├── README.rst  # 项目说明文档
├── docs        # 项目相关配置文件
│   ├── Makefile
│   ├── conf.py
│   ├── index.rst
│   └── make.bat
├── requirements.txt
├── sample      # 项目核心代码
│   ├── __init__.py
│   ├── core.py
│   └── helpers.py
├── setup.py    # 打包
└── tests
    ├── __init__.py
    ├── context.py
    ├── test_advanced.py
    └── test_basic.py

6.adb获取截图以及xml #adb

# 获取页面元素xml文件
os.system("adb shell uiautomator dump /sdcard/uidump.xml")
os.system(f"adb pull /sdcard/uidump.xml ./sample/init/{case_name}.xml")
# 获取页面截图
os.system("adb shell screencap -p /sdcard/screenshot.png")
os.system(f"adb pull /sdcard/screenshot.png ./sample/init/{case_name}.png")

7.adb拉起app #adb

# 通过package_name及activity_name拉起
def launch_app(package_name, activity_name):
	cmd = 'adb shell am start --activity-clear-top -n {}/{}'.format(package_name, activity_name)
	os.system(cmd)
# 通过urlscheme拉起
def launch_app_by_urlscheme(urlscheme):
	cmd = 'adb shell am start --activity-clear-top \"{}\"'.format(urlscheme)
	os.system(cmd)
comments powered by Disqus
Copyright © 2024 RainPot