Deploy app onto a real device and get rid of local-dev-server dependence - react-native

Appreciate your lecture.
Currently, I can successfully deploy the app onto my iPhone device.
However, the app is rely on local-dev-server.
How could I get rid of the local-dev-server?
I used this command to deploy the app react-native run-ios --device 'iPhone' onto my cellphone
Here's my repo
https://github.com/poc7667/reacti-native-album

Here is a section from RN docs:
Building an app for distribution in the App Store requires using the Release scheme in Xcode. Apps built for Release will automatically disable the in-app Developer menu, which will prevent your users from inadvertently accessing the menu in production. It will also bundle the JavaScript locally, so you can put the app on a device and test whilst not connected to the computer.
To configure your app to be built using the Release scheme, go to Product → Scheme → Edit Scheme. Select the Run tab in the sidebar, then set the Build Configuration dropdown to Release.
you just need to select the Release scheme on the run configuration in xCode and hit the run button.

Related

Running two Expo Release Channels on the same device?

I have a testing and production release channel, on TestFlight and the App Store, respectively. I want the ability to run both on the same device. Otherwise if there is an issue with my testing release channel me and my beta users are blocked from using the working production channel (as least without constantly downloading and overwriting the TestFlight vs App Store versions)
I tried https://medium.com/#ywongcode/building-multiple-versions-of-a-react-native-app-4361252ddde5, but it seems like most of the configurations were reverted on build, and I wound up with the same bundleIdentifier and therefore I could not download the TestFlight testing version without removing the App Store version.
I think your best bet is to release multiple apps from 1 source code. We ran into this problem as well and ended up releasing separate test (internal testing), beta (external testing) and production apps. Each with their own app logo, app name and expo release channel. As far as I know, there is no way to switch release channel after your app has been built.
Alternatively you could (beta) test your app by pointing your users to https://exp.host/#username/yourApp?release-channel=. This way your testers can test most of your app’s functionally in the Expo Go app.
You can use iOS Build Configurations and Android Build Variants to easily create different apps within one project.

How to fix optimazition error publish in play store

my apk is 1.4MB but error is "This APK results in unused code and resources being sent to users. Your app could be smaller if you used the Android App Bundle. By not optimizing your app for device configurations, your app is larger to download and install on users' devices than it needs to be. Larger apps see lower install success rates and take up storage on users' devices."
how to fix this error
It's only a warning, not an error.
For an app that small I wouldn't worry.
It's not something that's made its way into the Ionic ecosystem yet but I heard that if you open up your project in Android Studio and then do the build through there you can create an app bundle.
I'm not totally sure that its fully tested for Ionic so you might have issues with this, but Android have published a full guide:
https://developer.android.com/guide/app-bundle#get_started
This is what they say:
Download Android Studio 3.2 or higher—it's the easiest way
to add dynamic feature modules and build app bundles.
Add support for Dynamic Delivery
by including a base module, organizing code and resources for configuration
APKs, and, optionally, adding dynamic feature modules.
Build an Android App Bundle using Android Studio.
If you're not using the IDE, you can instead build an app bundle from the
command line.
Test your Android App Bundle by using it to generate APKs that
you deploy to a device.
Enroll into app signing by Google Play.
Otherwise, you can't upload your app bundle to the Play Console.
Publish your app bundle to Google Play.

React Native application deployment

I have already developed a React native application on my mac book, this is myfirst application. I want to deploy it to iPhone so that I can test it. I don't want to put it on appstore yet. I am not sure how to compile the application and get it ready to put it on iPhone. I tried this web site
https://www.diawi.com/, but not sure which .ipa or a.pk file, I need to upload. I can also try using expo, but not sure how to use it. Can anyone give me step by step instruction on how to upload this application on iPhone.
any help will be greatly appreciated.
For iPhone
For react-native-init you will probably need Apple developer account to test your app on your phone
Since you are using react-native-init, You should checkout this article by Facebook
https://facebook.github.io/react-native/docs/running-on-device
In the second point, it says Register for an Apple developer account if you don't have one yet
For create-react-native-app you need to do following
Download expo client from App store
Scan the QR code expo generate when you run your app using terminal (npm run start in terminal )
Note: Both Laptop and your phone should be on the same network
According to this thread, You can't use expo with react-native-init but alternatively you can create an expo project using create-react-native-app and then copy, paste files from your init project
For Android
For running your App on Android, You can directly generate/build an apk, send it to your device and just open it to see how it works (In Android you don't need a console or developer account to run your app)
Again, Open this link https://facebook.github.io/react-native/docs/running-on-device
And click on Android Tab to see how you can generate an Apk

React native takes very long to load on device

I've been developing a react-native app using the simulator for a while. On the simulator (iOS), the app loads very fast (on reload for eg). However, when I tried to load the app to the device, it spends between 1-3 minutes in the splash screen before loading into the app.
My project is fairly small, and has no extra resources other than the javascript. Looking at the documentation I couldn't find what might be the cause of the issue, though I suspect it has to do with the fact that it is not getting the JS from the packager local server.
What am I doing wrong?
(btw - react-native v0.31)
I ran into the same issue and discovered that it was because I was running my app on device in development mode. To get the performance you're looking for, you'll need to build and run the app in production or "release" mode. You can do this by passing in a --configuration option and setting it to Release using the React Native CLI:
$ react-native run-ios --configuration Release
If that doesn't do the trick, then you may need to build your app in "Release" mode from Xcode. To do that, navigate to your projects /ios directory and open the .xcodeproj file in Xcode. Choose your build target in the Toolbar. Scroll to the bottom and choose "Edit Scheme...". Then under Build Configuration, switch from "Debug" to "Release". Now build your app on your target device and it should be much more performant than before.
You can read more in the official React Native documentation under Running on Device: Building your app for production.
For me the issue was related to the wifi network of my development machine. I was using WPA2 Enterprise auth to connect to wifi on my development machine. I found that if I used a wired connection to connect to my network or if I used another wifi connection that used a different form of auth then the delay went away. I think the delay is a network timeout.

Worklight 6.1 - App Center Mobile Client error

I'm currently trying to build the mobile client for IOS. There are 2 issue currently lingering:
The mobile client will be used for user to download the app from our test server. When i build, i run the Build Setting and Deploy Target script and tick the checkbox to deploy for another server. However i'm not sure the context path need to be put as what, the current default is /IBMAppCenter
When i try run the app center in the XCode simulator, the app center keep running with a loading icon. I check the log and found that it says:
ERROR: Plugin 'com.ibm.mobile.InstallerPlugin' not found, or is not a CDVPlugin.
Check your plugin mapping in config.xml
I check my native folder (ipad\native\CordovaLib) and true enough, the CDVPlugin was not in the plugin folder, but when i look into the Classes folder, the header (.h) and implementation (.m) files are there. How should i configure to make it work?
Any help is appreciated. Thanks.
About question 1:
The deploy target is irrelevant. It is only relevant for "normal" Worklight applications that are managed by a Worklight Console (so you must specify on which server your Worklight Console runs). But the Application Center client is not managed by any Worklight Console. All what you do is to build the environment, create the IPA and upload it to the Application Center server. Therefore, please only use the "Build all environments" menu item and ignore anything with deploy target!
See here: http://pic.dhe.ibm.com/infocenter/wrklight/v6r1m0/index.jsp?topic=%2Fcom.ibm.worklight.appadmin.doc%2Fappcenter%2Ft_ac_proj_imp_build.html
About question 2:
The Application Center mobile client for iOS should be in the iphone environment, not in the ipad environment. The code in the iphone environment folder should work for ipad as well but you cannot generate an ipad environment for the Application Center client, as well as you cannot delete the iphone environment and regenerated it via File > New > Environment, because when you do that, the libAppCenterInstallerLib.a gets deleted. You must take the project as it was in your original installation.
Please check IBMAppCenter/apps/AppCenter/iphone/native/appCenterLib. This should contain subdirectories (for Release, Debug ...) which contain libAppCenterInstallerLib.a. The error message that you see means that it cannot find this library; probably because you deleted the iphone environment or because you attempted to create an ipad environment.