Skip to content

Instantly share code, notes, and snippets.

@filipproch
Last active May 13, 2020 22:23
Show Gist options
  • Save filipproch/9db993f4dc34db2ef013 to your computer and use it in GitHub Desktop.
Save filipproch/9db993f4dc34db2ef013 to your computer and use it in GitHub Desktop.
With Archon installed, this way you can debug your Android app without slow bad emulator
task runChromeAppDebug(type: Exec) {
executable "bash"
args "--login", "-c", "google-chrome --load-and-launch-app=${projectDir}/${android.defaultConfig.applicationId}.android"
}
task copyChromeAppDebug(type: Copy) {
from "${buildDir}/outputs/apk/${project.name}-debug.apk"
into "${projectDir}/${android.defaultConfig.applicationId}.android/vendor/chromium/crx/"
}
runChromeAppDebug.dependsOn assembleDebug, copyChromeAppDebug
{
"app": {
"background": {
"page": "app_main.html"
}
},
"arc_metadata": {
"apkList": [
-> "{AppDebugApkName}.apk"
],
"enableExternalDirectory": false,
"formFactor": "phone",
"name": "com.example.app",
"orientation": "portrait",
"packageName": "com.example.app",
-> "enableAdb": true,
"useGoogleContactsSyncAdapter": false,
"usePlayServices": [
"gcm"
],
"resize": "scale"
},
...
@filipproch
Copy link
Author

You must first create the directory structure using this command (executed from your android mobile app module directory) :

chromeos-apk --name {YourAppName} build/outputs/apk/{AppDebugApkName}.apk
#you can add any other optional params like --tablet, --scale if you want

don't forget to replace {YourAppName}, and {AppDebugApkName} with particular values

Then you have to modify manifest.json in the generated folder (named after your app package name), above you can se part of the manifest where are the important changes
replace {AppDebugApkName} with your debug apk name
add enableAdb to the arc_metadata block

particular lines are highlighted with arrow at the beggining of line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment