5 ms·
Hello-World iOS App in Assembly
- starmole 1y agoSuper cool! Would love to see the build/deploy steps needed.
- saagarjha 1y agoxcrun -sdk iphoneos clang yellow.asm, pack it into an IPA and sign it
- zffr 1y agoI just tested this on my computer. 1. Make a new Xcode iOS project and delete all files except for Info.plist 2. Remove all keys from Info.plist 3. In the build settings search for "storyboard" and remove all keys 4. Add yellow.asm to project 5. Link UIKit, and Foundation After all that you can build and run on a simulator
- JimDabell 1y agoThere is also an iOS app implemented in C here: https://stackoverflow.com/a/10290255/8427 https://stackoverflow.com/a/10290255/8427
- baumschubser 1y agosnibbetracker is an example of a C/SDL iOS app. <1MB from the app store which is really wild. https://apps.apple.com/de/app/snibbetracker/id1065797528 https://apps.apple.com/de/app/snibbetracker/id1065797528
- c-fe 1y ago<1MB is also relatively easy to reach with swiftui apps. I had two fully working ones in the app store below 1MB. They are removed now since I didnt pay the yearly 100€
- bloomca 1y agoDo you need to pay the license to keep your apps in store? Or did they deprecate some APIs and therefore removed your apps? Honestly wild if you need to upkeep the license just to have it in store once it is published.
- BrianHenryIE 1y agoYes. I have a bike helmet with integrated cameras. The company (Cyclevision) that made it is gone. So no Apple account. So no app for my helmet anymore.
- klardotsh 1y agoThis is yet another example of why open bootloaders to allow alternative firmwares for all gadgets must become legally required. Stuff turning into eWaste (or at least losing what some folks would likely call major functionality) because the creators went out of business and the gadget was locked down is a disaster for both the planet and for the concept that you actually own the stuff you buy.
- ghrl 1y agoYou could check if consumerrights.wiki already has a page on that company and if not create one. It's a great resource that will also be used to justify demands for changes to the DMCA.
- anta40 1y agoEven better if build steps are provided
- azhenley 1y agoI’m guessing even this still requires that I use XCode.
- abnercoimbre 1y agoIs that true? What about the command-line version?
- klausa 1y agoThe Command Line Tools doesn't include the iOS SDK; or a simulator; or any of the other tools required to get it deployed to actual device.
- dadoum 1y agoIt probably doesn't, as you practically never need Xcode for simple apps. From my experience, currently, you need Xcode to compile storyboards (NIB/XIB files) and bundle Assets.car (macOS BOM files); and compile Xcode projects, btw. I may be missing another important feature used in a lot of apps but otherwise for the most part you can build an iOS app without Xcode (or even macOS).
- pjmlp 1y agoThe command line tools are still XCode, in a way.
- dadoum 1y agoI am not talking about XCode command line tools. I am talking about currently available open-source tools that can actually replace those command line tools. I don't think that would count as Xcode as those tools are available on systems Xcode can't run on.
- sanskarix 1y agoThis kind of thing is how you actually learn what's under the hood. Everyone's building with React Native and Flutter, which is fine until something breaks. Then you're stuck Googling black magic. Starting from assembly teaches you the real cost of abstraction.
- internetter 1y agoIs this really low level though? Because its hooking UIKit which is very high level relative to ASM. I'd be really curious to see an app draw on iOS without UIKit. I don't know if thats possible.
- pjmlp 1y agoAs low level as it gets. For lower level one needs something like ESP32, Arduino, retro-coding platforms.
- shreddit 1y agoOf course it is. You just have to reimplement UIKit in ASM, no big deal…
- pjmlp 1y agoAnd even that won't do it, because within the constraints of iOS, eventually that framebuffer with software rendering has to be displayed on the screen via an OS API, which is UI Kit.
- fingerlocks 1y agoIt should be possible. If you enable the JIT entitlement for personal development, then bundle a mach-o into an entitled app. Or compile it directly on the app and mprotect-x to execute it. Is there something else you can’t do that I’m not considering? I might give this a try.
- pjmlp 1y ago
- ChrisMarshallNY 1y agoVery cool, if impractical (it’s likely that you’d never get an ASM app through the App Store Approval process). ARM Assembly is a much more Byzantine creature, than the old 8- and 16-bit versions I used, way back in the Pleistocene. I’m always a fan of starting from the “bare metal,” to learn, but these days, it’s a long trip. When I was just a wee sprog, it was only a couple of steps away.
- Fokamul 1y agoIt's likely in future, you won't need app store approval process. I hope that EU will nuke Apple with some huge fines. And there will be corporate tax per each EU country, it's ridiculous corporates are raking huge money here and paying basically nothing on taxes, well only in Ireland and they're having party. Anyway, asm is great if you are using iOS emulator and need to do something and since you have root there, well :) (not apple meme simulator)
- jeroenhd 1y agoYou can already deploy apps on alternative stores inside of the EU. Apple has some bullshit fee but Epic has promised to cover that for AltStore.
- Ecco 1y agoHow would that impact the App Store approval? AFAIK they review binaries anyway…
- ChrisMarshallNY 1y agoThey do, but ASM doesn't have the guardrails that the compiled languages have, so it's almost certain that private APIs would get accessed.
- einsteinx2 1y agoWhat? That doesn’t make any sense. The only guard rails normal Obj-C has against calling private APIs is that they aren’t listed in the public headers, otherwise you can still easily call them. If you don’t explicitly make calls to private APIs from ASM, the won’t be called. I have no idea why you think “it’s almost certain that private APIs would get accessed.”
- huflungdung 1y ago[dead]
- Ecco 1y agoFeels like a disassembly of a boilerplate app, as opposed to handcrafted, minimal assembly code. For instance I’m pretty sure the autorelease pool is unnecessary as long as you don’t use the autorelease mechanism of Objective-C, which you’re most likely not going to do if you’re writing assembly in the first place.
- avidphantasm 1y agoLooks more sensible than having to use XCode and Apple's atrocious developer documentation.
- herodotus 1y agoWhen I was in second or third year of computer science in 1971 or '72, we (of course) learned IBM 360 assembler, but we also had to design a simple binary adder using AND OR and XOR gates. All on paper - no need for any soldering or electronics, which I regret. I cannot remember how many bits of input - probably 4 but may have been 6. But I did do quite a bit of asm programming, including a routine for calculating square roots using Chebyschev polynomials and newtons algorithm.
- iMario 1y agoWould love to see equivalent in C, not ObjectiveC... plain C.
- incanus77 1y agoThat would be great if iOS supported a GUI in C.
- WillAdams 1y agoFor folks who are curious about this sort of thing and want an approachable starting point, I would recommend: https://www.goodreads.com/book/show/44882.Code https://www.goodreads.com/book/show/44882.Code It would be way cool to see an actual application which wanted this sort of speed optimization --- the last significant assembly language program I can recall using was WriteNow, which was ~100,000 lines of assembly and to this day is my favourite word-processor (well, the NeXT version --- the Mac, even v2.0 suffered in comparison for not having access to Display PostScript and Services). Really wish that there was a writeup of it at folklore.org --- unfortunately, it only gets a single mention: https://www.folklore.org/The_Grand_Unified_Model_The_Finder.html https://www.folklore.org/The_Grand_Unified_Model_The_Finder.... (or that there was an equivalent site for the early history of NeXT)
- meisel 1y agoThe real optimization here is to move off UIKit and interact with the GPU more directly