Capacitor: Ionic DevApp Support

Created on 15 Mar 2018  ·  9Comments  ·  Source: ionic-team/capacitor

ionic low

All 9 comments

Hi @mlynch, any news about this ? Thx

+1 also interested in 😃

Adjusting the priority here, it's not a high priority for us right now. Would rather focus on making the native dev process easier.

@mlynch it would be great if we could easily precise from the Capacitor CLI where the native app needs to look for the index.html.

I mean, instead of looking locally, the webview could either look on the network (x.x.x.x:8000/index.html) or on an URL (https://aaaa.com/index.html). Like that developers/testers could build the native app once and as long as the native features doesn't change they are able to see updates.

Personnally, building the app with the remote URL (it could be an test environment) is really useful for the team to test directly modifications without having to go through TestFlight (iOS)...

That's already implemented, you can configure server.url like this in the capacitor.config.json:

"server": {
    "url": "http://serverip:serverport/"
}

If you are using Ionic, the latest CLI has integrated it, it even configures the url for you
If not using Ionic you can use any server that looks for changes and reload
There is even a mac app called codekit that does it, see this blog post https://medium.com/@corymc/speeding-up-your-capacitor-development-with-codekit-a5fb679c58c

@jcesarmobile thank you for this information.

And what would you recommend if I need to manage multiple environments, for example: production, staging, development?

Do I need to create three different files (capacitor.XXX.config.json) and find a way to switch between them?

Or maybe just use one file but directly inside each platform override parameters depending on an environment variable while building?

_The main goal is for example, having multiple applications on my phone with different id so they can cohabit while having their specific settings_

@jcesarmobile

I've been making use of this server.url config property for loading a remote client and it works like your said. Capacitor though, expects that there is a index.html file is locally included in the build even though it won't use it. (https://github.com/ionic-team/capacitor/blob/master/ios/Capacitor/Capacitor/CAPBridgeViewController.swift#L74)

Is there a reason for Capacitor to require an index.html locally while the client could be loaded remotely?

certainly it's not required, that check was there before the server url was implemented, nevertheless, some other files are required like cordova.js and native-bridge.js that will only be there if you run npx cap copy

Going to close as it's not really a Capacitor issue.

It should be a totally new Dev App for Capacitor, or migrate the existing one to be a Capacitor app. But considering Apple rejections of dev apps last year, it's probably not worth the effort.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Hansel03 picture Hansel03  ·  3Comments

peterpeterparker picture peterpeterparker  ·  3Comments

ebk46 picture ebk46  ·  3Comments

json-derulo picture json-derulo  ·  3Comments

Kepro picture Kepro  ·  3Comments