TJ VanToll

Preview NativeScript Apps in a Browser with Appetize

| Comments

If you haven’t heard of before, it’s an awesome service that lets you run your native iOS and Android apps in a simulator that lives in a web browser. Using the service is as simple as uploading a .app or .apk file, but I thought I’d show you how it works in the context of a NativeScript app.

To give you an idea of what the finished product looks like, here’s what the NativeScript Groceries sample looks like running in Appetize:

Building your app

Before heading into Appetize, you first need to generate the executables service needs, and you can do that with NativeScript’s build command:

$ tns build ios --emulator
$ tns build android --emulator

Providing the --emulator flag is important as Appetize expects an emulator build rather than a build intended for a physical device.

Upload your app

Now that you’ve generated the executables, visit and click the “UPLOAD” button in the top-right corner of the screen:

On the upload page, scroll down and click the “Select file” button:

For Android, Appetize wants the -debug.apk file lives in your NativeScript project’s platforms/android/build/outputs/apk folder:

After the file upload completes, scroll to the bottom of Appetize’s upload page, enter your email address, and hit the blue “Generate” button.

Appetize will send you a URL you can use to access your app. You can share that URL with your friends, coworkers, clients, or whoever else you’d like to see you app in action.

Uploading for iOS

The process for uploading iOS apps is similar, although there is one additional step. Return to Appetize’s upload page and click the blue “Select file” button again. Next, navigate to your NativeScript project’s platforms/ios/build/emulator folder and find the file that has the same name as your project:

Appetize expects a .zip file for iOS, so right click on your application file and choose OS X’s “Compress” option to create a .zip file with the same name:

Finally, upload platforms/ios/build/emulator/ and provide your email address again to get a URL to access your iOS app.

And that’s it! Make sure to additionally check out Appetize’s embed documentation so you can figure out how to embed apps in a web page like I did above.