New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Code on iPhone without MacBook
1. Have No MacBook,
Will Code Anyway*
Putting the “Mobile” in Mobile App Development
*How To Write and Test your own code
on your iPhone/iPad without carrying your Mac
@CarlAllenBrown
2. XCode for iOS
Of course, it doesn’t exist, but just
how close can we get?
3. Well, it’s not
quite there, yet...
But it’s usable. I use it several times
a week.
6. It’s useable more
places
Standing in line can be productive,
but a laptop would be too awkward.
7. It’s Social
An iPad is a better tool for
communicating with iOS
App development
customers
When demonstrating an
App or showing a design to
a customer with a laptop,
they’re never as interactive
as they are when I’m using
the iPad
8. It’s powerful enough
*Graphic from http://www.iakttakelser.com/2011/03/on-feeds-and-speeds.html
10. So what do you have?
The project is called
XCAB for now (it stands
for XCode AutoBuild), and
it’s available on GitHub
under an MIT license.
It’s written in Bourne Shell
at the moment
I’d consider it in the
“Advanced Proof of
Concept” stage
24. How do I use it?
XCAB will make a directory in your XCAB directory for each
PROJECT that it can check out from the path in the
XCAB.conf file
Into that directory will be placed a file that lists the branches
and tags for that project so you can see your options
If you make a new directory, it will check out the closest-
named branch/tag it can find into that directory (creating a
branch with the name of the directory if it doesn’t exist).
Any files changed in that directory will cause a build and a
push notification (if there is an associated XCode project)
25. Demo
We’ll see if this works :)
*If not, I’ve got some static screenshots to fall back on that I’ll walk you through
77. Simplification is coming
Working on making a Mac App
to do the Server-side Stuff
and an iOS App do to branch
creation, checkouts, add new
projects, receive the push
notifications, etc.
Want you to be able to use
your own editor App, so it
won’t be a full IDE.
No ETA, though.
78. How do I set this up?
Part 1: Prerequisites
Put a Dropbox in your Home directory on your Mac
Get Boxcar App and Set up Boxcar account (http://boxcar.io)
Enable Growl/API access
Get and build the command-line Beta Builder from
• git://github.com/sgruby/iOS-BetaBuilder.git
65
79. How do I set this up?
Part 2: Keychain for Cert Signing
If you want it run without being logged into your session (e.g.
from cron), you have to make* a new Keychain with just your
code-signing Cert and public/private key pair that is locked by a
password you don’t mind hard-coding into a script.
*See http://stackoverflow.com/questions/577750/running-xcodebuild-from-a-forked-terminal
66
80. How do I set this up?
Part 3: XCAB
Get the code from https://github.com/carlbrown/XCAB
Copy XCAB.settings.sample to XCAB.settings
Edit the variables in XCAB.settings as needed
See next slide
run run_me_to_verify_install.sh
fix anything it points out
follow its instructions to get the server running
67
82. What’s the catch?
There’s no provision for managing XCode projects or xib files
(you’ll still have to do all that on the Mac)
In other words, you can’t add new files or edit GUIs
Technically, they’re just XML, but really, just don’t bother for
anything more complicated that changing the name on the
signing certificate
83. What’s the catch?
There’s no provision for managing XCode projects or xib files
(you’ll still have to do all that on the Mac)
In other words, you can’t add new files or edit GUIs
Technically, they’re just XML, but really, just don’t bother for
anything more complicated that changing the name on the
signing certificate
No auto-complete or refactoring or debugging or instruments
84. What’s the catch?
There’s no provision for managing XCode projects or xib files
(you’ll still have to do all that on the Mac)
In other words, you can’t add new files or edit GUIs
Technically, they’re just XML, but really, just don’t bother for
anything more complicated that changing the name on the
signing certificate
No auto-complete or refactoring or debugging or instruments
The lag and long cycle time gets old
85. What’s the catch?
There’s no provision for managing XCode projects or xib files
(you’ll still have to do all that on the Mac)
In other words, you can’t add new files or edit GUIs
Technically, they’re just XML, but really, just don’t bother for
anything more complicated that changing the name on the
signing certificate
No auto-complete or refactoring or debugging or instruments
The lag and long cycle time gets old
Oh, and did I mention it’s really overly complicated
86. Questions?
Email: carlb@pobox.com (H) carlb@PDAgent.com (W)
Twitter: @CarlAllenBrown
Blog: http://www.EscortMissions.com
I'll put this presentation up at http://www.slideshare.net/
carlbrown/
My name is Carl Brown.\nI have several Apps in the store. The first iPhone app I worked on to be published was the LIVESTRONG.COM Calorie Tracker \nI have a Day Job, a Family and a Life,\nand an Mobile App Dev company on the side since 2003.\nI try to be responsive to both my dev customers and my family, but it’s difficult,\nSo I try to squeeze the most work out of the time that I have\n
\n
\n
Before I start talking about where the project is, let me take a minute to talk about why I’m doing this.\n\nI had a customer who sent me a text message while I was at lunch asking why I hadn’t changed something we’d agreed on.\nIt was a trivial one-line change, and it had slipped my mind. It took me 30 seconds to fix, but it was 90 minutes before I got to my laptop to be able to do it.\nI wanted to be more responsive than that, So I developed a way to write and test code with just my iPhone (or iPad)\n
It’s far easier to carry an iPad than a laptop, and I don’t want to carry both. Plus, my iPhone is almost never out of arm’s reach, and the same solution works for both the iPad and the iPhone.\n\n\n
I also carry my iPad far more often. When leaving the office to go to lunch, I’d rarely take my laptop, but I almost always take my iPad.\n
Most (of my) customers will point to and touch the iPad screen while we’re discussing an App, but won’t do that to a laptop screen, and I get better information when they’re more animated.\n
This is partly stubbornness on my part, but an iPad is as capable as a Macbook I used to write code on a few years ago. So it ought to be able to be used to write code.\n
People who are (almost) always connected to iPads (and tablet PCs in general) are a growing market (I believe, at least).\n\nI also believe that, by being one of those people myself, I’ll become familiar with the day to day annoyances of making an iPad a primary computer. Each one of those annoyances is a potential market opportunity with which I otherwise wouldn’t have become familiar.\n
You can get the code from https://github.com/carlbrown/XCAB (url is also later in the presentation).\n\n
There are several steps in the process, still too many, but I’ll walk you through them.\n
I have a refurb mini in my Living Room that I bought to be an Home Sharing server, and it’s more than up to the task.\n\nI’ve run it on my laptop, too, from time to time.\n
Textastic is my favorite code editor for the iPad. Nebulous Notes was my previous favorite, and it’s my monospaced Dropbox-enabled editor of choice for the iPhone\n
The way you do that is kind of arbitrary - we’ll talk more about it later, so just go with me for now.\n
In theory, it should be possible to use SVN or Mercurial or something else, but I use git for my projects, so that’s what got built in.\n
This is true whether the commits came from you or not, so I’ll get notifications for new checkins that other people make to github for some projects.\n
Beta Builder automates the process of making a web directory set up for iOS 4.0+’s over-the-air installs. It’s available on the App Store (although my scripts use the command line version from GitHub - see URL later in presentation).\n
You can also have it RSync’ed to a web server, but with Dropbox it has fewer moving parts, and you can delete the folder from Dropbox from your device to cause it to get rebuilt.\n
Boxcar (from http://boxcar.io) is an App you can buy to get arbitrary notifications.\n\nYou also get an email with more detailed information.\n
Boxcar following the link launches a webkit UIWebView*, which follows the itms:// itunes URL scheme to cause the app to be installed.\n\n*Or at least I’m pretty sure that’s what it’s doing, but I haven’t reverse-engineered Boxcar or anything.\n
\n
\n
It’s still, really, a proof of concept, although I do use it a lot.\n\nI’m sure there are conditions that don’t apply to me that cause it to break, but I’d love to find those and fix them.\n
\n
\n
I’m going to fire up Textastic here, although you could use any Dropbox enabled editor\n
Navigate into my XCAB folder. I keep it in my “Code” directory, although you can put it wherever you want (it’s specified in the XCAB.settings file on the server).\n
\n
Grab the config file\n
\n
Since they say Twitter clients are the new “Hello, World”, let’s use one for our example. Here’s one on github I can use to illustrate the process.\n\nI’ll add in the line with the git repo path, and the local name I want to call it, separated by an equals sign.\n
Upload the config file back to Dropbox\n
And before too long, I’ll get a TweetWall directory show up\n
Which contains files that tell me what branches and tags exist\n
So there’s a master branch. We could work in it, but let’s use a different one to keep our changes clean.\n
Let’s make a master-carl branch (which will spawn off the master branch) for us to make our changes in.\n
Now we’ve been notified that our new branch has been created and the files from it have been added to our Dropbox folder.\n
Here we have the contents of our new branch\n
Let’s select the project file\n
Download it\n
Change the iPhone Developer lines to not have a name anymore, and change the default Build type from Release to Debug. That way we won’t have code-signing problems.\n
Upload that back to Dropbox\n
And, we have a new build. Tap View\n
Tap on the notification in Boxcar\n
Tap on the “view original” link\n
Tap here to Install\n
Tap again to Install\n
Sometimes Dropbox’s servers haven’t finished synching up, yet, so you have to hit “Retry” a couple of times at this point.\n
And it’s done, let’s launch it.\n
OK, so it’s running - let’s change the default search to something more relevant\n
We’re going to change “I’m happy” there on line 38.\n
That’s better.\n
Upload that.\n
Oh, look, we have a new build ready.\n
Tap on the link\n
Tap to start the download\n
Tap to allow the download\n
Like I said before, sometimes Dropbox’s servers haven’t finished synching up, yet, so you have to hit “Retry” a couple of times at this point.\n
And, we’ll launch it\n
And we have a more relevant search term.\n
\n
\n
\n
\n
\n
This way, if you get logged out, or your machine reboots because of a Lightning Storm (not that we ever have that happen in Central Texas) it will work anyway\n
\n
You’ll need to rename this to XCAB.settings on your server directory and edit the values as appropriate.\n