<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>Nestvane Blog</title>
        <link>https://atomsprout.com/nestvane/blog/</link>
        <description>Nestvane Blog</description>
        <lastBuildDate>Wed, 25 Nov 2026 00:00:00 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>en</language>
        <item>
            <title><![CDATA[Nestvane 1.9 to 1.12: files, network, backups and KernelSU]]></title>
            <link>https://atomsprout.com/nestvane/blog/from-1-9-to-1-12/</link>
            <guid>https://atomsprout.com/nestvane/blog/from-1-9-to-1-12/</guid>
            <pubDate>Wed, 25 Nov 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[Four releases shaped by the feedback in issue]]></description>
            <content:encoded><![CDATA[<p>The last post ended at 1.8, with a plan for 1.9 to 2.3. Since then four more releases came out, and the plan changed: someone tried Nestvane properly and wrote down fourteen things that did not work for them, in <a href="https://github.com/atomsprout/nestvane/issues/5" target="_blank" rel="noopener noreferrer" class="">issue #5</a>. Most of what follows comes from that list.</p>
<p>This post goes through 1.9 to 1.12, the one big idea that was measured and dropped, and what comes next.</p>
<!-- -->
<p>The short version: APKs install from Android's own Files app, the shared folder is live, apps see a Wi-Fi network, Android has a low-memory killer, there is a backup of the whole Android, and the official KernelSU Manager works. The start on an iPhone 14 went from 9.1 to about 8.5 seconds.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-plan-changed">The plan changed<a href="https://atomsprout.com/nestvane/blog/from-1-9-to-1-12/#the-plan-changed" class="hash-link" aria-label="Direct link to The plan changed" title="Direct link to The plan changed" translate="no">​</a></h2>
<p>The old plan had 2.0 as "no paid developer account". Before building it, it was measured first, to see whether it could work at all. It cannot, not like this. Without the paid account's capability, iOS gives an app about 5 to 6 GiB of address space it can use. Android at its home screen uses about 34 GiB of address space here, because each process maps Android's files for itself. A software MMU would fix the address space, but on code that touches memory a lot it measured about 1.27 times slower, and the start would be 10 to 20 percent slower even with a paid account. So it is shelved, and the numbers are in the repository.</p>
<p>The version numbers changed too. 2.0 is kept for a real breakthrough, and until then releases go 1.10, 1.11 and so on. The order now follows issue #5: first what affects everyone (installing apps, files), then the network and freezes, then root and backups, then the camera.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="19-apps-own-libraries-faster">1.9: apps' own libraries, faster<a href="https://atomsprout.com/nestvane/blog/from-1-9-to-1-12/#19-apps-own-libraries-faster" class="hash-link" aria-label="Direct link to 1.9: apps' own libraries, faster" title="Direct link to 1.9: apps' own libraries, faster" translate="no">​</a></h2>
<p>iOS lets no app create machine code as it runs, so the native libraries an app brings with it are interpreted. Since 1.7 a thread that keeps interpreting moves to a core of its own. In 1.8 it still handed itself back to Android's main loop at every floating-point or SIMD instruction, and every time a system library it had called returned.</p>
<p>1.9 keeps it on its core. Every instruction that only changes registers, floating point and SIMD included, goes through the fast path, and returns from system libraries no longer fault. A million random instructions were run both ways with random register contents and gave the same results. On a benchmark the interpreter went from 168 to 195 million instructions a second on the main loop, and from 210 to 242 million on a worker core.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="110-installing-apps-and-moving-files">1.10: installing apps and moving files<a href="https://atomsprout.com/nestvane/blog/from-1-9-to-1-12/#110-installing-apps-and-moving-files" class="hash-link" aria-label="Direct link to 1.10: installing apps and moving files" title="Direct link to 1.10: installing apps and moving files" translate="no">​</a></h2>
<p><strong>APKs install from Android's Files app</strong> (issue #5, item 2). Tapping an APK in Files did nothing. The reason was a lock. Apps open shared files through Android's media library, and the media library first asks whether anyone holds a lock on the file, with a kind of lock (<code>F_OFD_GETLK</code>) that Nestvane's Linux layer did not answer. The call never returned, so everything opened through the media library waited forever. With the lock implemented, the installer asks, installs and offers to open the app.</p>
<p><strong>The shared folder is live</strong> (item 1). Files put into <em>On My iPhone → Nestvane → Android</em> from the Files app or a computer appear in Android within a few seconds, without restarting it.</p>
<p><strong>Pictures and videos open</strong> (item 9). Android here had no app to open them. A small viewer now does.</p>
<p><strong>APKs from other iOS apps</strong> (item 3) are recognized by their content, so a file shared under another name installs too. And there is a <strong>Recent Apps</strong> key next to Home (item 7).</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="111-network-recordings-and-freezes">1.11: network, recordings and freezes<a href="https://atomsprout.com/nestvane/blog/from-1-9-to-1-12/#111-network-recordings-and-freezes" class="hash-link" aria-label="Direct link to 1.11: network, recordings and freezes" title="Direct link to 1.11: network, recordings and freezes" translate="no">​</a></h2>
<p><strong>Apps see Wi-Fi</strong> (item 4). Android's network was Ethernet, and many apps count only Wi-Fi and cellular as being online. It is now reported to apps as a connected, validated Wi-Fi network.</p>
<p><strong>IPv6</strong> works where the phone's network has it.</p>
<p><strong>Export Diagnostics</strong> (item 10). Some freezes could not be reproduced here, so the More menu now writes one text file with what every Android thread is waiting for, memory, the system server's Java stacks and Android's recent log, ready to attach to a report.</p>
<p>The first diagnostics report found a real cause of freezes. Android's low-memory daemon, <code>lmkd</code>, had stopped at its very first system call in every version so far, so Android never knew which apps it could end. When the address space filled up, a new app could not start, and the app you tapped never opened. <code>lmkd</code> runs now, and when a new process finds no room, the cached app Android ranks lowest is ended first.</p>
<p><strong>A faster start.</strong> The new features first made the start slower, and the rule is that a release may not start slower than the one before. Profiling found three things: every <code>close</code> woke every waiting thread (26,000 times before the home screen), the table that finds translated code was written to its file one system call per page, and two lookups walked lists of thousands of entries. With those fixed, the start went from 8.7 to 8.4 seconds.</p>
<p>One thing was built and left out: Android's Wi-Fi service. It worked, but it made the start 0.3 seconds slower, and since apps already see Wi-Fi, only apps that talk to the Wi-Fi service directly need it. It moves to 1.14, started after the home screen is up.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="112-backups-and-kernelsu">1.12: backups and KernelSU<a href="https://atomsprout.com/nestvane/blog/from-1-9-to-1-12/#112-backups-and-kernelsu" class="hash-link" aria-label="Direct link to 1.12: backups and KernelSU" title="Direct link to 1.12: backups and KernelSU" translate="no">​</a></h2>
<p><strong>A backup of the whole Android</strong> (item 12). More → Back Up Android saves Android's apps, their data and its settings in one file, kept wherever you choose. More → Restore Android puts one back. What Android had before is kept until Android reaches its home screen from the backup, and is put back if it does not. An iPhone backup already includes Android's data, so this one is deliberately small: it is for going back to a moment, or moving only Android. On an iPhone 14, 507 MB of data made a 331 MB file, and restoring it took under a second.</p>
<p><strong>KernelSU</strong> (item 5). Nestvane has had root since 1.7: when an app runs <code>su</code>, iOS asks you, and Nestvane's Linux layer gives the app root. KernelSU works on the same idea. Root is decided in the kernel, and its Manager app talks to the kernel through a private driver. So instead of porting anything, Nestvane's Linux layer now answers KernelSU's driver itself, written from KernelSU's published interface.</p>
<p><img decoding="async" loading="lazy" alt="KernelSU Manager in Nestvane: its home screen says Working; its Superuser tab lists the apps; one app&amp;#39;s Superuser switch is on" src="https://atomsprout.com/nestvane/assets/images/kernelsu-76f2bbd7b64198993ff4d02b7c17bff0.png" width="1782" height="625" class="img_ev3q"></p>
<p>Install the official KernelSU Manager and it says <strong>Working</strong>. Its Superuser tab lists your apps, and each has a switch. The switches and the iOS prompt keep one set of answers: allow an app in either and the other shows it allowed. The Manager is recognized by the certificate its APK is signed with, the same check KernelSU does, so a look-alike app cannot take its place. Modules do not work yet: nothing runs KernelSU's <code>ksud</code> while Android starts.</p>
<p>Getting there found two bugs that had nothing to do with KernelSU:</p>
<ul>
<li class=""><strong>No program in <code>/data</code> could ever run.</strong> The Manager runs its own tool from its app's native library folder, and got "Permission denied". The files under <code>/data</code> are kept by Nestvane's Linux layer in a different form from the system image, and starting a program only accepted the system image's kind. Terminal apps and many root tools run programs this way too.</li>
<li class=""><strong>Ending a process with SIGTERM could hang the sender.</strong> When the target handled SIGTERM itself, the call was never finished. The Manager hit it while closing a root shell and sat on its splash screen forever.</li>
</ul>
<p>There is a guide to all of this now, <a class="" href="https://atomsprout.com/nestvane/docs/using/">Using Nestvane</a>, with KernelSU step by step.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="start-time">Start time<a href="https://atomsprout.com/nestvane/blog/from-1-9-to-1-12/#start-time" class="hash-link" aria-label="Direct link to Start time" title="Direct link to Start time" translate="no">​</a></h2>
<p>The rule from the last post still stands: before a release, Android is started six times on an iPhone 14, and the median of the last five may not be slower than the recorded number for the version before.</p>
<table><thead><tr><th>Version</th><th>Median of five starts, iPhone 14</th></tr></thead><tbody><tr><td>1.8</td><td>9.1 s</td></tr><tr><td>1.9</td><td>9.0 s</td></tr><tr><td>1.10</td><td>8.7 s</td></tr><tr><td>1.11</td><td>8.4 s</td></tr><tr><td>1.12</td><td>8.5 s</td></tr></tbody></table>
<p>1.12 needs an explanation. The first check was 0.25 seconds slower than 1.11, so 1.11 and 1.12 were installed in turn on the same phone: 1.12 was really about 0.4 seconds slower. Neither new feature ran during a start. What had changed was the layout in memory. The new KernelSU fields were added in the middle of the structure that holds the Linux layer's state, which moved every field after them. With the new fields moved to the end, 1.12 started in 8.55 and 8.50 seconds against 1.11's 8.75 and 8.58, taken in turn. The final check was 8.47 seconds. That is 78 milliseconds over the number recorded for 1.11, but the phone was slower that afternoon, so the recorded number stays at 1.11's.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-comes-next">What comes next<a href="https://atomsprout.com/nestvane/blog/from-1-9-to-1-12/#what-comes-next" class="hash-link" aria-label="Direct link to What comes next" title="Direct link to What comes next" translate="no">​</a></h2>
<table><thead><tr><th>Version</th><th>Goal</th></tr></thead><tbody><tr><td>1.13</td><td>The front camera, and photos and videos that save (issue #5, item 14)</td></tr><tr><td>1.14</td><td>Android rebuilt: a tablet layout on the iPad, hardware video decoding, a home screen that turns, the Wi-Fi service started after the home screen</td></tr></tbody></table>
<p>The rebuilt Android in 1.14 needs the build machine back from its snapshot first, which is why those items wait together.</p>
<p>What has not changed is the biggest problem: running Nestvane still needs a paid Apple developer account. And apps whose work is in their own native libraries remain slow, because those libraries are interpreted. Both are what 2.0 is kept for.</p>]]></content:encoded>
            <category>nestvane</category>
            <category>android</category>
            <category>ios</category>
            <category>release</category>
            <category>kernelsu</category>
        </item>
        <item>
            <title><![CDATA[How Nestvane works: Android 17 in an iOS app, without a JIT]]></title>
            <link>https://atomsprout.com/nestvane/blog/how-nestvane-works/</link>
            <guid>https://atomsprout.com/nestvane/blog/how-nestvane-works/</guid>
            <pubDate>Wed, 25 Nov 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[The design behind Nestvane, from Android rebuilt with five registers set aside and its code rewritten before the app is signed, to a Linux kernel written as part of the app, and where all of it stands today.]]></description>
            <content:encoded><![CDATA[<p>The earlier posts were about what happened: how Nestvane came to be, and what each release changed. This one is about how it works. Why it is built the way it is, what each part does, what was simplified on purpose, and where the design stands now, at 1.12.</p>
<!-- -->
<p>The short version: Android and the iPhone use the same instruction set, so Android's code is not translated into another language but rewritten in place, on the build machine, and signed into the app with everything else. The Linux kernel Android expects is not there, so the app contains one of its own. The only code that is interpreted is code nobody could know about when the app was built.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-constraint-everything-follows-from">The constraint everything follows from<a href="https://atomsprout.com/nestvane/blog/how-nestvane-works/#the-constraint-everything-follows-from" class="hash-link" aria-label="Direct link to The constraint everything follows from" title="Direct link to The constraint everything follows from" translate="no">​</a></h2>
<p>An emulator or a virtual machine normally relies on one of two things.</p>
<ul>
<li class="">A <strong>hypervisor</strong> runs the guest's code directly on the processor and steps in when it touches something it should not. iOS gives ordinary apps no hypervisor.</li>
<li class="">A <strong>JIT</strong> translates the guest's code into the host's while it runs. iOS does not let an app make memory executable: every page of code that runs must come from a file that was signed when the app was built.</li>
</ul>
<p>That leaves two ways to run one of Android's instructions: interpret it, or translate it before the app is signed. Interpreting always works, and it is slow. The very first version of Nestvane interpreted everything and took 606 seconds to reach Android's home screen on an iPhone 15 Pro. Booting runs about 18 billion instructions, and no interpreter loop is fast enough for that.</p>
<p>So the design splits the work by one question: <strong>is the code known when the app is built?</strong></p>
<ul>
<li class="">Android itself, about 1,230 programs and libraries, is known. It is translated ahead of time.</li>
<li class="">The native libraries inside an APK you install later are not. They are interpreted.</li>
</ul>
<p><img decoding="async" loading="lazy" alt="What happens at build time on a computer and at run time on the iPhone" src="https://atomsprout.com/nestvane/assets/images/architecture-c04df33688f89d995a6dfaea123030b9.png" width="1800" height="1185" class="img_ev3q"></p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="rewriting-not-translating">Rewriting, not translating<a href="https://atomsprout.com/nestvane/blog/how-nestvane-works/#rewriting-not-translating" class="hash-link" aria-label="Direct link to Rewriting, not translating" title="Direct link to Rewriting, not translating" translate="no">​</a></h2>
<p>Android on phones is ARM64, and so is the iPhone. A translation here does not change one instruction set into another. Almost every instruction can stay exactly as it is.</p>
<p>What cannot stay is anything that depends on <em>where</em> things are:</p>
<table><thead><tr><th>In Android's code</th><th>Why it cannot run as it is</th><th>What the rewriter puts there</th></tr></thead><tbody><tr><td>A load or store through a pointer</td><td>A guest address is not a host address</td><td>Look the address up first, then do the same access</td></tr><tr><td><code>adr</code>, <code>adrp</code> (addresses relative to the program counter)</td><td>The translation lives somewhere else</td><td>The guest address as a constant</td></tr><tr><td><code>br</code>, <code>blr</code>, <code>ret</code> (jumps to an address in a register)</td><td>The register holds a guest code address</td><td>Look up where that instruction's translation is, then jump</td></tr><tr><td><code>svc</code> (a system call)</td><td>It must not reach the iOS kernel</td><td>A jump into Nestvane's own kernel layer</td></tr><tr><td>Reading or writing the thread pointer</td><td>It belongs to the guest thread, not the host one</td><td>A load or store in the thread's context</td></tr></tbody></table>
<p>Everything else, which is most of the code, is copied unchanged. The rewriter is a Python script of about 800 lines. It reads an ELF file, walks its code four bytes at a time, and writes assembly that Apple's toolchain turns into Mach-O. The results are linked into 12 frameworks and signed with the app, so at run time the code is simply there, like any other code in the app.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="five-registers-set-aside">Five registers set aside<a href="https://atomsprout.com/nestvane/blog/how-nestvane-works/#five-registers-set-aside" class="hash-link" aria-label="Direct link to Five registers set aside" title="Direct link to Five registers set aside" translate="no">​</a></h2>
<p>Each rewritten sequence needs a few registers of its own: one pointing at the running thread's state, one at the table of where memory is, one at the table of where code is, and one to work in. If Android's code used every register, the rewriter would have to save and restore registers around each sequence, or analyse every function to find a free one.</p>
<p>Instead, Android is compiled from source with the compiler told never to touch five registers:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">-ffixed-x18 -ffixed-x25 -ffixed-x26 -ffixed-x27 -ffixed-x28</span><br></div></code></pre></div></div>
<p><img decoding="async" loading="lazy" alt="The five reserved registers, and one indirect branch after rewriting" src="https://atomsprout.com/nestvane/assets/images/registers-bc59188a23937ce113f45832a4ebd164.png" width="1800" height="1050" class="img_ev3q"></p>
<table><thead><tr><th>Register</th><th>Used for</th></tr></thead><tbody><tr><td><code>x25</code></td><td>The running guest thread's context</td></tr><tr><td><code>x26</code></td><td>The code table: guest instruction address to translated code</td></tr><tr><td><code>x27</code></td><td>The memory table of the process</td></tr><tr><td><code>x28</code></td><td>Scratch</td></tr><tr><td><code>x18</code></td><td>Nothing. iOS may clear it at any moment, so guest code must not depend on it</td></tr></tbody></table>
<p>Why not take a stock Android image and save the build? Because it was measured first. In the stock Android 17 image about 6% of instructions use <code>x25</code> to <code>x28</code>. The one register it leaves almost alone, <code>x18</code>, is not kept by iOS: a value written there was lost on every system call, and sometimes in the middle of plain arithmetic (941 times in 55,117 trials on an iPhone 15 Pro) when the thread was preempted.</p>
<p>The flag is not the whole job. Bionic's <code>setjmp</code>, ART's compiler and its entry code, and libraries with hand-written assembly (BoringSSL and the copies of it inside Cronet, parts of TensorFlow Lite) all had to be changed or built from their C paths. An audit script disassembles the built tree and lists any file that still names a reserved register. Losing the registers cost nothing measurable on benchmarks.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="memory-a-table-of-chunks">Memory: a table of chunks<a href="https://atomsprout.com/nestvane/blog/how-nestvane-works/#memory-a-table-of-chunks" class="hash-link" aria-label="Direct link to Memory: a table of chunks" title="Direct link to Memory: a table of chunks" translate="no">​</a></h2>
<p>A guest pointer is an Android address, and Android expects a lot of address space. At the home screen in the reference emulator, 117 processes had reserved about 1,500 GiB of addresses between them; the allocator alone reserves 8 GiB in every process. An iOS app gets about 53 GiB in total, and only with a paid developer account's extended addressing entitlement.</p>
<p>So guest memory is not one block. Each process's address space is cut into 1 MiB chunks, and a table holds, for each chunk, the offset to the host memory behind it. A memory access becomes three instructions in front of the original one:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">ubfx x28, xN, #20, #19     // which chunk</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">ldr  x28, [x27, x28, lsl #3]  // that chunk's offset</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">add  x28, x28, xN          // the host address</span><br></div></code></pre></div></div>
<p>Chunks that were never touched have no host memory at all, and their offset leads to an address where nothing can be mapped. An access there faults, and the fault still says which guest address was meant, so the kernel layer can give it memory and retry. Runs of chunks have guard pages on both sides, so a pointer that strays faults instead of reaching some other process's memory.</p>
<p>Two shortcuts keep it cheap. The stack pointer holds a host address, so the tenth of all instructions that use the stack need no rewriting. And an access through the same register as the one before reuses the address it already has.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="jumps-go-through-a-table-and-so-does-safety">Jumps go through a table, and so does safety<a href="https://atomsprout.com/nestvane/blog/how-nestvane-works/#jumps-go-through-a-table-and-so-does-safety" class="hash-link" aria-label="Direct link to Jumps go through a table, and so does safety" title="Direct link to Jumps go through a table, and so does safety" translate="no">​</a></h2>
<p>When code jumps to an address in a register, the address is a guest one. The translation looks it up in the code table, which has one entry for every guest instruction, and jumps to what it finds. Returns go through the table too: the link register keeps the guest's return address, so ART can walk its stacks unchanged. That costs about one percentage point.</p>
<p>The table is also how control flow is kept in bounds. A module's part of the table only exists once the process has really mapped that module at its address. A jump anywhere else faults on the look-up, which is a data access, before control goes anywhere.</p>
<p>That detail came from iOS. The first design marked special places with invalid addresses and caught the jump. On a Mac that worked; on iOS the process was killed outright, because jumping to an address that is not signed code is a code-signing violation, and it cannot be caught. Now every entry code can jump through is real code, a small stub that hands the address to the runtime.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="every-file-has-one-address">Every file has one address<a href="https://atomsprout.com/nestvane/blog/how-nestvane-works/#every-file-has-one-address" class="hash-link" aria-label="Direct link to Every file has one address" title="Direct link to Every file has one address" translate="no">​</a></h2>
<p>Because guest addresses are baked into the translation as constants, a library must be loaded exactly where it was translated for. Android normally loads libraries at random addresses, so:</p>
<ul>
<li class="">the build gives every file a fixed address, kept from build to build so that adding a file does not force everything to be translated again;</li>
<li class="">files are recognised by a hash of their content, not by path, since the same library can exist under twenty paths;</li>
<li class="">Android's dynamic linker is patched to ask where a file belongs. The answer comes in two extra entries of the auxiliary vector. On a real Linux kernel those entries are absent and the linker behaves as usual, so the same image still boots in Google's emulator, which is how every change is checked against a real kernel.</li>
</ul>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="a-linux-kernel-inside-the-app">A Linux kernel inside the app<a href="https://atomsprout.com/nestvane/blog/how-nestvane-works/#a-linux-kernel-inside-the-app" class="hash-link" aria-label="Direct link to A Linux kernel inside the app" title="Direct link to A Linux kernel inside the app" translate="no">​</a></h2>
<p>Android's programs ask the kernel for everything: memory, files, threads, timers, sockets, and Binder, through which Android's processes call each other. Inside an iOS app there is no Linux kernel to ask. So Nestvane has its own implementation of the Linux system call interface, in ordinary C++, which these posts call the kernel layer. It is about 13,500 lines in one file, plus Binder, the <code>/data</code> store and the network pieces around it.</p>
<p>It is not a port of Linux. It is written from how the interface behaves: what each call returns, in what order things happen, what <code>/proc</code> and <code>/sys</code> contain. A few principles run through it.</p>
<p><strong>Follow Linux exactly where Android depends on it.</strong> Seccomp filters run on every system call, as on Linux, because Android installs them on apps and media services and a filter that behaves differently changes what a process may do. Mount namespaces propagate mounts between them, because Android's storage daemon mounts in one namespace and every app must see it in its own. Binder is a full driver: transactions, references between processes, passing file descriptors, death notifications. Android's own <code>servicemanager</code> and everything above it run on it unmodified.</p>
<p><strong>Give a fixed answer where Android only needs an answer.</strong> SELinux is enforcing, and Android asks it questions all the time. There is no policy engine: the answers were captured from a real kernel when the system image was built and are served from tables. Shared storage on Android is a FUSE file system served by the media provider; here the FUSE mount is simply a view of the folder, and the daemon receives its first message and nothing after. Both are written down as limits: a decision that was not captured is not there, and shared storage has no per-app access control.</p>
<p><strong>Stop loudly on what is missing.</strong> An unknown system call is not answered with an error and forgotten. The calling process is stopped and the call is named in the log. A wrong answer tends to show up much later as some unrelated failure; a stop names the cause.</p>
<p><strong>One thread for the kernel.</strong> Every system call of every Android process runs on one host thread, one at a time. The kernel layer needs no locks, and a long list of hard bugs never exists. Threads that only compute can move to other cores (below), and come back for their next system call.</p>
<p>A system call is cheap in this design. The rewritten <code>svc</code> saves the guest's registers and returns to the main loop, which checks the seccomp filters and calls the kernel layer. Most calls never leave it: a pipe read, a futex wake, a Binder transaction or an <code>mmap</code> is the kernel layer's own business. Only files, network and graphics reach iOS.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-interpreter-and-mixing-the-two">The interpreter, and mixing the two<a href="https://atomsprout.com/nestvane/blog/how-nestvane-works/#the-interpreter-and-mixing-the-two" class="hash-link" aria-label="Direct link to The interpreter, and mixing the two" title="Direct link to The interpreter, and mixing the two" translate="no">​</a></h2>
<p>The native libraries an installed app brings with it were not known at build time, so they have no translation. They are interpreted, in the same process as translated code.</p>
<p>Those libraries are placed in a fixed 1 GiB range of guest addresses that the code table covers with no entries. When translated code calls into one, the table look-up faults, the interpreter takes over at that address, and native execution resumes as soon as control comes back to code that has a translation. The same mechanism handles a single translated instruction that faults (its memory not there yet, say): the registers are still as they were before it, so the interpreter runs just that one instruction and native code carries on.</p>
<p>Mixing has a catch that took a while to see. Translated code can run every instruction the processor has, so the interpreter must know every instruction translated code might be in the middle of when a fault hands it over, not only what app libraries contain. A gallery app once stopped dead because the interpreter met a timer read it had not been taught.</p>
<p>The interpreter has had most of the speed work since 1.0. Common instructions are decoded once into a form that runs directly, a thread that keeps interpreting moves to a core of its own, and since 1.9 even floating-point and SIMD instructions stay on that core. Each fast path was checked against the plain interpreter with hundreds of thousands to a million random instructions. It is still the slowest part of Nestvane by far: apps whose work is in their own native libraries, games and some script engines, are much slower than apps written in Java or Kotlin.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="devices">Devices<a href="https://atomsprout.com/nestvane/blog/how-nestvane-works/#devices" class="hash-link" aria-label="Direct link to Devices" title="Direct link to Devices" translate="no">​</a></h2>
<p>The kernel layer presents device nodes, and behind some of them is the iPhone:</p>
<ul>
<li class=""><strong>Graphics.</strong> Android uses the graphics drivers of Google's emulator. They talk through a pipe device to gfxstream, a renderer running in the app that draws with ANGLE on Metal. Finished frames go to the screen as surfaces on the graphics processor, at up to 120 Hz.</li>
<li class=""><strong>Storage.</strong> <code>/data</code> is a SQLite database, with large files kept as host files. Shared storage is a real folder, which the Files app shows.</li>
<li class=""><strong>Network.</strong> Android sees one network, reported to apps as Wi-Fi. Each of its connections to the outside is carried by a host socket, and name look-ups go through iOS's own resolver.</li>
<li class=""><strong>The rest.</strong> Touch arrives through an input device, sound through a sound card that plays on the phone, and the battery and time zone are the phone's. Root, since 1.12, is decided in the kernel layer, which also answers KernelSU's driver for the official KernelSU Manager.</li>
</ul>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="from-606-seconds-to-85">From 606 seconds to 8.5<a href="https://atomsprout.com/nestvane/blog/how-nestvane-works/#from-606-seconds-to-85" class="hash-link" aria-label="Direct link to From 606 seconds to 8.5" title="Direct link to From 606 seconds to 8.5" translate="no">​</a></h2>
<p>Rewriting instead of interpreting was the big step: the first full start on the new route took 110 seconds, on an iPhone 11, instead of minutes. Everything after that came from finding work that did not need doing, and almost none of it was where anyone expected:</p>
<ul>
<li class="">Android waited three seconds at a time for a missing daemon (<code>lmkd</code>): 50 of those 110 seconds were sleep.</li>
<li class="">Every memory request moved all of a process's several thousand segments, not just the ones it touched.</li>
<li class="">97 shaders were compiled at boot while the interface waited for them.</li>
<li class="">Code tables of 642 MiB were copied at every start. They are now built a page at a time when first used.</li>
<li class="">When the app has not run for a while, its translated code is no longer in memory, and the one thread running Android waits for each page. Pages that a start uses are now read in ahead on other cores.</li>
<li class="">In 1.11, every <code>close</code> woke every waiting thread, 26,000 times before the home screen.</li>
</ul>
<p>The method was the same every time: a timestamp on every log line, then read down until the times stop adding up.</p>
<p>Since 1.6 there is a rule: before each release Android is started six times on an iPhone 14, and the median of the last five may not be slower than the version before. On the iPhone 14, with iOS 17, it is about 8.4 to 8.5 seconds; on an iPhone 17 Pro it was about 7.3 when last recorded.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="where-it-stands-at-112">Where it stands at 1.12<a href="https://atomsprout.com/nestvane/blog/how-nestvane-works/#where-it-stands-at-112" class="hash-link" aria-label="Direct link to Where it stands at 1.12" title="Direct link to Where it stands at 1.12" translate="no">​</a></h2>
<p><strong>What runs.</strong> Android 17 built from AOSP, with its real <code>init</code>, <code>zygote</code>, <code>system_server</code>, SurfaceFlinger, SystemUI, Launcher3, Settings and package installer. APKs install from the More menu, from any iOS app's share sheet, or from Android's own Files app. Apps have network, a WebView, video and sound, home-screen widgets, a shared folder with the Files app, root with an iOS prompt or the KernelSU Manager, and a backup of the whole of Android. It needs iOS 17 or later and 6 GB of memory.</p>
<p><strong>How big.</strong> About 31,000 lines of C++ in the runtime, of which the kernel layer is the largest part, and about 3,400 lines in the iOS app around it. The rewriter is about 800 lines of Python, and the AOSP patch is one script.</p>
<p><strong>What the design costs.</strong></p>
<ul>
<li class=""><strong>A paid Apple developer account.</strong> Every Android process takes host address space of its own, and the total needs the extended addressing entitlement. Before 2.0 this was measured: without the entitlement iOS lets an app use 5 to 6 GiB, and Android at its home screen uses about 34 GiB, because each process maps Android's files for itself. A software MMU with one shared pool would fix the address space, but measured about 1.27 times slower on memory-heavy code. That would be a different design, not a patch, and it is shelved.</li>
<li class=""><strong>Apps' own native code is interpreted.</strong> No translation can exist for code that arrives after the app is signed.</li>
<li class=""><strong>One kernel thread.</strong> System calls never run in parallel.</li>
<li class=""><strong>Simplified on purpose.</strong> SELinux answers are captured, not computed; shared storage has no per-app access control; there are no Google Play services, because the system is plain AOSP.</li>
</ul>
<p>Each of these is a consequence of the first constraint, not an accident, and each is written down in the repository with the measurements behind it: <a href="https://github.com/atomsprout/nestvane/blob/main/docs/architecture.md" target="_blank" rel="noopener noreferrer" class="">the architecture</a>, <a href="https://github.com/atomsprout/nestvane/blob/main/docs/static-rewriting.md" target="_blank" rel="noopener noreferrer" class="">static rewriting</a>, <a href="https://github.com/atomsprout/nestvane/blob/main/docs/kernel-layer.md" target="_blank" rel="noopener noreferrer" class="">the kernel layer</a>, <a href="https://github.com/atomsprout/nestvane/blob/main/docs/design-notes.md" target="_blank" rel="noopener noreferrer" class="">design notes</a>, and the lab record behind all of them.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-would-change-the-design">What would change the design<a href="https://atomsprout.com/nestvane/blog/how-nestvane-works/#what-would-change-the-design" class="hash-link" aria-label="Direct link to What would change the design" title="Direct link to What would change the design" translate="no">​</a></h2>
<p>Two things would move Nestvane past what it is now, and those are what 2.0 is kept for: running without the paid account, and running apps' native libraries without interpreting them. Neither has an answer yet. Until one of them does, the work goes into the releases in between: the camera in 1.13, and in 1.14 a rebuilt Android with a tablet layout on the iPad, hardware video decoding and a home screen that turns.</p>]]></content:encoded>
            <category>nestvane</category>
            <category>android</category>
            <category>ios</category>
            <category>design</category>
        </item>
        <item>
            <title><![CDATA[Nestvane 1.1 to 1.8: what changed in two days, and what comes next]]></title>
            <link>https://atomsprout.com/nestvane/blog/from-1-1-to-1-8/</link>
            <guid>https://atomsprout.com/nestvane/blog/from-1-1-to-1-8/</guid>
            <pubDate>Tue, 24 Nov 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[Eight releases after the first one, from 120 Hz and text messages to WebView, root and clearing background apps, and the plan for 1.9 to 2.3.]]></description>
            <content:encoded><![CDATA[<p>Nestvane 1.0 came out on 22 November: Android 17 inside an iPhone app, about ten seconds to the home screen, with apps installed from APK files. Two days later it is at 1.8.</p>
<p>This post goes through what those eight releases did, what did not work out, and what the next five versions are meant to do.</p>
<!-- -->
<p>The short version: Android now runs on iOS 17 and on an iPhone 14, it has a WebView, it has root when you want it, and it starts faster than it did. What still has not changed is the biggest problem: you need a paid Apple developer account to install it.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="11-and-12-the-small-things-a-phone-does">1.1 and 1.2: the small things a phone does<a href="https://atomsprout.com/nestvane/blog/from-1-1-to-1-8/#11-and-12-the-small-things-a-phone-does" class="hash-link" aria-label="Direct link to 1.1 and 1.2: the small things a phone does" title="Direct link to 1.1 and 1.2: the small things a phone does" translate="no">​</a></h2>
<p>The first two releases were about things you notice within a minute of using it.</p>
<p><strong>120 Hz.</strong> Android drew 60 frames a second whatever the screen could do. The cause was that resource overlays for the Android framework itself were never applied, and that is where the display's rate is set. With that fixed, a ProMotion screen gets 120. It is off until you turn it on, because it costs battery.</p>
<p><strong>Text messages you write yourself.</strong> Android here has no radio and no phone number. A menu item hands Android a sender and a text, and Messaging shows it as an incoming message. In 1.2 it is also announced to apps the way a real SMS is, so an app that waits for a code by SMS receives it. Nothing is sent to anyone.</p>
<p><strong>A shorter way to the screen.</strong> Each frame used to be read back from the graphics processor and handed to iOS as a picture. Now it is copied on the graphics processor into a surface iOS shows as it is, just before the screen refreshes.</p>
<p><strong>Changing network.</strong> Going from Wi-Fi to cellular left apps waiting on connections that led nowhere. Nestvane now ends them, as Android on a phone does, and apps reconnect at once.</p>
<p>There was also an update notice, a lower frame rate when the phone is hot, and a menu item that opens a GitHub issue with the versions already filled in.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="13-and-14-older-phones-and-apps-that-stopped-everything">1.3 and 1.4: older phones, and apps that stopped everything<a href="https://atomsprout.com/nestvane/blog/from-1-1-to-1-8/#13-and-14-older-phones-and-apps-that-stopped-everything" class="hash-link" aria-label="Direct link to 1.3 and 1.4: older phones, and apps that stopped everything" title="Direct link to 1.3 and 1.4: older phones, and apps that stopped everything" translate="no">​</a></h2>
<p>1.0 needed iOS 26 and was tested on phones with 8 GB of memory. <strong>1.3 runs on iOS 17</strong>, and on an iPhone 14 with 6 GB. Android used 2.3 GB of it.</p>
<p>The same release found why many apps quit as they started. Android here uses the iPhone's 16 KiB memory pages, and most apps still ship libraries laid out for 4 KiB pages. Android refused all of them. They now load the compatible way, and a list of tried apps started: twenty of twenty-two opened.</p>
<p>1.3 also showed a bad bug. Opening DuckDuckGo or Feeder froze the whole of Android. Both have a library written in Go, and the interpreter that runs apps' own libraries met an instruction it did not know and stopped the entire run. <strong>1.4 fixed that</strong>, along with a limit that kept Android from starting any app once about thirty were installed.</p>
<p>1.4 was also the first release for the <strong>iPad</strong>. Before, the display had a phone's pixels, enlarged. Now an 11-inch iPad Air gets 1160 × 1578, sharp and filling the screen. It is still laid out as a phone, and that is still true in 1.8.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="15-more-apps-turning-video-the-microphone">1.5: more apps, turning, video, the microphone<a href="https://atomsprout.com/nestvane/blog/from-1-1-to-1-8/#15-more-apps-turning-video-the-microphone" class="hash-link" aria-label="Direct link to 1.5: more apps, turning, video, the microphone" title="Direct link to 1.5: more apps, turning, video, the microphone" translate="no">​</a></h2>
<p>1.5 tried thirty-two more apps, Telegram, Signal, Firefox, Element and OsmAnd among them. Fifty of fifty-four opened.</p>
<p><strong>Turning the device turns Android.</strong> An app that asks for landscape, a game for example, is shown the right way up and touches land where you put your finger. The home screen itself still does not turn; more on that below.</p>
<p><strong>1080p video.</strong> H.264 and HEVC play at 1080p and 30 frames a second, decoded in software. Before, an HEVC video stopped the decoder: its hand-written assembly used registers that the translated code keeps for itself.</p>
<p><strong>The microphone.</strong> An Android app that records gets the device's microphone, and iOS asks the first time.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="16-webview">1.6: WebView<a href="https://atomsprout.com/nestvane/blog/from-1-1-to-1-8/#16-webview" class="hash-link" aria-label="Direct link to 1.6: WebView" title="Direct link to 1.6: WebView" translate="no">​</a></h2>
<p>Many apps show web pages inside themselves, and Android had no WebView. Toutiao and Douyin opened to nothing. AnkiDroid and Jellyfin needed one too.</p>
<p>The difficulty was not Chromium itself. Android's own code is built with five processor registers left free for Nestvane. WebView's library is a prebuilt binary that uses all of them. So the translator learned to lend other registers in their place, and now code built the ordinary way can be translated ahead of time like the rest.</p>
<p>The Linux layer also needed new things: reservations of tens of GiB of address space, abstract Unix sockets, <code>seccomp()</code> with <code>SIGSYS</code>, a TCP peek. A Wikipedia article now loads in a WebView in about 4 seconds on an iPad Air and 8 on an iPhone 14. JavaScript runs in V8's interpreter, with no JIT. 51 of the 54 apps open.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="17-root-storage-and-faster-native-libraries">1.7: root, storage, and faster native libraries<a href="https://atomsprout.com/nestvane/blog/from-1-1-to-1-8/#17-root-storage-and-faster-native-libraries" class="hash-link" aria-label="Direct link to 1.7: root, storage, and faster native libraries" title="Direct link to 1.7: root, storage, and faster native libraries" translate="no">​</a></h2>
<p><strong>Root, if you want it.</strong> It is off until you turn it on. Then <code>su</code> exists, and the first time an app runs it, iOS asks whether that app may have root. An allowed app gets uid 0, every capability and an SELinux domain that may do anything.</p>
<p>Building root turned up three bugs that hit every app. Java's <code>Runtime.exec</code> and <code>ProcessBuilder</code> hung the calling thread, because <code>vfork</code> was missing and so was asking a pipe how much it holds. The usual commands such as <code>ls</code>, <code>id</code> and <code>ps</code> were not in <code>/system/bin</code> either. All three are fixed.</p>
<p><strong>Your device's storage.</strong> Android saw a fixed 8 GiB. Now it sees the volume Nestvane is on and what iOS says is free.</p>
<p><strong>Apps' own native libraries run about twice as fast.</strong> They are still interpreted, because iOS lets no app make machine code as it runs. But common instructions are now decoded once. A thread that keeps interpreting moves to a core of its own, and the system libraries it calls still run as translated code. Each pre-decoded instruction is checked against the old interpreter on random inputs, 406,093 of them, all the same.</p>
<p><strong>A calmer start.</strong> Apps you installed now wait until the home screen is shown. A chat app syncing at boot used to take the processor from Android's own start.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="18-small-fixes">1.8: small fixes<a href="https://atomsprout.com/nestvane/blog/from-1-1-to-1-8/#18-small-fixes" class="hash-link" aria-label="Direct link to 1.8: small fixes" title="Direct link to 1.8: small fixes" translate="no">​</a></h2>
<p>1.8 was meant to be small, and it was.</p>
<p><strong>Storage that adds up.</strong> 1.7 gave Android's data partition the whole volume, and Android adds the system partition before rounding up, so a 256 GB iPhone showed 512 GB. Now it shows 256.</p>
<p><strong>Clear background apps.</strong> Touch and hold Home in Nestvane's bar and choose Clear Background Apps. On an iPad Air memory went from 4.42 GB to 2.83 GB.</p>
<p>While testing it, two clears in three with a WebView in the background brought Android down. <code>system_server</code> aborted with "Unexpected BR_REPLY" and everything restarted. The cause was in our Binder. When a process died while another thread was calling it, the death notice went to that very thread. It ran the death handler inside its call, and the call's own reply then arrived at the wrong place. Linux treats a death notice as work for the whole process, and now Nestvane does too. This was not only a problem for the new button: Android ending an app on its own could hit it.</p>
<p><strong>Checked after release.</strong> With the microphone allowed in iOS, a test app on an iPad Air recorded the room, and Android turned with the iPad when it was turned by hand. Both had been owed since 1.5.</p>
<p><strong>Root shells and names.</strong> An app can keep <code>su</code> open and write commands to it, as terminal apps do. The root prompt shows the app's name, not only its package.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="boot-time-may-only-get-faster">Boot time may only get faster<a href="https://atomsprout.com/nestvane/blog/from-1-1-to-1-8/#boot-time-may-only-get-faster" class="hash-link" aria-label="Direct link to Boot time may only get faster" title="Direct link to Boot time may only get faster" translate="no">​</a></h2>
<p>After 1.6 shipped I realized I had no like-for-like comparison of its boot time against 1.5. So there is now a rule: before every release, start Android six times on a test device and take the median of the last five. If it is slower than the recorded baseline for that model, the release waits until the reason is found.</p>
<p>This is harder than it sounds, because one build can vary by 3 seconds from start to start on the same phone. The first check for 1.8 failed at 12.5 seconds. Rather than loosen the rule, I ran 1.7 and 1.8 in turn on the same phone. 1.7 was slower still then, at 13.4. A test app had been left installed with an unanswered iOS permission prompt. With it removed, the two took the same time, and the recorded run for 1.8 was 9.1 seconds against 1.7's 10.9.</p>
<table><thead><tr><th>Device</th><th>Boot to the home screen, median of five</th></tr></thead><tbody><tr><td>iPhone 17 Pro</td><td>7.3 s</td></tr><tr><td>iPad Air (M3)</td><td>7.6 s</td></tr><tr><td>iPhone 14</td><td>9.1 s</td></tr></tbody></table>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-did-not-work-out">What did not work out<a href="https://atomsprout.com/nestvane/blog/from-1-1-to-1-8/#what-did-not-work-out" class="hash-link" aria-label="Direct link to What did not work out" title="Direct link to What did not work out" translate="no">​</a></h2>
<ul>
<li class=""><strong>ScriptWidget's widget previews still do not appear.</strong> Its script engine is a native library, and it sets a deadline on every script. Interpreted, the scripts run past it. Doubling the speed was not enough.</li>
<li class=""><strong>Douyin still shows no video</strong>, for the same reason.</li>
<li class=""><strong>The home screen does not turn.</strong> Launcher3 controls it with a preference, not a resource we can override. It needs more than a day.</li>
<li class=""><strong>KDE Connect keeps stopping.</strong> It asks for Android's Wi-Fi service, which does not exist here, and gets nothing back.</li>
</ul>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-comes-next">What comes next<a href="https://atomsprout.com/nestvane/blog/from-1-1-to-1-8/#what-comes-next" class="hash-link" aria-label="Direct link to What comes next" title="Direct link to What comes next" translate="no">​</a></h2>
<table><thead><tr><th>Version</th><th>Goal</th></tr></thead><tbody><tr><td>1.9</td><td>Apps' own native libraries faster again</td></tr><tr><td>2.0</td><td>No paid developer account</td></tr><tr><td>2.1</td><td>KernelSU compatibility</td></tr><tr><td>2.2</td><td>The home screen turns, a live shared folder, IPv6, a Wi-Fi service</td></tr><tr><td>2.3</td><td>A tablet layout on the iPad, hardware video decoding</td></tr></tbody></table>
<p><strong>1.9 makes the interpreter faster, for every app.</strong> Floating-point and SIMD instructions into the fast path, since they are now the commonest reason a worker thread stops. Interpretation cached by block. Fewer faults at block edges. Translating one app's library ahead of time is off the table: when the app updates, the library changes and the work is lost. Speed will be measured on a benchmark and a mix of apps, not tuned to one.</p>
<p><strong>2.0 tries to do without the paid account.</strong> This is the one people ask about most. Nestvane needs a capability for a large address space, and only paid accounts get it. To fit a free account, everything has to come in under about 7 GiB of address space, and today the code tables, the translated code and the system image alone take about that much. The plan is a software MMU: every Android process shares one pool of memory, mapped on demand through page tables. It is the riskiest item. It starts with one or two days of measuring, and if the numbers say no, it stops there.</p>
<p><strong>2.1 is KernelSU compatibility</strong>, starting with KernelSU Manager being able to grant and revoke root for apps. Magisk and Zygisk, which inject code into zygote, are not planned.</p>
<p><strong>2.2 is everyday fixes:</strong> the home screen turning with the device; files put in the shared folder showing up without a restart; IPv6; and a Wi-Fi service that at least tells apps Wi-Fi is off, so KDE Connect and others stop crashing.</p>
<p><strong>2.3 needs Android rebuilt from source:</strong> a tablet layout on the iPad, and video decoded by the device's hardware.</p>
<p>The days these take are estimates from the pace so far, not promises. The full plan, in Chinese, is <a href="https://github.com/atomsprout/nestvane/blob/main/docs/zh-CN/roadmap.md" target="_blank" rel="noopener noreferrer" class="">in the repository</a>.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="try-it">Try it<a href="https://atomsprout.com/nestvane/blog/from-1-1-to-1-8/#try-it" class="hash-link" aria-label="Direct link to Try it" title="Direct link to Try it" translate="no">​</a></h2>
<p><a href="https://github.com/atomsprout/nestvane/releases/tag/v1.8" target="_blank" rel="noopener noreferrer" class="">Nestvane 1.8 is on GitHub</a>. It needs iOS 17 or later, 6 GB of memory, and, for now, a paid Apple Developer Program membership to sign and sideload it. If something breaks, the More menu has a Submit a Bug item that opens an issue with your versions filled in.</p>]]></content:encoded>
            <category>nestvane</category>
            <category>android</category>
            <category>ios</category>
            <category>release</category>
        </item>
        <item>
            <title><![CDATA[I don't know Android internals. AI still got Android 17 running inside an iPhone app in four days.]]></title>
            <link>https://atomsprout.com/nestvane/blog/android-17-inside-an-iphone-app/</link>
            <guid>https://atomsprout.com/nestvane/blog/android-17-inside-an-iphone-app/</guid>
            <pubDate>Sun, 22 Nov 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[How Nestvane was built in four days by one person directing coding agents, what it measures, and what it cannot do yet.]]></description>
            <content:encoded><![CDATA[<p>I made an iOS app called Nestvane. Open it and a full Android 17 system starts inside: about 10 seconds to the home screen, and it installs apps from APK files. There is no JIT, and the phone is not jailbroken.</p>
<p>I did not write the code. I directed AI coding agents that did. I do not know Android's internals, and from the first commit to a public repository it took a little over four days.</p>
<!-- -->
<p>The numbers below come from the lab record in the repository, measured on an iPhone 15 Pro and an iPhone 17 Pro.</p>
<p>If you would rather see it first:</p>
<ul>
<li class=""><a href="https://www.youtube.com/shorts/wDVr3-UY1Ec" target="_blank" rel="noopener noreferrer" class="">A short video of it running</a></li>
<li class=""><a href="https://github.com/atomsprout/nestvane" target="_blank" rel="noopener noreferrer" class="">The source on GitHub</a></li>
</ul>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="how-it-started">How it started<a href="https://atomsprout.com/nestvane/blog/android-17-inside-an-iphone-app/#how-it-started" class="hash-link" aria-label="Direct link to How it started" title="Direct link to How it started" translate="no">​</a></h2>
<p>I have written software for Windows, iOS and macOS for many years. I have hardly touched Android.</p>
<p>In November I saw two projects that both ran Android inside an iPhone app: <a href="https://twoyi.app/" target="_blank" rel="noopener noreferrer" class="">Twoyi</a>, and the open-source <a href="https://github.com/imxieyi/Kernarium" target="_blank" rel="noopener noreferrer" class="">Kernarium</a>. What I wanted to know was how far an AI could get on something I do not understand at all.</p>
<p>So I tried.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="why-this-is-hard">Why this is hard<a href="https://atomsprout.com/nestvane/blog/android-17-inside-an-iphone-app/#why-this-is-hard" class="hash-link" aria-label="Direct link to Why this is hard" title="Direct link to Why this is hard" translate="no">​</a></h2>
<p>There are two usual ways to run another system's programs on an iPhone, and iOS closes both.</p>
<p>Virtualization is not open to ordinary apps. A JIT is out too: it creates machine code while the app runs, and iOS does not let an app do that.</p>
<p>That leaves the slow ways. Interpret the code one instruction at a time, or translate all of it before the app is packaged. The first is slow to run. The second is a lot of work.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-first-version-took-ten-minutes-to-boot">The first version took ten minutes to boot<a href="https://atomsprout.com/nestvane/blog/android-17-inside-an-iphone-app/#the-first-version-took-ten-minutes-to-boot" class="hash-link" aria-label="Direct link to The first version took ten minutes to boot" title="Direct link to The first version took ten minutes to boot" translate="no">​</a></h2>
<p>For the first two days I used Codex (GPT-6.2 Sol).</p>
<p>It took the interpreter road. First one very simple Android program ran, then whatever was missing was added: processes, files, Binder (what the parts of Android use to talk to each other), graphics, touch. Android's programs believed they were on Linux. The Linux underneath was something we wrote.</p>
<p>After two days Android 17 really did reach its home screen, and it installed APKs.</p>
<p>It just took 606 seconds. On an iPhone 15 Pro, ten minutes.</p>
<p>Later we counted: booting executes about 18.4 billion instructions, and every one of them went around the interpreter's loop. No amount of tuning fixes that.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="starting-over">Starting over<a href="https://atomsprout.com/nestvane/blog/android-17-inside-an-iphone-app/#starting-over" class="hash-link" aria-label="Direct link to Starting over" title="Direct link to Starting over" translate="no">​</a></h2>
<p>On the third day I switched to Claude Fable 5.2. I did not ask it to carry on. I asked it to read what existed and say what was wrong.</p>
<p>Its answer was blunt: stop interpreting. Android and the iPhone use the same instruction set (ARM64). Android's code can already run on the iPhone's processor as it is. The problem to solve is how to let it run directly and safely.</p>
<p>It did not start building at once. It ran a few small experiments on real phones first: is the address space large enough, does rewritten code run correctly, can the app recover from a fault, can signed code be loaded on demand. Only when those held did it write the real thing.</p>
<p><img decoding="async" loading="lazy" alt="A timeline of the four days: an interpreter with Codex, then a review, native code, making it usable, and the release with Claude" src="https://atomsprout.com/nestvane/assets/images/timeline-2dc432dadddf135d19ced3c0ab8ff652.png" width="1800" height="1290" class="img_ev3q"></p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="how-the-new-route-works">How the new route works<a href="https://atomsprout.com/nestvane/blog/android-17-inside-an-iphone-app/#how-the-new-route-works" class="hash-link" aria-label="Direct link to How the new route works" title="Direct link to How the new route works" translate="no">​</a></h2>
<p>One problem comes first. The translated code needs a few registers (places in the processor that hold data for a moment) for its own state, and stock Android uses every register there is.</p>
<p>The answer is to rebuild Android 17 from source and tell the compiler that five registers are off limits. Android's code keeps its logic and gives up five seats.</p>
<p>Then comes translation. Android has about 1,230 programs and libraries, and each is rewritten, before the app is packaged, into code that iOS will sign. Almost every instruction is copied as it is. Two kinds change: a system call becomes a jump into our runtime, and an indirect branch looks its target up in a table first.</p>
<p>The Linux that Android needs is still our own. It is not a port of the real kernel, only the parts Android uses, a little over twelve thousand lines of C++.</p>
<p>And an interpreter stays. If an APK that a user installs brings its own native libraries, those cannot be translated in advance and have to be interpreted. That is where Nestvane is slowest today; more on it below.</p>
<p><img decoding="async" loading="lazy" alt="What happens at build time on a computer and at run time on the iPhone" src="https://atomsprout.com/nestvane/assets/images/architecture-c04df33688f89d995a6dfaea123030b9.png" width="1800" height="1185" class="img_ev3q"></p>
<p><img decoding="async" loading="lazy" alt="The five reserved registers, and one indirect branch after rewriting" src="https://atomsprout.com/nestvane/assets/images/registers-bc59188a23937ce113f45832a4ebd164.png" width="1800" height="1050" class="img_ev3q"></p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="how-606-seconds-became-10">How 606 seconds became 10<a href="https://atomsprout.com/nestvane/blog/android-17-inside-an-iphone-app/#how-606-seconds-became-10" class="hash-link" aria-label="Direct link to How 606 seconds became 10" title="Direct link to How 606 seconds became 10" translate="no">​</a></h2>
<p><img decoding="async" loading="lazy" alt="Boot time at each stage, from 606 seconds to about 10" src="https://atomsprout.com/nestvane/assets/images/boot-a775cea052a109daee5d197711b92a0f.png" width="1800" height="915" class="img_ev3q"></p>
<p>The largest step was the new route itself: the code no longer goes through an interpreter.</p>
<p>Even so, the first full boot on the new route took 110 seconds. For 50 of them nothing happened; the threads were asleep. The cause was silly. Our system image was missing a daemon called lmkd. Android asks for it every time it adjusts a process's priority, and waited 3 seconds each time it was not there. With lmkd added, 110 seconds became 34.</p>
<p>On an iPhone 15 Pro that was 11 seconds. Every second saved after that came from finding work that did not need doing, not from making code faster.</p>
<p>Every time memory was requested, our kernel layer moved all of the process's several thousand memory segments. Touching only the ones affected took 11 seconds to 9.</p>
<p>One line in the log said that 97 graphics shaders had been compiled ahead of time at boot, in 3.9 seconds, while the interface sat waiting. They can be compiled when they are first needed. With that turned off, 9 seconds became 7.</p>
<p>There was no trick to finding these. Put a timestamp on every log line and read down until the times stop adding up.</p>
<p>At its fastest it was 6.5 seconds. Then a pile of media services went in so that video could play, a dozen apps were installed, and it settled at 8 to 10. I did not push it back down. Boot time was never what this project was for.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="booting-is-a-long-way-from-usable">Booting is a long way from usable<a href="https://atomsprout.com/nestvane/blog/android-17-inside-an-iphone-app/#booting-is-a-long-way-from-usable" class="hash-link" aria-label="Direct link to Booting is a long way from usable" title="Direct link to Booting is a long way from usable" translate="no">​</a></h2>
<p>Booting was only the start. The first few taps turned up a row of problems.</p>
<p>Settings quit as soon as it opened, because the system thought the setup wizard had not finished. The file manager listed nothing, because there was no shared storage. Wikipedia installed and then could not load its front page, because there was no network.</p>
<p>They were fixed one at a time. Android's shared storage is now a folder in the iPhone's Files app: put a file there from the iPhone and Android sees it. Apps use the iPhone's network. Home-screen widgets were kept, and an app's widgets can be added to the home screen.</p>
<p>Video took the longest. The decoder crashed as it started. With that fixed the picture was black. With a picture there was no sound. With sound, playback ran at nine tenths of its speed. In the end a 720p video holds 30 frames a second with the sound in step. The sound was measured by its data rate and level, though. I have not sat down and listened to it properly.</p>
<p>One small episode. On a new iPhone 17 Pro, the first time the app opened, iOS asked whether to let it "find devices on local networks". An app asking that the moment it opens feels wrong. The cause: Android looks up names as soon as it boots, and we were sending those queries straight to the router, which iOS counts as reaching the local network. Now they go through iOS's own resolver and the prompt is gone.</p>
<p>You do not think of a problem like that at a desk. You run into it on a clean phone.</p>
<p><img decoding="async" loading="lazy" alt="Four screens: the start screen, the home screen with widgets, Android Settings, and a file put there from the iPhone" src="https://atomsprout.com/nestvane/assets/images/system-ef64c9849327b87a0a3bcd6e039d81e7.png" width="1800" height="1140" class="img_ev3q"></p>
<p><img decoding="async" loading="lazy" alt="The app drawer, Wikipedia, Fossify Clock and ScriptWidget" src="https://atomsprout.com/nestvane/assets/images/apps-cfa290a04c1fc06b914ee5edbe582f64.png" width="1800" height="1140" class="img_ev3q"></p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-last-run">The last run<a href="https://atomsprout.com/nestvane/blog/android-17-inside-an-iphone-app/#the-last-run" class="hash-link" aria-label="Direct link to The last run" title="Direct link to The last run" translate="no">​</a></h2>
<p>Before publishing, I went through everything from the beginning on that new iPhone 17 Pro.</p>
<p>Installing the app took about half a minute. The first start took about 17 seconds, and the ones after it between 9.5 and 10.9. At the home screen it uses 2.2 to 2.4 GB of memory.</p>
<p>Installing an APK takes under half a second. I installed 2048, Fossify Clock, Markor, Wikipedia, NewPipe and ScriptWidget, and all six opened.</p>
<p><a href="https://www.youtube.com/shorts/wDVr3-UY1Ec" target="_blank" rel="noopener noreferrer" class=""><img decoding="async" loading="lazy" alt="A frame of the demonstration video: an iPhone showing the Android home screen" src="https://atomsprout.com/nestvane/assets/images/video-0a5438a1cfcfc6f01195ee8dbf92418c.jpg" width="540" height="960" class="img_ev3q"></a></p>
<p><em><a href="https://www.youtube.com/shorts/wDVr3-UY1Ec" target="_blank" rel="noopener noreferrer" class="">The demonstration video, on YouTube</a>.</em></p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="whose-ideas-these-are">Whose ideas these are<a href="https://atomsprout.com/nestvane/blog/android-17-inside-an-iphone-app/#whose-ideas-these-are" class="hash-link" aria-label="Direct link to Whose ideas these are" title="Direct link to Whose ideas these are" translate="no">​</a></h2>
<p>Nestvane follows Twoyi's technical approach, above all AOT: no JIT, with Android's code translated to native code when the app is built. Knowing that someone had made that road work mattered a great deal.</p>
<p>Kernarium is open source and runs a real Linux kernel on iOS. Its code and documents were read while Nestvane was planned, and taught a lot.</p>
<p>Nestvane uses no code from either. It was written from nothing. My thanks to both for going first.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="side-by-side">Side by side<a href="https://atomsprout.com/nestvane/blog/android-17-inside-an-iphone-app/#side-by-side" class="hash-link" aria-label="Direct link to Side by side" title="Direct link to Side by side" translate="no">​</a></h2>
<p>This table uses public information only. The Twoyi and Andarium columns (Andarium is Kernarium's Android app) come from their own sites and repositories as read on 22 November 2026. The Nestvane column is what I measured. Where they publish nothing I wrote "not published"; I did not measure for them.</p>
<table><thead><tr><th></th><th>Nestvane</th><th>Twoyi (iOS)</th><th>Andarium</th></tr></thead><tbody><tr><td>Android version</td><td>17</td><td>13</td><td>not published</td></tr><tr><td>How code runs</td><td>translated ahead of time, the rest interpreted</td><td>translated ahead of time</td><td>interpreter, optional JIT</td></tr><tr><td>Kernel</td><td>a kernel layer of its own</td><td>not published</td><td>the real Linux 6.18</td></tr><tr><td>Boot to the home screen</td><td>about 10 s, about 17 s the first time</td><td>"about 3 seconds" by its site</td><td>not published</td></tr><tr><td>Requires</td><td>iOS 26 or later</td><td>iOS 15 or later</td><td>iOS 26 or later</td></tr><tr><td>Installing</td><td>sideloaded IPA, paid developer account</td><td>sideloaded IPA</td><td>sideloaded IPA, about 1 GB</td></tr><tr><td>Source</td><td>open, Apache-2.0</td><td>not published</td><td>open, GPL-2.0</td></tr></tbody></table>
<p>Do not compare the boot times directly. Twoyi's 3 seconds is what its site says, and it runs Android 13; our 10 seconds is Android 17. The devices differ, the system versions differ, and the stopwatch may start and stop in different places. That Twoyi is much faster than we are is plain all the same.</p>
<p>Andarium uses a real kernel, so its system behaviour is the most complete. We built only what Android uses; what it does not ask for is not there.</p>
<p>One thing a table cannot hold. As far as I know, both projects are the work of experienced Android developers, who understand Android far better than I do, and what they make is more dependable. Nestvane was made by an iOS developer, with the Android side resting on AI and on trying things on real phones again and again. If you want something stable to use, look at theirs first.</p>
<p>What Nestvane can claim is roughly this: the newest Android, 17, and it has run on an iPhone 17 Pro; little was trimmed, so the home-screen widgets, Settings, the file manager and the installer are the stock ones; and all of its source is public under a permissive license.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-problems-right-now">The problems right now<a href="https://atomsprout.com/nestvane/blog/android-17-inside-an-iphone-app/#the-problems-right-now" class="hash-link" aria-label="Direct link to The problems right now" title="Direct link to The problems right now" translate="no">​</a></h2>
<p>The largest is that ordinary users cannot run it.</p>
<p>Nestvane needs an iOS capability that gives it enough address space, and that capability goes only to paid Apple developer accounts, at 99 US dollars a year. I tried signing without it. The app installs and starts, but it can only fall back to interpreting, and after five minutes it had still not reached the home screen.</p>
<p>So the only way in today is to sign the package with a paid developer account and sideload it. That makes it something only developers can play with. How to open it to everyone else, I have not worked out.</p>
<p>Next, speed. An app's own native libraries can only be interpreted, at about forty million instructions a second. ScriptWidget shows it: its interface appears in under a second, but its first widget preview takes about two minutes, because its script engine is a native library.</p>
<p>Beyond that: video is decoded in software and nothing above 720p has been measured; there is no recording and no microphone; there are no Google apps or services; and it has been tested only on two iPhones with 8 GB of memory. Phones with less cannot hold it.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="about-the-ai">About the AI<a href="https://atomsprout.com/nestvane/blog/android-17-inside-an-iphone-app/#about-the-ai" class="hash-link" aria-label="Direct link to About the AI" title="Direct link to About the AI" translate="no">​</a></h2>
<p>What I did in this project: set the goal, test on real phones, say what was wrong, and choose between roads. The AI wrote the code. The repository has over 550 commits, and the runtime is about twenty-six thousand lines of C++.</p>
<p>The two stages were very different. The two days with Codex produced a version that worked end to end and took ten minutes to boot. The two days with Claude Fable 5.2 first threw out the way code was executed, then brought the boot down to about 10 seconds, and the network, storage, widgets, video and sound all came in that stage too.</p>
<p>This is not a rigorous comparison. It is one project, and the two stages faced different problems; the second stood on what the first had produced. Speaking only for myself, Claude Fable 5.2 is very capable. In a field I barely understand, it got to something publishable in four days.</p>
<p>It has its limits. It needs me to tell it what actually happened on the phone. The permission prompt, the free account that cannot run it: those were hit on a phone, and it could not have thought of them sitting at a computer. Once I saw the app vanish and took it for a crash. It had restarted the app to time a second boot.</p>
<p>So what I take from this is that once the direction is right, the pace is set less by how fast it writes code than by how fast I can bring it real results.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="where-it-stands">Where it stands<a href="https://atomsprout.com/nestvane/blog/android-17-inside-an-iphone-app/#where-it-stands" class="hash-link" aria-label="Direct link to Where it stands" title="Direct link to Where it stands" translate="no">​</a></h2>
<p>That is Nestvane 1.0: Android 17, about 10 seconds to the home screen, APKs install, the network works, 720p video plays. Only a paid developer account can install it, and an app's own native code is still slow.</p>
<p>The source, the documents and the record of every step are in the repository, including the ones that led nowhere.</p>]]></content:encoded>
            <category>nestvane</category>
            <category>android</category>
            <category>ios</category>
            <category>ai</category>
        </item>
    </channel>
</rss>