无标题
入口程序启动初始化xlog 123456789101112131415161718192021222324+ (void)setup { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES); NSString *libraryDirectory = [paths firstObject]; // init xlog#if DEBUG xlogger_SetLevel(kLevelDebug); mars::xlog::appender_set_console_log(true);#else xlogger_SetLevel(kLevelInfo); appender_set_console_log(false);#endif mars::xlog::XLogConfig config; config.mode_ = mars::xlog::kAppenderAsync; ...
CMake ios code signing
Error MessageWhen I build soundtouch for ios, met following error 12error: Bundle identifier is missing. soundstretch doesn't have a bundle identifier. Add a value for PRODUCT_BUNDLE_IDENTIFIER in the build settings editor. (in target 'soundstretch' from project 'SoundTouch')note: Run script build phase 'Generate CMakeFiles/ALL_BUILD' will be run during every build because the option to run the script phase "Based on dependency analysis" is uncheck...
ios xib 总结
Apple M1 arm64 - IBDesignable error: “incompatible architecture” (have ‘x86_64’, need ‘arm64’)1Failed to render and update auto layout status for ViewController (BYZ-38-t0r): dlopen(ICONButton.app, 0x0001): tried: '/ICONButton' (no such file), '/Library/Developer/CoreSimulator/Volumes/iOS_21E213/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.4.simruntime/Contents/Resources/RuntimeRootICONButton.app' (no such file), 'ICONButton.app' (mach-o file, but is ...
Xcode 源码调试微信 xlog
Tencent/masr xlog macOS 源码调试get include folder1234567cd marspython build_osx.pyEnter menu:1. Clean && build.2. Gen OSX Project.3. Build xlog.4. Exit 选择1,生成 mars.framework, 我们主要是使用头文件目录。 gen osx project12345678cd marspython build_osx.pyEnter menu:1. Clean && build.2. Gen OSX Project.3. Build xlog.4. Exit# input 2 执行结果 1234-- ==============config mars====================-- Configuring done (6.6s)-- Generating done (0.0s)-- Build files have been written to: /Users/yxibng/G...
结构体位域中的高低位问题
测试代码如下: 1234567891011121314151617181920212223#include <iostream>union Test { unsigned char ch; struct { uint8_t a: 1; uint8_t b: 3; uint8_t c: 2; uint8_t d: 2; };};int main(int argc, const char * argv[]) { Test test; test.a = 1; test.b = 0; test.c = 0; test.d = 0b11; std::cout << test.ch << std::endl; return 0;} 在 macOS 上断点查看内存如下 结论:可以看到,定义在前的位域,在字节的低位。位域在内存中存储的顺序刚好与定义的先后相反。
GDB Examining Memory
参考:gdb/Output-Formatsgdb/Memory Output Formats x : Print the binary representation of the value in hexadecimal. d: Print the binary representation of the value in hexadecimal. u: Print the binary representation of the value as an decimal, as if it were unsigned. o: Print the binary representation of the value in octal. t: Print the binary representation of the value in binary. The letter ‘t’ stands for “two”. a: Print as an address, both absolute in hexadecimal and as an offset from...
oh my zsh prompt 展示当前路径
使用的主题为 1ZSH_THEME="robbyrussell" 修改配置, path ~/.oh-my-zsh/themes/robbyrussell.zsh-theme, 将 %c 替换为 %d 123456789# beforePROMPT="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ ) %{$fg[cyan]%}%c%{$reset_color%}"PROMPT+=' $(git_prompt_info)'# afterPROMPT="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )"PROMPT+=' %{$fg[cyan]%}%d%{$reset_color%} $(git_prompt_info)' 参考: EXPA...
webrtc iOS 源码调试
获取源码 install Chromium depot_tools install on Linux / Mac 12$ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git$ export PATH=/path/to/depot_tools:$PATH fetch source code 12fetch --nohooks webrtc_iosgclient sync 生成可调试项目Using Xcode 123cd $srcgn gen out/ios --args='target_os="ios" target_cpu="arm64" rtc_include_tests=false' --ide=xcodeopen -a Xcode.app out/ios/all.xcodeproj 选择 target AppRTCMobile 添加签名,运行 处理错误 解决方案, 修改 src/build/con...
使用 Apple Configurator 获取 ipa 文件
参考:Apple Configuration 2 获取ipa文件 工具 Apple Configurator可以在 Mac 的 App Store 中下载 操作 连接手机 点击 Add -> Apps -> 输入 app 名字 -> 点击添加 等待下载完成, 不要操作 去目录里找 ipa 文件 1~/Library/Group Containers/K36BKF7T3D.group.com.apple.configurator/Library/Caches/Assets/TemporaryItems/MobileApps/36244314-7400-420B-BC2A-AC3C4988F115/414478124/WeChat 8.0.33.ipa
open your terminal from xcode
参考: Open your terminal from Xcode 实现方式: 添加一个 Xcode Behaviors, 给 behavior 指定一个 shell script, behavior 触发的时候, 执行改脚本以当前目录打开 terminal。 步骤创建一个 shell 脚本 open-iterm-from-xcode 123456#!/bin/shdir="$PWD"# remove a potential suffix in case Xcode shows a Swift Packagesuffix="/.swiftpm/xcode"dir=${dir//$suffix/}open -a iterm "$dir 添加执行权限 1chmod +x open-iterm-from-xcode 添加 Xcode Behaviors 打开终端 也可以使用,快捷键 cmd + T
