Skip to content

Windows: After Build options for Android #529

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Check if apk is available and switch adb to use Corona Sim installed adb
  • Loading branch information
scottrules44 committed Mar 5, 2023
commit 59bc48a075ff111388798e8f0c1da75fd9fd434d
10 changes: 5 additions & 5 deletions platform/windows/Corona.Simulator/BuildAndroidDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -818,12 +818,12 @@ void CBuildAndroidDlg::OnOK() // OnBuild()
//After Build Options
if (afterBuild == AB_COPY_TO_DEVICE) // Copy to Device
{
if (PathFileExists(_T("C:\\Program Files (x86)\\Android\\android-sdk\\platform-tools\\adb.exe"))) { // this should be where adb is installed
CString apkPath = m_pProject->GetSaveDir() + _T("\\") + m_pProject->GetName() + _T(".apk"); // apk path
Exec(_T("cd C:\\Program Files (x86)\\Android\\android-sdk\\platform-tools & adb install -r \"") + apkPath + _T("\" & adb logcat Corona:v *:s")); // install apk and print logs
CString apkPath = m_pProject->GetSaveDir() + _T("\\") + m_pProject->GetName() + _T(".apk"); // apk path
if (PathFileExists(apkPath)) { // check if apk exist (may be aab)
Exec(_T("cd C:\\Program Files (x86)\\Corona Labs\\Corona\\adb & adb install -r \"") + apkPath + _T("\" & adb logcat Corona:v *:s")); // install apk and print logs
}
else { // adb is not installed
DisplayWarningMessageWithHelp(IDS_ADB_NOT_INSTALLED, IDS_ADB_NOT_INSTALLED_WARNING, _T("https://docs.coronalabs.com/guide/basics/debugging/index.html#device-debugging-android"), false);
else { // apk not installed
DisplayWarningMessage(IDS_APK_NOT_FOUND);
}

}
Expand Down
3 changes: 1 addition & 2 deletions platform/windows/Corona.Simulator/Resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,7 @@
#define IDS_ANDROID_BUILD 675
#define IDS_ANDROID_SDK_LICENSE 676
#define IDS_BUILD_NMETA_NAME_NOT_PROVIDED 677
#define IDS_ADB_NOT_INSTALLED 678
#define IDS_ADB_NOT_INSTALLED_WARNING 679
#define IDS_APK_NOT_FOUND 678
#define IDC_LINK_ANSCAMOBILE 1000
#define IDC_BUILD_APPNAME 1001
#define IDC_BUILD_VERSION_CODE 1002
Expand Down
3 changes: 1 addition & 2 deletions platform/windows/Corona.Simulator/Simulator.rc
Original file line number Diff line number Diff line change
Expand Up @@ -859,8 +859,7 @@ BEGIN
IDS_ANDROID_BUILD "Building Android App"
IDS_ANDROID_SDK_LICENSE """You are about to build an Android app for the first time with this build system.\nIt uses the Android SDK and you must read and accept its license agreement in order to proceed.\nNote, the first time it will download about 250Mb which can take several minutes.\nPress 'Yes' to accept, 'No' to decline or 'Help' to read the license agreement."""
IDS_BUILD_NMETA_NAME_NOT_PROVIDED "You must provide path to .nmeta file."
IDS_ADB_NOT_INSTALLED "ADB Not Installed"
IDS_ADB_NOT_INSTALLED_WARNING "You must have Android Device Bridge Installed to Copy App to Device"
IDS_APK_NOT_FOUND "APK not found for build, so cannot install on device"
END

STRINGTABLE
Expand Down