Is there any way to testing React Native project using HMS Toolkit cloud debugging? - react-native

I found huawei have HMS Toolkit Cloud Debugging for testing, is it support for React Native? or is there any way to install our apps into the cloud device?

You cannot run the react-native run-android command to directly perform debugging. You need to run the gradlew assembleDebug command to package the full APK and upload the APK to Cloud Debugging for testing.
You could directly access the CloudDebugging menu on the AppGallery Connect, as shown in the following figure:
Then select an appropriate test machine and upload the APK file for test.
According to the R&D team, we didn't have a specific adaptation for React Native. But if your app works fine on your test machine, it should be fine on Cloud Debugging as well.
To install app on Cloud Debugging, please download the HMS Toolkit plug-in in Android Studio firstly, then start Cloud Debugging and click Run app in the IDE to start the installation.
Pls kindly refer to the following link for more info:
How to install HMS Toolkit plug-in?
What is Cloud Debugging?

Related

Windows 10 WSL2 expo cannot find simulated android device from Android Studio

I am new to android development and am trying to learn react-native by following a tutorial here. The problem is whenever I try to start my react-native project within my simulated android device, expo cli cannot find it. This step is at the 25 minute mark of the video and my progress can be summarized as follows:
I have react-native on my machine and have installed expo cli
I've downloaded Android Studio which is located: C:\Users..\AppData\Local\Android\Sdk
I have my emulated android device up and running via Virtual Device
Manager
After typinng "npm start" When I type "a" within the terminal of WSL to run this app on my virtual android device I get the following message when it tries to open the emulator:
No Android connected device found, and no emulators could be started
automatically. Please connect a device or create an emulator
(https://docs.expo.dev/workflow/android-studio-emulator).
At which point my expo developer tools browser window displays that
Expo Developer Tools is disconnected from Expo CLI. Use the expo start
command to start the CLI again
When I goto the terminal and do this, it just restarts this failure over again when I type "a" to start my app in the simulated android device. Some of the solutions I've tried are:
following the documentation on the workflow android studio emulator link. I find though that all of the options within my version of android studio look drastically different, and that my file location is much different than what they have listed.
uninstalling and reinstalling Android Studio
Making sure SDK tools is checked as per this stack overflow post
following the instructions in this stack overflow post, however I am not trying to connect a phone via usb so this does not help me.
My setup is as follows:
OS: Windows 10
VM: WSL2 Ubuntu 20.04.3 LTS
Text Editor: Visual Studio Code 1.63.2
Android Studio: BumbleBee 2021.1.1
Expo CLI version: 5.0.3
here are some screen shots:
^ that one is right before I try to type "a" within the expo cli within terminal.

How to build .IPA file for testing in react-native?

I have build a project in react-native, for now I am testing the android app by using Expo Client App. I am using Visual Code in Ubuntu 18.04.
So the problem is, now I want to test the project for IOS, but unfortunately i can't test the app, because I don't have MAC OS.
Can anyone tell me the alternative solution of testing react-native project on IOS?
And if somehow there is a solution of creating IPA,then can I use that IPA in IOS without uploading it in AppStore?
You can use snack :
Snack lets you run complete react native project in a web browser,you can set it up on your local machine directly use it from snack.io which also let's you test for android and ios as well

Creating Android and iOS app from react-native

I have created one react-native app using expo and atom editor. It's running fine in android device and iOS simulator but with the help of expo. What I want is to generate Apk(debug) so that I can directly run on device. How can I do it ? I followed this(Dmitry Mugtasimov's answer). should I run all those command inside project folder ? Also I don't find index.js file inside my project folder. Also if someone know how to run on iOS simulator by creating app like file(don't know what is that in Ios because from android background). Please help, thanks
Since you have used Expo to develop your react-native app you can build the android app by going to the project folder and running the bellow command in the terminal
expo build:android
The building process will take around 5-10 minutes. When your build is done, expo build:status will give you your .apk file url. If not, it will say your build is still in progress and to try again later.
Also to build the iOS app you can run,
expo build:ios
To build the iOS standalone app you will need to have an Apple Developer account, but for Android standalone app you don't need a Google Play Developer account.
For the above commands to work you need to have expo-cli installed, For this you can run the bellow command,
npm install -g expo-cli
More Info: https://docs.expo.io/versions/latest/distribution/building-standalone-apps/
If you don't have an Apple Developer Account. You can build the iOS
standalone simulator build using the command,
expo build:ios -t simulator
And then wait for build to finish then download and unpack YourAppName.tar.gz. Then, start the iOS simulator and run xcrun simctl install booted YourAppName.app to run the .ica file.
More info: Expo / React-Native, Is it there a way to test-run standalone iOS apps on a device/simulator?

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

Could not install the app on the device - react native on windows 10

Everytime I try to launch a react native project I got this error
Could not install the app on the device, read the error above for
details. Make sure you have an Android emulator running or a device
connected and have set up your Android development environment
I reinstalled nodejs, python and jdk using choco as suggested on official docs. Every single packages is installed as well as sdk 23.0.1
I can see my virtual device if I run adb devices USB debugging is activated and it's running android 6.
I setup ANDROID_HOME path in environment variables, I'm using same sdk path as you can see in the picture. I also setup another one for JAVA_HOME and Python.
My PATH looks like this:
I just don't understand what I'm supposed to do. I'm using a surface pro 4, Windows 10. I can run projects using expo. I literally tried everything, restart computer, start cmd using admin, create new virtual devices, uninstall everything and start from scratch, it just don't work.
You have pointed out two issues; first, make sure you have an android emulator running. To do that, you run adb devices and you say you can see you device.
The other issue is with the environment. To make sure your environment is setup properly for android, go to the root of your react-native project. Open the android project using android studio.
All errors with your environment will show up, use the automatic fixes provided by android studio. Clean the project in android studio. Close studio and go back to command line, run react-native run-android
Everything should work now.
When doing react-native start it will intentionally hang at "Loading dependency graph" (its not really hanging, its just waiting to receive build/bundle signals). This is correct. You have to open a second terminal then do react-native run-android.
If you get errors, then cd android in your project folder then run ./gradlew clean, then after that do another react-native start then react-native run-android.
Solution is to delete all java JDK and reinstall v8 / change JAVA_HOME to the new path.
Also changing gradle-wrapper.propertiesfile for each project you want to run
# update gradle to latest version
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-all.zip
Sometimes it dosen't compile with v4 so I have to use v3. React native is definitely confusing.
after install dan update environment JDK now I can install app on my device