ข้ามไปยังเนื้อหา

Build และ Internal testing

จบหน้านี้จะได้ไฟล์ AAB ของ pd ที่อยู่ใน Internal testing และ tester ลองบนเครื่องจริงแล้ว AAB (Android App Bundle) คือไฟล์ .aab ที่ Google Play บังคับใช้แทน APK สิ่งที่ต้องมีก่อน: บัญชีจากหน้า บัญชี Google Play, โปรเจกต์ที่ตั้งตาม ตั้งค่าโปรเจกต์ Expo และ backend ที่ขึ้น pd แล้วตาม Backend และบัญชี demo

นักพัฒนาเพิ่มค่าของ Android ใน app.json ค่าร่วมอย่าง version, icon และ android.package ตั้งไว้แล้วในหน้า ตั้งค่าโปรเจกต์ Expo

app.json (ส่วน android)
{
"expo": {
"android": {
"package": "th.co.ricesense.app",
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#FFFFFF"
}
}
}
}
ค่า RiceSense เหตุผล
android.adaptiveIcon.foregroundImage ./assets/adaptive-icon.png adaptive icon คือไอคอนที่ Android ตัดเป็นวงกลมหรือสี่เหลี่ยมมนเองตามรุ่นเครื่อง ใช้ PNG 1024×1024 พื้นโปร่งใส โลโก้อยู่ในวงกลมกลางภาพ (ประมาณ 66%) เพื่อไม่ให้ถูกตัดขอบ
android.adaptiveIcon.backgroundColor #FFFFFF สีพื้นหลังที่อยู่ใต้โลโก้

ทำ ก่อน build แรก แอปที่ล็อกแนวตั้ง ("orientation": "portrait") ทำให้ manifest มีฟีเจอร์ android.hardware.screen.portrait แบบบังคับ Play จะถือว่าเครื่องต้องมีฟีเจอร์นี้ แท็บเล็ตบางรุ่น Chromebook และ Android XR จึงติดตั้งแอปไม่ได้ และ quick checks ก่อนส่ง review จะแจ้งเป็น issue นักพัฒนาสร้างไฟล์นี้ แอปยังล็อกแนวตั้งเหมือนเดิม

plugins/withOptionalPortraitFeature.js
const { withAndroidManifest } = require('expo/config-plugins');
const FEATURE = 'android.hardware.screen.portrait';
module.exports = function withOptionalPortraitFeature(config) {
return withAndroidManifest(config, (mod) => {
const manifest = mod.modResults.manifest;
manifest.$['xmlns:tools'] = manifest.$['xmlns:tools'] || 'http://schemas.android.com/tools';
const features = (manifest['uses-feature'] = manifest['uses-feature'] || []);
const existing = features.find((f) => f.$['android:name'] === FEATURE);
if (existing) {
existing.$['android:required'] = 'false';
existing.$['tools:replace'] = 'android:required';
} else {
features.push({
$: { 'android:name': FEATURE, 'android:required': 'false', 'tools:replace': 'android:required' },
});
}
return mod;
});
};

แล้วเพิ่ม plugin ใน app.json

app.json
{
"expo": {
"plugins": ["./plugins/withOptionalPortraitFeature"]
}
}

ถ้า plugins มีรายการอื่นอยู่แล้ว ให้เพิ่มบรรทัดนี้ต่อท้ายในรายการเดิม

เจ้าของโปรเจกต์ Expo รันคำสั่งนี้ เพราะต้อง login EAS (Expo Application Services บริการ build ของ Expo) ด้วยบัญชีเจ้าของ

Terminal window
eas build --profile pd --platform android
  • profile pd ไม่ตั้ง buildType จึงได้ไฟล์ .aab และชี้ API production
  • autoIncrement: true ทำให้ EAS เพิ่ม versionCode (เลข build ของ Android ที่ Play ไม่รับซ้ำ) ให้เองทุก build
  • build แรกของ Android EAS ถามว่าจะสร้าง keystore (ไฟล์กุญแจที่ใช้เซ็นแอป) ให้ไหม ตอบ Yes ให้ EAS สร้างและเก็บไว้
  • build เสร็จ download ไฟล์ .aab จากหน้า build ของโปรเจกต์บน expo.dev ใช้ในขั้นที่ 7

เจ้าของโปรเจกต์ Expo รัน eas credentials -p android → เลือก build profile pd → เลือก keystore → Download existing keystore แล้วเก็บไฟล์ไว้ในที่เก็บความลับของบริษัท ห้ามเก็บใน repo keystore นี้ทำหน้าที่เป็น upload key ของ Play ถ้าหาย จะ upload version ใหม่ไม่ได้จนกว่าจะขอ reset กับ Google

เจ้าของบัญชี Google Play เข้า play.google.com/console แล้วดูชื่อบัญชีที่หัวหน้า Home ก่อนกด Create app ทุกครั้ง

ชื่อบัญชีต้องเป็นบัญชีของบริษัทที่เป็นเจ้าของแอปGoogle Play Console · 19 พ.ย. 2026
หน้า Home ของ Play Console: Welcome to your ricesense account, Organization account, Account ID 9065759258529561775 และปุ่ม Create app
1

ชื่อบัญชีนักพัฒนา

บัญชีที่จะเป็นเจ้าของแอป คนที่มีสิทธิ์หลายบัญชีจะเห็นหน้าเลือกบัญชีตอนเข้า Play Console

ที่เรากรอกricesense · Organization account

เพราะpackage name ที่ใช้ในบัญชีหนึ่งแล้วจะใช้ในอีกบัญชีไม่ได้ ถ้าชื่อที่เห็นไม่ใช่บัญชีของบริษัท ให้สลับบัญชีก่อน

2

Create app

เปิดฟอร์มสร้างแอปใหม่ในบัญชีนี้

เจ้าของบัญชี Google Play กด Create app แล้วกรอกสองส่วน: App details และ Declarations

App details ส่วนบน (ฟอร์มเปล่า ค่าที่กรอกอยู่ในรายการด้านล่าง)Google Play Console · 23 พ.ย. 2026
ฟอร์ม Create app ส่วน App details ก่อนกรอก: ช่อง App name, ช่อง Package name กับปุ่ม Check availability, Default language ค่าเริ่มต้น English (United States) – en-US และหัวข้อ App or game
1

App name

ชื่อที่ผู้ใช้เห็นบน Google Play ยาวไม่เกิน 30 ตัวอักษร

ที่เรากรอกRiceSense

เพราะใช้ชื่อเดียวกับใน app.json แก้ทีหลังได้ในหน้า Main store listing

2

Package name

ตัวตนของแอปบน Android ต้องตรงกับ android.package ของ build pd ฟอร์มตรวจให้ว่าชื่อนี้ยังว่าง

ที่เรากรอกth.co.ricesense.app

เพราะตั้งแล้วเปลี่ยนไม่ได้ ห้ามใส่ตัวที่มี suffix .dv หรือ .te

3

Default language

ภาษาหลักของหน้าสโตร์ ผู้ใช้ที่เราไม่ได้ทำหน้าแปลภาษาของเขาไว้จะเห็นข้อความภาษานี้

  • Thai – thที่เราเลือกหน้าสโตร์หลักเป็นภาษาไทย release notes ใช้แท็ก <th>
  • English (United States) – en-USค่าที่ฟอร์มตั้งมาให้ (ตามในภาพ) หน้าสโตร์หลักเป็นภาษาอังกฤษ ต้องเพิ่มภาษาไทยเป็นหน้าแปลเอง

เพราะผู้ใช้ทั้งหมดอยู่ในไทย เปลี่ยนเป็น Thai ก่อนกดสร้าง เพราะค่าเริ่มต้นเป็นอังกฤษ

4

App or game

ประเภทของแอป กำหนดว่าจะอยู่ในรายการ Apps หรือ Games ของสโตร์

  • Appที่เราเลือกเลือกหมวดหมู่แอปได้ เช่น Productivity
  • Gameไปอยู่ฝั่ง Games และต้องเลือกหมวดหมู่เกม

เพราะเปลี่ยนทีหลังได้ใน Store settings

Free or paid และ automatic protectionGoogle Play Console · 19 พ.ย. 2026
ฟอร์ม Create app เลื่อนลงมา: Default language เป็น Thai – th, App ถูกเลือก, Free or paid เลือก Free และกล่อง You'll get automatic protection
5

Free or paid

แอปนี้ให้ download ฟรีหรือต้องจ่ายเงินซื้อ

  • Freeที่เราเลือกdownload ฟรี แก้ได้จนกว่าจะเผยแพร่ หลังเผยแพร่แล้วเปลี่ยนจาก Free เป็น Paid ไม่ได้
  • Paidผู้ใช้ต้องจ่ายเงินก่อน download บัญชีต้องมี payments profile สำหรับรับเงิน

เพราะแอปใช้เฉพาะเกษตรกรที่ร่วมโครงการ ไม่ขาย และไม่มีการซื้อในแอป

6

Automatic protection

Play เพิ่มการตรวจตัวติดตั้งลงในโค้ดแอป ถ้าผู้ใช้ได้แอปมาจากแหล่งอื่น จะถูกเตือนให้ไปติดตั้งจาก Google Play

  • เปิดไว้ (ค่าเริ่มต้น)ที่เราเลือกแอปที่ถูกนำไปแจกนอก Play จะเตือนให้ผู้ใช้กลับมาติดตั้งจาก Play
  • Turn offไม่มีการตรวจตัวติดตั้ง

เพราะไม่กระทบ build dv และ te เพราะใช้ package name คนละตัวและไม่ได้ขึ้น Play

Declarations ต้องติ๊กครบ ปุ่ม Create app จึงทำงานGoogle Play Console · 19 พ.ย. 2026
ฟอร์ม Create app ส่วน Declarations ติ๊กครบ 3 ช่อง: Developer Program Policies, Play App Signing Terms of Service, US export laws
7

Developer Program Policies

ยืนยันว่าแอปทำตามนโยบายนักพัฒนาของ Google Play

เพราะบังคับติ๊ก อ่านนโยบายเรื่องข้อมูลผู้ใช้และสิทธิ์ของแอปก่อน เพราะเป็นเหตุที่แอปถูกระงับบ่อยที่สุด

8

Play App Signing

ยอมรับให้ Google เก็บ app signing key และเซ็นแอปให้ตอนแจกจ่าย ซึ่งบังคับสำหรับไฟล์ AAB

เพราะkeystore ที่สำรองไว้ในขั้นที่ 4 คือ upload key ส่วน app signing key อยู่ที่ Google

9

US export laws

รับรองว่าแอปทำตามกฎหมายส่งออกของสหรัฐ รวมถึงเรื่องซอฟต์แวร์ที่มีการเข้ารหัส

เพราะบังคับติ๊ก แอปใช้การเข้ารหัสแค่ HTTPS มาตรฐาน

กด Create app แล้วจะเข้าหน้า Dashboard ของแอป รายการงานที่ต้องทำต่ออยู่ใต้ลิงก์ Show more

Dashboard ของแอป (ภาพนี้ถ่ายตอนส่ง review แล้ว)Google Play Console · 23 พ.ย. 2026
หน้า Dashboard ของแอป RiceSense: ใต้หัวข้อมีข้อความ Get started setting up your app กับลิงก์ Show more, กล่องแจ้งชื่อชั่วคราว th.co.ricesense.app (unreviewed), Update status In review และ Production Active 1 country / region

เจ้าของบัญชี Google Play ไปที่ Test and release → Testing → Internal testing → Create new release แล้วลากไฟล์ .aab จากขั้นที่ 3 มาวาง ไฟล์แรกของแอปต้อง upload ในหน้าเว็บ เพราะ Google Play API ยังไม่รู้จักแอปที่ไม่เคยมี bundle eas submit จึงใช้ครั้งแรกไม่ได้ Internal testing คือ track (ช่องทางปล่อย) สำหรับทีมภายใน ไม่เกิน 100 คน และไม่ต้องรอ review

กล่อง upload AABGoogle Play Console · 23 พ.ย. 2026
หน้า Create internal testing release ส่วน App bundles มีกล่อง Drop app bundles here to upload ปุ่ม Upload และ Add from library ยังไม่ได้ใส่ไฟล์
upload แล้วได้แถว App bundle (ภาพจากหน้ารายละเอียดของ release)Google Play Console · 23 พ.ย. 2026
หน้ารายละเอียด release 3 (1.0.0) ส่วน App bundles มีแถว App bundle version 3 (1.0.0) API levels 24+ Target SDK 36 Required features 3
1

Upload app bundles

ที่วางไฟล์ .aab ลากไฟล์มาวางในกล่อง หรือกด Upload แล้วเลือกไฟล์

  • Upload / ลากไฟล์มาวางที่เราเลือกupload ไฟล์ใหม่จากเครื่อง รอ Play ประมวลผลสักครู่
  • Add from libraryใช้ไฟล์ที่เคย upload ในแอปนี้แล้ว ใช้ไม่ได้กับแอปที่ยังไม่เคยมีไฟล์

เพราะเป็นไฟล์แรกของแอป library ยังว่าง

2

แถว App bundle

ผลหลัง upload: versionCode กับ versionName, API levels, Target SDK และจำนวน Required features

ที่เรากรอก3 (1.0.0) · API 24+ · Target SDK 36

เพราะตรวจว่าเลขตรงกับ build ที่ตั้งใจส่ง ถ้า Play แจ้งว่า version code ซ้ำ ให้ build ใหม่ EAS จะเพิ่มเลขให้

เลื่อนลงมาที่ Release details กรอก release notes ในแท็กภาษาของหน้าสโตร์ ใช้ <th> ไม่ใช่ <th-TH> ถ้าแท็กผิด Play จะขึ้น Unsupported language translation และปุ่ม Next กดไม่ได้

Release name และ release notes (เปิดดูอีกครั้งจากปุ่ม Edit release details)Google Play Console · 23 พ.ย. 2026
หน้าต่าง Edit release details ของ release 3 (1.0.0): Release name 3 (1.0.0) และ Release notes ในแท็ก th ข้อความภาษาไทย ด้านล่างขึ้น Release notes provided for 1 language
1

Release name

ชื่อ release สำหรับดูใน Play Console เท่านั้น ผู้ใช้ไม่เห็น Play เติมให้จาก version ของไฟล์

ที่เรากรอก3 (1.0.0)

เพราะใช้ค่าที่เติมมาให้ เพราะบอกทั้ง versionCode และ versionName อยู่แล้ว

2

Release notes

ข้อความ "มีอะไรใหม่" ที่ tester เห็น เขียนในแท็กภาษา แต่ละภาษายาวไม่เกิน 500 ตัวอักษร

ที่เรากรอก<th> รุ่นทดสอบภายในแรกของ RiceSense: ภารกิจวันนี้ ระดับน้ำ บันทึกกิจกรรม ประวัติ และผู้ช่วย AI </th>

เพราะแท็กเปิดและแท็กปิดอยู่คนละบรรทัดกับข้อความ ใต้ช่องต้องขึ้น Release notes provided for 1 language รหัสภาษาที่ถูกดูได้จากตัวเลือกภาษาในหน้า Main store listing เช่น Thai – th

กด Save as draft

เจ้าของบัญชี Google Play ไปแท็บ Testers ของ Internal testing → Create email list → ตั้งชื่อรายชื่อ ใส่อีเมล แล้วกด Save changes

รายชื่ออีเมล tester (เปิดดูอีกครั้ง หัวหน้าต่างจึงเป็น Edit email list)Google Play Console · 23 พ.ย. 2026
หน้าต่าง Edit email list ของรายชื่อที่สร้างแล้ว (ตอนสร้างหัวหน้าต่างเป็น Create email list ช่องเหมือนกัน): List name RiceSense internal testers ช่อง Add email addresses และรายการอีเมลที่เพิ่มแล้ว 2 รายการ
1

List name

ชื่อรายชื่อ tester รายชื่อนี้ใช้ซ้ำได้กับทุกแอปในบัญชี

ที่เรากรอกRiceSense internal testers

เพราะตั้งชื่อให้รู้ว่าเป็นของแอปไหนและ track ไหน

2

Add email addresses

พิมพ์อีเมลคั่นด้วยจุลภาคแล้วกด Enter หรือ upload ไฟล์ CSV

เพราะต้องเป็นบัญชี Google ที่ tester ใช้ login Play Store บนมือถือ

3

Email addresses added

อีเมลที่อยู่ในรายชื่อแล้ว

ที่เรากรอกadmin@futureofgoodlife.com, kiwt07@gmail.com

เพราะใส่เจ้าของระบบและนักพัฒนาอย่างน้อยอย่างละคน

กลับมาที่แท็บ Testers ติ๊กเลือกรายชื่อที่สร้าง แล้วกด Save

เลือกรายชื่อ testerGoogle Play Console · 23 พ.ย. 2026
แท็บ Testers ของ Internal testing ติ๊กเลือกรายชื่อ RiceSense internal testers จำนวน 2 users

เจ้าของบัญชี Google Play กลับไปที่ release ที่ save draft ไว้ → กด Next → หน้า Preview and confirm → กด Save and publish

ตรวจ release ก่อนปล่อยGoogle Play Console · 19 พ.ย. 2026
หน้า Preview and confirm ของ internal testing release: 1 Warning, ขนาด download 23.6 MB, App bundle 3 (1.0.0) และปุ่ม Save and publish
1

Errors, warnings and messages

ผลตรวจไฟล์ Error ต้องแก้ก่อนจึงไปต่อได้ Warning ไปต่อได้

ที่เรากรอก1 Warning: There is no deobfuscation file associated with this App Bundle

เพราะWarning นี้บอกว่าไม่มีไฟล์ mapping ของ R8/proguard ไม่ขวางการปล่อย มีผลแค่ stack trace ของ crash ใน Play Console อ่านยากขึ้น

2

Save and publish

ปล่อย release นี้เข้า Internal testing

เพราะInternal testing ไม่ต้องรอ review แถบล่างเขียนว่า Changes made will be published to Google Play immediately

หน้าต่างยืนยันขึ้นมา กด Save and publish อีกครั้ง

ยืนยันการปล่อยGoogle Play Console · 19 พ.ย. 2026
หน้าต่างยืนยัน Publish change on Google Play? ข้อความ This change will be published immediately ปุ่ม Cancel และ Save and publish

ปล่อยแล้ว track เป็น Active และ release ขึ้นสถานะ Available to internal testers

Internal testing ทำงานแล้วGoogle Play Console · 23 พ.ย. 2026
หน้า Internal testing: Track summary Active, Latest release 3 (1.0.0), ชื่อชั่วคราว th.co.ricesense.app (unreviewed), release 3 (1.0.0) สถานะ Available to internal testers
1

Available to internal testers

release นี้ tester ในรายชื่อติดตั้งได้แล้ว

ที่เรากรอก3 (1.0.0)

2

th.co.ricesense.app (unreviewed)

ชื่อแอปชั่วคราวที่ tester เห็นก่อนแอปผ่าน review ครั้งแรก

เพราะไม่ต้องแก้ ชื่อจริงขึ้นเองเมื่อกรอกข้อมูลแอปครบและผ่าน review

เจ้าของบัญชี Google Play คัดลอกลิงก์ opt-in จากแท็บ Testers ส่งให้ tester แล้ว tester เปิดลิงก์บนมือถือ Android ที่ login ด้วยอีเมลในรายชื่อ → กดเข้าร่วม → ติดตั้งจาก Play Store แล้วลองทุกหน้าหลัก build นี้คือ pd จึงคุยกับ API production ให้ login ด้วยบัญชี demo ที่เตรียมไว้ใน Backend และบัญชี demo ถ้าเจอ bug ให้นักพัฒนาแก้ แล้วเจ้าของโปรเจกต์ Expo ทำขั้นที่ 3 ใหม่ และเจ้าของบัญชี Google Play upload ตามขั้นที่ 7 bundle ที่ผ่านการทดสอบนี้คือตัวที่จะปล่อยใน Production

  • app.json มี android.adaptiveIcon และ plugin ./plugins/withOptionalPortraitFeature
  • keystore สำรองไว้ในที่เก็บความลับของบริษัทแล้ว
  • แอปถูกสร้างในบัญชี ricesense ด้วย package name th.co.ricesense.app และ Default language เป็น Thai
  • Internal testing เป็น Active และ tester ติดตั้งจาก Play Store ได้
  • tester ลองบน build pd ครบทุกหน้าหลัก และจด versionCode ของ bundle ที่ผ่านการทดสอบไว้

ต่อไป: Play Console และส่ง review