[Ionic] Setup build and debug the app

There is many error when you try to deploy the app. The fatest way to know is using Android studio

Attach physical device to android through Wifi

Go to Tool -> Device manager.

Then follow the instruction on the screen to connect.

2. Generate signed keystore

Go to %JAVA_HOME%\bin folder

Open powershell here and run this command

keytool -genkey -v -keystore D:\YourFolder\debug.keystore -alias androiddebugkey -storepass android -keypass android -keyalg RSA -keysize 2048 -validity 10000 -dname "CN=Android Debug,O=Android,C=US"

Noted down all this infomation

3. Try to build an apk file for debug

Run this command

ionic cordova build android -- --keystore=D:\YourFolder\debug.keystore --storePassword=android --alias=androiddebugkey --password=android

4. Open APK file after build and run in Android Studio

Sometimes your app cannot install on the mobile phone. You cannot know why.

So, You can use this way to see the error message

Go to File -> Profile or debug apk -> Select your apk file

Now you can run or debug your application and see the error message here if have

5. Common error

INSTALL_PARSE_FAILED_MANIFEST_MALFORMED

<preference name=”android-targetSdkVersion” value=”30″ />

F G+ T

tuandph

Khởi đầu với .NET từ năm 2013 đến nay. Hiện tại mình đang làm full-stack developer. Yêu thích lập trình & chia sẽ kiến thức. Thời gian rảnh thường làm những tool vui vui và viết lách kể lệ sự đời.