Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Pythonで広がるXcodeデバッグの世界(pixiv App Night 2025/11/...
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
glassfiber
November 07, 2025
Programming
72
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Pythonで広がるXcodeデバッグの世界(pixiv App Night 2025/11/06) / pixiv App Night Xcode debugger with Python
XcodeのデフォルトデバッガであるLLDBは、Pythonを使って拡張することができます。 手軽で便利なものから、外部との連携を行うものまで、いくつかの応用例を紹介します。
glassfiber
November 07, 2025
More Decks by glassfiber
See All by glassfiber
数値を文字列に整形する際の落とし穴とその解決策(iOSDC2024 ルーキーズLT) / iOSDC Japan 2024 Formatting Floating-Point Numbers
glassfiber
0
1k
pixiv App Night 20240523 NumberFormatterのハマり事例
glassfiber
0
190
Other Decks in Programming
See All in Programming
型解析で実現する Go の言語内 DSL / Conference に Go! タイムテーブルの歩き方 for Gophers
mazrean
0
140
XHTMLが残したもの
yosuke_furukawa
PRO
2
640
What We Talk About When We Talk About XP
m_seki
2
450
AI Agent時代のリアーキテクチャ戦略と実践
hokaccha
7
3.5k
Go × SIMDで高速化するベクトル検索 ~ルーフラインモデルでSIMDが効く境界を探れ! ~
po3rin
1
200
フロントエンドUIフレームワークのこれまでとこれから
ssssota
5
2.1k
Hono + Inertia + React で LP を構築した話
oukayuka
2
220
App Storeの外へ──日本のiOSサイドローディング入門 for iOSDC Japan 2026
yuukiw00w
0
150
「AI時代、配布するPythonコードをどう守るか: 難読化の実験と判断軸」 #PyconJP2026
pkshadeck
PRO
2
190
【高い買い物LT会】初任給で話題の国産フィジカルAIを買った話
akagami
PRO
0
130
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
190
GraphRAGのKnowledge Graphを 直接!見る/View-GraphRAG's-KnowledgeGraph-directly!
tyumugi1113
1
280
Featured
See All Featured
Code Reviewing Like a Champion
maltzj
528
40k
How to Think Like a Performance Engineer
csswizardry
28
2.8k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
690
Building an army of robots
kneath
306
46k
[RailsConf 2023] Rails as a piece of cake
palkan
59
7k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
520
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.4k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.8k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
930
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
270
Transcript
2025/11/06 pixiv App Night PythonͰ͕ΔXcodeσόοάͷੈք glass fi ber
glass fi ber 𝕏 : glass fi ber (@glass fi
ber2023) w $SFBUPS%JWJTJPO%4FDUJPOJ04ΤϯδχΞ w 1BTUFMBͷJ1BE͚ΞϓϦ։ൃΛ୲ w ݄த్ೖࣾ w લ৬ήʔϜ։ൃऀ 14 9CPY J04 8JOEPXT
• iPad༻͓ֆඳ͖πʔϧ • ΄ͱΜͲͷػೳແྉͰ༻Մೳ
֓ཁ • XcodeσόοΨ͔ΒݺͿίϚϯυΛPythonͰ࡞Δ • Python͔ΒΞϓϦͷมʹΞΫηε͢Δํ๏ • ίϚϯυͷొํ๏ • Ԡ༻ྫ •
ωοτϫʔΫܦ༝ͰϓϨϏϡʔΛϦΞϧλΠϜදࣔ
• UISwiftɺίΞͷը૾ॲཧC++Ͱهड़
σόοΨͰC++ͷը૾ΛϓϨϏϡʔͰ͖ͳ͍ • UIImageCGImageXcodeͰϓϨϏϡʔͰ͖Δ • C++Ͱ͍࣋ͬͯΔσʔλϓϨϏϡʔͰ͖ͳ͍ • ྻͱͯ͠ͷཏྻݟΕΔ͕… ۄΞΠίϯ ը૾͕දࣔ͞ΕΔ
ͦ͏ͩɺPythonΛ͓͏ • XcodeσόοΨ͔ΒPythonεΫϦϓτΛίϚϯυͱͯ͠ݺΔ • Python͔ΒΞϓϦͷมʹΞΫηεͰ͖Δ →PythonͰʮݟΕΔʯܗࣜʹมͯ͠දࣔ͢Ε →ը૾ΛϓϨϏϡʔ͢ΔίϚϯυ͕࡞ΕΔʂ
Pythonͷ๛ͳϥΠϒϥϦΛ࣮ͬͯݱ • Xcode͔Βݺͼग़͢PythonεΫϦϓτͰɺpipͰΠϯετʔϧͰ͖Δ ϥΠϒϥϦΛ༻Մೳ • ը૾มϥΠϒϥϦ Pillow ΛͬͯRGBAྻΛpngʹม • มͨ͠pngΛςϯϙϥϦϑΝΠϧʹग़ྗ
→ϓϨϏϡʔΞϓϦͰදࣔ
มͷΞΫηε def display_CImage(debugger, command, result, internal_dict): args = command.split() var_name
= args[0] target = debugger.GetSelectedTarget() process = target.GetProcess() thread = process.GetSelectedThread() frame = thread.GetSelectedFrame() val = frame.FindVariable(var_name) if not val or not val.IsValid(): result.SetError(f"Could not find valiable '{var_name}'") return width_val = val.GetChildMemberWithName('m_width') height_val = val.GetChildMemberWithName('m_height') data_ptr_val = val.GetChildMemberWithName(‘m_buffer') width = width_val.GetValueAsUnsigned(0) height = height_val.GetValueAsUnsigned(0) data_addr = data_ptr_val.GetValueAsUnsigned(0) data_size = width * height * 4 ίϚϯυҾ (ݟ͍ͨը૾ͷม໊) มΛݟ͚ͭΔ ϝϯόมΛऔಘ PythonͰѻ͑Δʹ͢Δ σόοΨͷใ
ը૾Λม͢Δ image_data = process.ReadMemory(data_addr, data_size, error) try: img = Image.frombytes('RGBA',
(width, height), image_data) with tempfile.NamedTemporaryFile(prefix=TEMP_FILE_PREFIX, suffix=“.png”, delete=False) as temp_f: temp_path = temp_f.name img.save(temp_path, 'PNG') try: subprocess.run(['/usr/bin/qlmanage', '-p', temp_path], check=True, stderr=subprocess.DEVNULL, stdout=subprocess.DEVNULL) except FileNotFoundError: … except Exception as e: … RGBAྻ͔Β ը૾ʹม PNGͱͯ͠อଘ Quick LookΛىಈ ྫ֎ॲཧ(লུ)
ίϚϯυͱͯ͠ొ͢Δ • __lldb_init_moduleͱ͍͏ؔΛఆ͓͖ٛͯ͠ɺ~/.lldbinitͰimport͢Δ (image_display.py) def __lldb_init_module(debugger, internal_dict): # -f Ϟδϡʔϧ໊.໊ؔ
ͷؔΛ disp ͱ͍͏ίϚϯυ໊Ͱొ debugger.HandleCommand('command script add -f image_display.display_CImage disp') (.lldbinit) command script import ~/lldb_scripts/image_display.py ίϚϯυ໊ εΫϦϓτϑΝΠϧ໊
ίϚϯυ༻ྫ
ίϚϯυ༻ྫ
Ԡ༻ɾωοτϫʔΫͰૹ৴͢Δ • PythonωοτϫʔΫΞΫηεࣗ༝ࣗࡏ • ϩʔΧϧͰhttpαʔόʔΛಈ͔͠ɺૹ৴͢Δ • ϒϥβͰࣗಈߋ৽͠ͳ͕Βදࣔ • ϒϨʔΫϙΠϯτͷઃఆ •
ActionΛDebugger Commandʹͯ͠ ࡞ͨ͠ίϚϯυΛݺͿ • Automatically continue after evaluating actionsΛ༗ޮʹͯ͠ࢭ·Βͳ͍Α͏ʹ͢Δ
Ԡ༻ɾωοτϫʔΫͰૹ৴͢Δ • PythonωοτϫʔΫΞΫηεࣗ༝ࣗࡏ • ϩʔΧϧͰwebαʔόʔΛಈ͔͠ɺૹ৴͢Δ • ϒϥβͰࣗಈߋ৽͠ͳ͕Βදࣔ
Ԡ༻ɾωοτϫʔΫͰૹ৴͢Δ • PythonωοτϫʔΫΞΫηεࣗ༝ࣗࡏ • ϩʔΧϧͰwebαʔόʔΛಈ͔͠ɺૹ৴͢Δ • ϒϥβͰࣗಈߋ৽͠ͳ͕Βදࣔ
Ԡ༻ɾωοτϫʔΫͰૹ৴͢Δ • PythonωοτϫʔΫΞΫηεࣗ༝ࣗࡏ • ϩʔΧϧͰwebαʔόʔΛಈ͔͠ɺૹ৴͢Δ • ϒϥβͰࣗಈߋ৽͠ͳ͕Βදࣔ
·ͱΊ • PythonͰࣗ༻ίϚϯυΛ࡞Δ͜ͱͰɺXcodeͰͷσόοά͕ḿΔ • ͱ͍͑ɺҰ͔Β࡞Δͷେม… • Facebook(Meta)͕Chiselͱ͍͏LLDBίϚϯυूΛެ։͍ͯ͠Δ • https://github.com/facebook/chisel •
·ͣ͜ΕΛಋೖ͠ɺΓͳ͍ͷ͚ͩࣗͰ࡞Δ